A true intellectual

A true intellectual

Attached: jlytmi9fvzo21.png (612x472, 141K)

Other urls found in this thread:

godbolt.org
twitter.com/SFWRedditGifs

V += 1

v = (v*0+1) + v

Another shitry leddit meme posted to Jow Forums...
This place is going to shit.

As a retard which can't even write hollow world yet I appreciate the top version a lot. I never under stood the way you increment and change a variable with v++ but it makes a lot more sense to me as v = v + 1

hum yes, I remember when I thought I was smart because I understood the interface actually smart people made for me to program a computer

hold my beer

++v;

(bet you java niggers won't get this one xD :^))

If you don't like it, why did you intentionally enter the thread and reply to it? You only encourage it. If you lack self control, try the hide and filter features. If a thread breaks the rules, report it. It's that simple.
You may not like this but it's not breaking any rules, so you should just ignore it and either go into threads you do like and reply to posts you like or make some of your own.

What you're doing is counter to yourself only.

based

shut the fuck up autist

You can't make me.

beautiful

int increment_by_one();

int main() {
int v;
increment_by_one(v);
return v;
}

int increment_by_one(n){
n = n + 1;
return n;
}

I need something better to do than this.

>If you don't like it, why did you intentionally enter the thread and reply to it? You only encourage it. If you lack self control, try the hide and filter features. If a thread breaks the rules, report it. It's that simple.
>You may not like this but it's not breaking any rules, so you should just ignore it and either go into threads you do like and reply to posts you like or make some of your own.
>What you're doing is counter to yourself only.
Shut up autisto

Force the result to be a pointer
void increment_by_one(int input, int *result);

kill yourself OP

The irony is that getting upset over people preferring different things than yourself is actually an autistic trait.

you have to go back

Couldn't you just drop the whole thing down to pointers to reduce memory usage?

I'm sorry but that's not going to happen.

kill yourself, redditard

Attached: image.jpg (530x423, 198K)

I thought the post was trying to make things intentionally obtuse and bad. What is the worst way to increment.

please buy a tank of helium and an oxygen mask and suck in that sweet sweet helium for a good hour

Attached: 1524945615781.jpg (504x493, 30K)

This is old imageboard etiquette, nothing to do with Reddit. It's the standard for having a high quality board. Posting in threads does nothing but give them life, if you want them to die, you must ignore them.
>but what about sage
What about it?
posting a reply that doesn't bump will still often result in a reply that does, that is instigated from your own post.

Spend more time here and you'll learn.

kill yourself swiftfag
fuck off redditard

Fuck off you fucking idiot, this board makes the exact quality post. You autistic fucks can't comprehend anything.

Again, you're only keeping this thread around longer and upsetting yourself. I obviously don't mind since I have no problems with the thread. You're giving me the opportunity to bump it.

Fuck off you fucking fuck
Stupid fuck
I don't give a shit you retard

Attached: 1505879896669s.jpg (221x250, 5K)

stupid niggers go back to gaia

>I don't give a shit you retard
You sure seem like you do since you're taking it seriously, getting upset, and replying endlessly.
If you don't give a shit, then close the thread. What do you think you're going to accomplish otherwise? Even if you flood the thread someone is just going to remake it because it got the results they wanted.

You're the type of idiot who makes Jow Forums the worst board full of loser weebs and neets. Go back to redd*t right NOW!

What's wrong with OP?
The 2 statements are not even the same
var a = 3
var b = 3
var c = 3
console.log((a = a + 1) + 1)
console.log((b++) + 1)
console.log((++c) + 1)

OP is the typical reddit retarded who doesn't know his place.

>full of losers weebs and neets
>G-Go back!!!!
so fucking ironic
actually go back to you fucking transplant
fuck off retard no real posts here

t. 10 years old

>t. weebs
Don't worry, just go ahead and talk to your imaginary gf and everything is going to be all right.

Because v++ supposedly calls instruction INC inside the processor, while the other one increments and then assigns separately. Single instruction is obviously better.

>has to copy my answer
ahahah the absolute tool

no ill just talk to my actual gf
stop projecting

any decent compiler will make them both single instruction anyways

Sure dude

>t-theres no way someone who isnt a giant faggot could have a gf
>im a giant faggot and ive never even touched a girl!
its time to buy a rope

v += 1;

js is not for intellectual more for brainlet hipsters fags

this is the diff file between two disassemblies of the following

int main()
{
int i = 1;
i++; /* ++i; */
}

Attached: 2019-03-29-134912_509x249_scrot.png (509x249, 16K)

run through gcc with make. Tempted to try cc to see if there's any noticeable difference.

v.increment(1)

v += 1 except it's in smalltalk

this code will not increment v due to pass by value.

The only times I go on Reddit are when I get there through search results. Not sure why you have this preconceived notion that I must be from Reddit. Not that it would matter anyway. We're talking about imageboards, as far as I know Reddit aint one of those.

What's make have to do with it? It's still just going to invoke the compiler.
godbolt.org

>Single instruction is obviously better.
That's not inherently true.

run through tcc instead of cc.

blue is ++i;
purple is i++;

both binaries are exactly the same size, at 2492 bytes. cc produced 20kb binaries.

Attached: 2019-03-29-140120_419x540_scrot.png (419x540, 39K)

Attached: FB_IMG_1553882750544.jpg (700x599, 79K)

only correct answers in this thread. Though any modern optimizing compiler (even gcc at -O0?) will avoid generating the extra instructions for a bare i++ since it can trivially detect that the pre-increment rvalue is never used

and lastly, clang

++i; is purple
i++; is blue

myth busted?

Attached: 2019-03-29-141041_452x184_scrot.png (452x184, 14K)

v -= 0xFFFFFFFF

oog

>tell compiler not to optimize
>it does it anyway
Fantastic.

v = 1/ v * v + v

That's because it isn't an optimization to discard the result of something you explicitly discarded.

>needing a gf
hit the gym, dyel

// NOTE n must not be a negative number
if (n == 1) n = 2;
else if (n == 2) n = 3;
// TODO complete
else if (n == MAX - 1) n = MAX;
else if (n == MAX) throw new Exception("n is too large to increment");

you could've done exactly what you just said but instead decided to be a basedboy
like me
fuck this is an endless loop

go back to where you came from
sage

>going to
how new?
fresh off the boat from reddit ill wager.

jfc you're such a tryhard tone it down a bit lad yeah?

>not that it would matter anyway
user ...

That doesn't make sense, I want to reply to that post because it's funny to me, and I have no problem with the thread. Only the other person wants to not see the thread, and continues to be upset over it and my own replies. I have no problem trying to give them advice.

?

v = v + 1

Attached: 1544380615536.png (720x736, 177K)

v = v + v / v

v = v + 2; // ugh

v+++; // DAS IT MANE

v = v.AddOne();

Those statements are not equivalent.

why is it ++ anyways you're only adding one????

They are in this context, smartass

v = VFactory.Generator().Factory
value = v.Get()
v.Set(value + VFactory.Generator().DefaultIncrimentValue)

++v++

There is no context, ricky retardo.

v = ++v;

Holy shit autists in this thread seething beyond belief. Based Reddit.

Add support for loadable beans with custom incrimentation logic and you get the job.

>not v+=1
Literal thread full of unemployed Haskell & C "programmers"

So this is the power of reddit...

Attached: nice.gif (350x255, 1.78M)

Yes there is, we see the whole line of code and thus we know that it doesn't matter what the values are during the execution of that line, because the values aren't used for anything in that line. It only matter what the value was before that line and what is is after the line. And they are equivalent in that regard.

*dst++ = *(++src);

Attached: 1503366624711.png (451x619, 392K)

the assembler output, at least for gcc, is identical in both cases. The disasssembled output is also the same, although the addresses are different.

Attached: 2019-03-29-152232_1366x768_scrot.png (1366x768, 101K)

compiler and architecture specific
i've seen i++ be 1 instruction more than ++i in a specific case compiling with greenhills for some ppc embedded system target
its the same with
if (i == 0u) {}
if (0u == i) {}

where the latter would be one instruction shorter on the same target

I dont understand why reddit people would ever come to Jow Forums, the format is totally different, same way anyone who likes imageboards and how they work would never enjoy reddit.

They're not really comparable imo. To me this is like saying you can't use Jow Forums and YouTube since they're different formats with different purposes. You can draw analogies like images to videos, threads to video pages, replies to comments, etc. but they're not really the same thing just because they share similarities.

Reddit is intended to be more like Digg and those kinds of sites, basically link aggregates with user influence around them while imageboards are for more broad, ephemeral, discussion and sharing of images.

1 is more like a bookmarking and search tool while the other is more like a digital forum.
Reddit is hardly a good place for discussion for all kinds of reasons. Not just Bias but it's not really well designed for that kind of thing.

alright well, on x86_64 using any publicly available compilers, they compile to the same program.

Ratings bring the best content to the top. Of course in a serious discussion this can lead to bias, but for the most part it results in a good experience for the user because all the submissions on the front page and all the comments you immediately see in the comment section, are high quality such as funny, informative, important etc.

I guess you could be right, I personally dont understand reddit, like whats the point of rating somebodys posts but not engaging in a discussion? Why would anyone bother, for what reasons?

yes of course
even
i % 2
and
i & 1
should compile to the same instructions thanks to semantic analysis on x86
but even so, it is compiler and target specific

Why did you intentionally enter Jow Forums and make a thread when you clearly have no intention of conforming to the norms of the website?

Attached: 1511899142460.jpg (500x301, 14K)

This is the best one, as you can actually choose the number.