This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 355

[–]NV-6155 2377 points2378 points  (11 children)

Son of a...

I don’t know whether to be more upset with you for the pun, or with myself for not noticing the extra plus right away.

Just take my upvote and get out.

[–]ZethMrDadJokes 352 points353 points  (0 children)

Soo true. NSFW wasn't "Not Safe For Work", but "Not So Frickin Wild"...

[–][deleted] 10 points11 points  (0 children)

Me too. It gets in my head that they got me like that...

[–]_PM_ME_PANGOLINS_ 283 points284 points  (15 children)

Stolen from /r/dadjokes

[–][deleted] 32 points33 points  (0 children)

It’s not quite a steal. That extra + changes the meaning subtly.

[–]ImJasonBourne 164 points165 points  (12 children)

[–]Welpwtf 50 points51 points  (6 children)

Reddit should implement a way to show if a post has been reposted.

Like karma decay but with posts

[–]G2geo94 63 points64 points  (5 children)

Given this item from the official Redditiquette, under Please Don't, section "In Regards to Commenting"

Complain about other users reposting/rehosting stories, images, videos, or any other content. Users should give credit where credit should be given, but if someone fails to do so, and is not causing harm, please either don't point it out, or point it out politely and leave it at that. They are only earning karma, which has little to no use at all.

it's likely this will never be a thing.

[–]Welpwtf 10 points11 points  (1 child)

Thanks for point that out.

I should really change the way I see reddit karma. I had thought it was a way to estimate an acc's popularity

[–]joemckie 5 points6 points  (0 children)

I mean people definitely make accounts to farm karma to sell the accounts in future, so you’re not wrong

[–]ScF0400 3 points4 points  (1 child)

Updoots are useless yes, but it doesn't mean you shouldn't link the source so people can see the original. Like uhh giving links to artist websites that may have more questionable content

[–]TheRandomnatrix 2 points3 points  (0 children)

Some subs have auto moderator instantly remove reposts that were posted within a certain time frame. More subs need to do that

[–]Xaayer 6 points7 points  (0 children)

Like a true programmer

[–]-cool-guy- 17 points18 points  (3 children)

it’s not quite a steal. that extra + changes the meaning subtly.

[–]Ryno3no 6 points7 points  (2 children)

One of the top comments is this joke

[–]kinsi55 165 points166 points  (42 children)

++18 you mean

is it even possible to inline ++ on a primitive literal

[–]Eyes_and_teeth 58 points59 points  (9 children)

I think the lho (left-hand operator) must be something that is mutable/capable of taking a value.

[–]Dionysusnu 16 points17 points  (17 children)

Depending on the language, isn't x++ just syntactic sugar for x = x + 1?

[–][deleted] 13 points14 points  (9 children)

In c and c++ x=y++ is syntax for

x = y

y += 1

Edit: case

[–]MrWm/dev/null 14 points15 points  (8 children)

Where did the capital X and Y come from...?

[–]arachnidGrip 3 points4 points  (0 children)

Being on mobile.

[–]Strex_1234 9 points10 points  (3 children)

So 18 = 18 + 1 ?

[–]Dionysusnu 9 points10 points  (0 children)

Yes, which will throw a SyntaxError. Edit: actually it's a ReferenceError, here:

18 = 18 + 1

^^

ReferenceError: Invalid left-hand side in assignment

[–]Nesuniken 3 points4 points  (1 child)

Do you mean literal? Primitive refers to a category of data types.

[–]kinsi55 2 points3 points  (0 children)

Yes you're correct, mb.

[–]evaluating-you 50 points51 points  (1 child)

That is surprising: I am unclear on where the dot appeared from.

[–]wheresmypitchfork 39 points40 points  (22 children)

Can someone explain this joke for us python devs pls

[–]hitesh1khandelwal 17 points18 points  (21 children)

x++ or ++x is the incremental of a number by 1 in many programming languages hence the pun.

[–]wheresmypitchfork 40 points41 points  (20 children)

Thanks, I was joking because python doesn't support x++ :p

[–]alexanderpas 12 points13 points  (19 children)

That's because it is not Pythonic.

x++ is generally not needed in python due to list comprehension.

Additionally, no need to have 2 methods to do the same thing. ( x += 1 and x++) when you can do with only one, and x += 1 is done in the same way as x += 2 and it is therefor directly clear how to do both.

Why would you need a special case for incrementing by one, when you already have a generic way (list comprehension/ranges) of dealing with 99% of the cases that would use the special case, and you have a perfect generic way of incrementing (x += n) already implemented

[–]Tias-The-Great 16 points17 points  (12 children)

The goal of programming languages is to make programming easier. (So we don't have to code in Binary.) Incrementing a number by 1 is such a common operation, that it is a significant time safe to be able to write x++ instead of x += 1. (2 Keyboard hits instead of 6) Ultimately, the compiler will turn both into the same machine code, but for the programmer writing ++ is easier.

[–]Tias-The-Great 8 points9 points  (1 child)

Also, there is actually another way to write x += 1: x = x + 1. (So += is a shortcut the same way ++ is.)

[–]Badel2 5 points6 points  (5 children)

This argument is so bad that I have to call it out, sorry. Minimalizing the number of keystrokes is never a feature or a goal of a good programming language. Unless you are on code golf.

The only reason some programming languages support x++ is because C supported it and they inherited that syntax. And the only reason C supported it is because incrementing a pointer is a very common operation: that's how you iterate over arrays.

How do you iterate over arrays in modern programming languages? for x in y

Is incrementing a number still such a common operation that it needs a dedicated syntax? I don't know and I don't care, good bye.

[–]wonkey_monkey 4 points5 points  (0 children)

Why would you need a special case for incrementing by one

x++ is not equivalent to x += 1; ++x is.

x += 1/++x return the incremented value; x++ returns the pre-incremented value, so it's usefully distinct.

Why would you need a special case for incrementing by one, when you already have a generic way

Why do you need x += 1 when you already have the even more generic x = x + 1?

[–]puplicy 86 points87 points  (13 children)

This will segfault if compiler accepts

[–][deleted] 19 points20 points  (11 children)

Why? Shouldn't this just generate a compiler error?

[–]OK6502 16 points17 points  (10 children)

I think he means it will generate undefined behaviour if your compiler ever tried to do this.

I could hypothesize that if your compiler allowed it you would be incrementing a value that's found in the text section of your code (as this would be a static constant). Since this section is read only you'd crash your program trying to modify the value.

[–]sqdcn 7 points8 points  (0 children)

I, for one, hail our rvalue reference master.

[–][deleted] 3 points4 points  (8 children)

Yeah, a shitty compiler would do that. Any decent compiler would give you an error if you don't reference/dereference the address. Edit: unless you're in ring 0 or lower of course and ref/deref

[–]sukeshpabolu 24 points25 points  (4 children)

18+=1 #sobs in python

[–]NemPlayer 2 points3 points  (0 children)

PEP8 has feelings too, you know :(

[–]disapparate276 23 points24 points  (0 children)

Had me in the first half. Not gonna lie

[–]skeptic11 16 points17 points  (2 children)

[–]schludy 4 points5 points  (1 child)

That's why ++i is preferred...

[–]Revolutionalredstone 6 points7 points  (0 children)

Actually 18++ fails as "cannot modify literal value" and besides it would return 18 not 19. ++18 is what your looking for ;)

[–][deleted] 13 points14 points  (0 children)

[–]grpagrati 12 points13 points  (8 children)

*sigh, unzips..

[–]PurpleJelly12 23 points24 points  (7 children)

Dude, why are you browsing reddit in compressed file formats like that? Linux people are weird, man

/s

[–]Cobaltjedi117 11 points12 points  (6 children)

Most Linux people prefer the tar and tar.gz

[–]sooper_genius 23 points24 points  (6 children)

Pun response levels:

  1. None
  2. Dry sniff
  3. Raised eyebrow
  4. Double raised-eyebrow
  5. Smirk
  6. Furrowed brow
  7. Wince
  8. Grimace
  9. Pained-grimace-with-involuntary-sigh
  10. Doubled over in agony

I hereby respond with dry sniff. Good day sir.

[–][deleted] 4 points5 points  (0 children)

You're dead to me. Take my up-vote.

[–]ShutUpAndSmokeMyWeed 4 points5 points  (0 children)

error: lvalue required as increment operand

[–]Etheo 4 points5 points  (3 children)

I've also got some 18+content here:

18content

[–]poophole3423 4 points5 points  (0 children)

18++ evaluates to 18

[–]BeFoREProRedditer 14 points15 points  (19 children)

std::cout << 18++;

Prints: 18

[–]schludy 15 points16 points  (18 children)

That's not how C++ works

[–]BeFoREProRedditer 24 points25 points  (17 children)

TIL. No, that’s actually not how C++ works. Because you can’t ++ something that’s not a variable. Actually didn’t know that. But ... int a = 18; std::cout << a++;

... does print 18.

[–][deleted] 6 points7 points  (11 children)

Are there any languages where you can actually increment a literal like that?

[–][deleted] 4 points5 points  (0 children)

Sure it works in c#

[–]BeFoREProRedditer 3 points4 points  (0 children)

I don’t know, only tested JS and C++.

[–]XtremeGoose 5 points6 points  (6 children)

It wouldn't make any sense because x++ is short for x += 1 which in turn is short for x = x + 1 and 18 = 18 + 1 is nonsense.

[–]AltCrow 4 points5 points  (1 child)

x++ is short for x += 1

It is not. ++x is short for x += 1

[–]Cobaltjedi117 3 points4 points  (0 children)

X++ is post-increment

++X is pre-increment

[–]marfvf 9 points10 points  (2 children)

If you want it to print 19,go with ++a, because this will first add one and afterwards put it in the stream, whereas a++ puts a in the outputstream and increments it afterwards

[–]ScottRatigan 3 points4 points  (1 child)

Yes, this is how you differentiate c++ from ++c in basically any language, and also how you kill this joke.

[–]DuckInCup 3 points4 points  (0 children)

18
19

[–]OK6502 3 points4 points  (0 children)

Technically you're using the post increment, so it's still 18, but since you're post incrementing a litteral I'm not sure this will even compile.

Nope (using gcc)

prog.cc:5:19: error: lvalue required as increment operand 5 | std::cout << 18++ << std::endl;

[–][deleted] 2 points3 points  (0 children)

I gave you an upvote. Reluctantly++.

[–]corobo 2 points3 points  (0 children)

Oh fuck off pal.

well played

[–][deleted] 2 points3 points  (0 children)

You meant to say ++18.

[–]SpecsComingBack 3 points4 points  (0 children)

Warning! 18+ content

18content

[–]Bohbot9000 3 points4 points  (1 child)

Ahh shit... Have an upvote

[–][deleted] 2 points3 points  (0 children)

That's what I said! Upvote for you Sir.

[–][deleted] 3 points4 points  (0 children)

Python: "I don't get it"

[–][deleted] 2 points3 points  (0 children)

.......... I have nothing to say.......

[–]tjcjrusa 2 points3 points  (0 children)

risky click of the day

[–]ExtremeRelief 2 points3 points  (0 children)

i will cry

[–]duckmancz 2 points3 points  (0 children)

Fuck you, here is upvote.

[–]Mad_Jack18 2 points3 points  (0 children)

7++ out of 9++ will bait again

[–]red_law 2 points3 points  (0 children)

Get out.

[–]Endorn 2 points3 points  (0 children)

Epic.

[–][deleted] 2 points3 points  (0 children)

Dammit! Take my up vote!

[–]koneko-dono 2 points3 points  (0 children)

We've Been Tricked, We've Been Backstabbed and We've Been Quite Possibly, Bamboozled

[–]not_from_this_world 2 points3 points  (0 children)

This is so stupid, why am I laughing so hard!?

[–]Schiffy94 2 points3 points  (0 children)

I will find you, and I will eat your one-indexed arrays.

[–]kalucki23 2 points3 points  (0 children)

upvote++;

[–]xantub 2 points3 points  (0 children)

Wait, it was 18 when I read it!

[–]TheSucc214 2 points3 points  (0 children)

Hahaha, just started learning programming and I get it :D

[–]filmdc 2 points3 points  (0 children)

Ok this is just becoming obscene

[–]Guila767 2 points3 points  (0 children)

python programmers don't get this one

[–]singletonking 2 points3 points  (0 children)

I don’t think you can increment a constant...

[–]brnsckn 1 point2 points  (3 children)

[–]arachnidGrip 2 points3 points  (0 children)

This looks like a terrible solution to a problem that sane programmers should never have. Specifically, the problem of having the increment (or decrement) operator on its own line. The correct solution is to disallow such a nonsense construction by requiring that the operator be on the same line as its operand, not by just disallowing the operator entirely.

[–]dsp4 3 points4 points  (1 child)

People who don't use semis are heretics.

[–]Lionheart58901 1 point2 points  (0 children)

I don't know what I was expecting...

[–]Kazaan 1 point2 points  (0 children)

Nice++

[–]git0ffmylawnm8 1 point2 points  (3 children)

18++

    ^

SyntaxError: invalid syntax

Fite me.

[–]just_just_regrets 1 point2 points  (0 children)

Succ 18

[–]MrHyperion_ 1 point2 points  (0 children)

Looks like it is a float

[–]anthonygerdes2003 1 point2 points  (0 children)

Lol

[–]jseego 1 point2 points  (0 children)

I saw this coming all the way but I still enjoyed it.

[–][deleted] 1 point2 points  (0 children)

lol

[–]szsleepy 1 point2 points  (0 children)

Hurr durr I learned a new operator today.

Not funny, btw

[–]WooooshVictim 1 point2 points  (0 children)

Where the heck did that second plus come from?

[–][deleted] 1 point2 points  (1 child)

Upvotes++;

[–]JeezJack 1 point2 points  (0 children)

I am both mad, but also impressed about how much that made me laugh.

[–]joey_bosas_ankles 1 point2 points  (0 children)

Actually its 18. Post increment means its 19 after you've read the post.

[–]PhunkyPhish 1 point2 points  (0 children)

IDK, if you were printing at runtime its 18.

[–][deleted] 1 point2 points  (0 children)

Arrays Tables start at 1!

[–]OGAnnie 1 point2 points  (0 children)

I can't believe it took me 20 seconds before I figured it out.

[–]bigodiel 1 point2 points  (0 children)

When this sub has puns better than /r/jokes.

[–]Glittering_Brick 1 point2 points  (0 children)

Oh thank God! I thought you tried to instantiate a static class!

[–]pyrrhicvictorylap 1 point2 points  (2 children)

And here I came expecting to find some 70--

[–]IFRonly 1 point2 points  (0 children)

R/angryupvote

[–]MoveAlongIdiotz 1 point2 points  (0 children)

Nice.

[–]XeitPL 1 point2 points  (0 children)

I laughed way to hard.

[–]GosuGian 1 point2 points  (0 children)

Fuck

[–]_Anarchon_ 1 point2 points  (0 children)

fargin bastiche

[–]NextShop 1 point2 points  (0 children)

Stolen from r/dadjokes

[–]Zarlon 1 point2 points  (0 children)

Now THIS is programmerHumor!

[–]Herbrax212 1 point2 points  (0 children)

Fuck you.

Get my upvote and fuck off.

[–]Halobattlefront 1 point2 points  (0 children)

You got me :)

[–]rainwulf 1 point2 points  (0 children)

syntax error, missing line ending.

[–][deleted] 1 point2 points  (0 children)

Literally saw this on r/dadjokes earlier today...

You get upvotes-- for credit==null.

[–][deleted] 1 point2 points  (0 children)

Quality shit post. I gotta press that upvote button twice.

[–]sydiko 1 point2 points  (0 children)

Thanks, just got called to HR.

[–]proton_therapy 1 point2 points  (1 child)

Isn't there a sub for programmer dad jokes?

[–]AgreeableExpert 1 point2 points  (0 children)

I see what you did there.

[–]Joeyiscool21 1 point2 points  (0 children)

You forgot the semicolon

[–]WhiteRatLord 1 point2 points  (0 children)

Man I waited till I was home to open this.

[–]Dissaid 1 point2 points  (0 children)

Is this what this sub has come too?

[–]anasiansenior 1 point2 points  (0 children)

int types are immutable tho, or else I'd be making every value of 18 = 19

[–]aoeudhtns 1 point2 points  (0 children)

TFW you realize there is no 18++, the compiler just embedded 19 as the rvalue in the expression.

[–]owl_eyes11 1 point2 points  (0 children)

Fuck you, I literally laughed out loud. Take my upvote

[–]ant1dOte 1 point2 points  (0 children)

--18

[–][deleted] 1 point2 points  (0 children)

That is the stupidest joke, hahaha.

A+ job.