Right. So i had them the other way around. :D
Thanks for clarifying.
Right. So i had them the other way around. :D
Thanks for clarifying.
Yes.
p++
== p+= 1
== p = p + 1
are all the same if you use it in an assignment.
++p
is different if you use it in an assignment.
If it’s in its own line it won’t make much difference.
That’s the point I was trying to make.
What I meant was:
In the screenshot it said x = *(++p)
and iirc that is not the same as saying x = *(p++)
or x = *(p += 1)
As in my example using ++p will return the new value after increment and p++ or p+=1 will return the value before the increment happens, and then increment the variable.
Or at least that is how I remember it working based on other languages.
I’m not sure what the * does, but I’m assuming it might be a pointer reference? I’ve never really learned how to code in c or c++ specifically. Though in other languages ( like PHP which is based on C ) there is a distinct difference between ++p
and (p++
or p+= 1
)
The last two behave the same. Though it has been years since I did a lot of coding. Which is why I asked.
I’ll install the latest PHP runtime tonight and give it a try xD
p = 1
x = ++p
// x = 2
// p = 2
p = 1
x = p++
// x = 1
// p = 2
++p
will increase the value and return the new value
p++
will increase the value and return the old value
I think p = p + 1
is the same as p++
and not as ++p
.
No?
Lets get one thing straight.
This is rarely ever the developer and more a business stakeholder forcing you to push the Friday deploy button.
I’ve had somebody in the business escalating to my team lead, head of development and CIO because i flat out refused to deploy something on Friday at 16h.
So no. This is not the developer making a hard choice. There should be somebody coercing or forcing him to push the deploy button.
Used to have two. Went back to one. Professionally I feel like 2 monitors is a must ( excl. Laptop ). Or a single big ass monitor.
We’ve got ( a single ) curved screens at work. It also works because it’s wide enough.
Professionally I do believe it boosts productivity. Personally/at home not really ( for me ). It can be convenient if you play an MMO and want to look something up while still seeing the game.
I do have a spare monitor but I disconnected it as I was rarely using it.
Generally I’m not very preoccupied with it as the IDE just formats it the way I like it on save :D.
Correct. The way I’m used to it ( and how I thought the world worked ) is that the IDE gives tab a fixed length or characters. If you set it to 4 it would be the equivalent of 4 spaces or 4 letters or whatever.
If my tab is set to 4 it would take up the width of 4 characters. If I need two indentations I would press tab twice.
If bob then checks out my code and calls me a maniac and sociopath for using indentation and swears by “2”, the code would just look more condensed. The alignment would still work out because that’s done through spaces.
var user_name = "Bob"
var user_age[tab]= "Bob"
This would align the =
for Bob, because it needs two characters to align and that’s what his tab width is. It wouldn’t align for me because my tab width is 4. So I would.pur two spaces instead of the . That way it is aligned for everybody regardless of their tab width settings.
The way you explain it sounds like how tabs works in MS Word ( or other word processors ).
I don’t think I could work like that. I’ve only ever used IDEs to code ( regardless of how primitive they were back when I started). Interesting take though :D
What I mean with tab = x spaces is only visually and not actually ( there will ( obviously) still be a tab character in my preference. Not sure if that was clear.
Because alignment are fixed characters compared to indentation. For indentation the only question is how many characters the next indentation needs to be.
For alignment it is not fixed. As an example of PHP code:
function test(&obj) {
$obj->doSomething()
....->doSomethingElse()
}
The dots would be spaces because in IDEs people generally use a font where every character is equally wide.
If I would tab again instead of spaces it could work out if my tab length display is ( for one or more ) adds up to the width of the variable $obj
. If somebody else has a tab width of 2 rather than somebody who has 3. It would only align for one of the two people.
Does make sense? I typed it out after a gym session on my phone.
Additionally. The whole problem is resolved by using spaces for both alignment and indentation. But in the cursor would still jump one space at a time rather than the whole tab ( although there are keyboard shortcuts for jumping words which would jump all of em.
I don’t know. Call me old fashioned. I like what I like :/
Honestly I always preferred tabs for indentation and spaces for aligning. It doesn’t break anyone’s experience. And if somebody wants two spaces for a two-space-tab-width for indentation and other people prefer four. That will work just fine.
I hate seeing 2 space indents. Unreadable AF ( to me ). At least this way I can easily work in the same codebase without somebody being annoyed ( except for the crying about the tabs )
Thanks for the answer!
What is it used for then? Face recognition?
Edit: honest question before I come off as agressive :)
I think it was this one ( quick Google search ) https://www.kaipattersonfilms.com/kenobi
Edit: it’s 2.5h
Edit 2: I haven’t seen it, so I don’t even know if it’s any good. I’m not associated with or receive any benefit by linking it here.
Wasn’t there a guy who turned the series into a movie by remastering it into a 1h30m video. I think I bookmarked that on my Reddit account before Lemmy was around ( or before the whole fuck spez thing anyway. Lemmy has been around longer than that ).
You’ll probably enjoy top secret! in that case.
The naked gun movies are based on a series called “police squad”. There are so many gems going on in the background that you’ll notice new things rewatching it. It’s also with Leslie Nielson.
Definitely check it out if you haven’t :).
Qui gon was reincarnated?