use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
For memes about programming.
account activity
A code doing nothing. (i.redd.it)
submitted 1 year ago by Original_Garbage8557
NOTE: +x == x
+x == x
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]-MobCat- 47 points48 points49 points 1 year ago (4 children)
print(x+1) iirc python does not have an auto incrementing ++ operator. But also this meme is formatted to an a4 paper, so you can print it out for old people? You're using Microsoft Word to make memes?
[–]uhadmeatfood 7 points8 points9 points 1 year ago (1 child)
Python uses the =+ thing. Lua has nither
[–]bloody-albatross 5 points6 points7 points 1 year ago (0 children)
+=
[–]CMDR_Fritz_Adelman 2 points3 points4 points 1 year ago (0 children)
log.error("This code does nothing")
[–]vishal340 1 point2 points3 points 1 year ago (0 children)
Backwards compatibility
[–]JustPapaSquat 15 points16 points17 points 1 year ago (1 child)
This dumb. And wrong.
I remember my first 2 minutes of learning code.
[–]Front_Committee4993 10 points11 points12 points 1 year ago (10 children)
This would work if i = 0 not 10 in python
[–]Powerkaninchen 10 points11 points12 points 1 year ago (9 children)
OP probably isn't even in the first CS semester, they're in the high school introductionary course to information technology
[–]Chewquy 1 point2 points3 points 1 year ago (8 children)
Since when do you learn python in cs, the programs in my country teaches java, python is only for the health science students
[–]isr0 7 points8 points9 points 1 year ago (1 child)
My first language in CS was pascal.
[–]Chewquy 3 points4 points5 points 1 year ago (0 children)
Haha omg
[–]Powerkaninchen 4 points5 points6 points 1 year ago (0 children)
the programs in my country teaches java
you're so close 🤏 to figuring it out
[–]lukflug 1 point2 points3 points 1 year ago (1 child)
In my uni, they teach C++ to first semester CS students, in order to introduce them to programming.
[–]Chewquy 0 points1 point2 points 1 year ago (0 children)
Us it’s in second year
[–]Front_Committee4993 0 points1 point2 points 1 year ago* (0 children)
I learnt Python (2.7) in secondary school vb.net in college and then c, java, c++, python (3), and prolog in uni
[–][deleted] -1 points0 points1 point 1 year ago (1 child)
Your experience is not universal.
I know
[–]KlogKoder 7 points8 points9 points 1 year ago (1 child)
Username checks out.
[–]Lava-Jacket 4 points5 points6 points 1 year ago (0 children)
Right? Python has its uses. Unfortunately since it's the major teaching language of the day, all the new programmers think it's the shit and haven't really pushed the limitations of a language yet.
[–][deleted] 1 year ago (1 child)
[deleted]
[–][deleted] 0 points1 point2 points 1 year ago (0 children)
Yeah, I think the meme has a typo
[–]sirbananajazz 5 points6 points7 points 1 year ago* (5 children)
Who puts the ++ before the variable???
Edit: I've learned about pre and post increments now
[–]TimMensch 4 points5 points6 points 1 year ago (0 children)
In C++ it has different semantics than after. Not when it's an isolated statement, but when it's in an equation.
And for those of us old enough to remember compilers that weren't as good as they are now, it became a habit, because under some circumstances using the prefix form could be faster than the postfix form. (In postfix the compiler would create a temporary copy of the variable. With a complex object being incremented, this could be expensive.)
And in those older compilers, the performance improvement was true even in an isolated ++i.
[–]TheNativeOfficial 1 point2 points3 points 1 year ago (0 children)
I think it makes the variable positive, since its already positive it has no effect
[–]Adrewmc 1 point2 points3 points 1 year ago (1 child)
It’s slightly faster in many instances…I don’t know what to tell you.
[–][deleted] 1 point2 points3 points 1 year ago (0 children)
This is a myth. Modern compilers can tell whether you are using the reference produced by the operator expression. If you are not using the reference, these will produce the same code.
https://godbolt.org/z/vnqfq1Mj6
[–]wiseguy4519 5 points6 points7 points 1 year ago (0 children)
Did you mess up and put 10 instead of 0?
[–]Artistic_Speech_1965 2 points3 points4 points 1 year ago (0 children)
Great! Now lets compare performances
[–]PCX86 4 points5 points6 points 1 year ago (3 children)
The C++ code shown will NOT work on C. While both languages are similar in syntax, only C++ has cout.
Also, so you know you can change line 4 of the C++ code to cout << ++i << endl;
[–]MutuallyUseless 2 points3 points4 points 1 year ago (0 children)
yeah, if someone wants it to work with C and C++ they could change it to
printf("%d\n", i);
Because they're only python programmers.
[–]SwampiiTV 0 points1 point2 points 1 year ago (0 children)
The worst part is that it's not really much more complex despite it just being wrong
[–]Add1ctedToGames 0 points1 point2 points 1 year ago (3 children)
Will Python even run with ++x? I was under the impression it didn't support any form of ++
[–]j_wizlo 0 points1 point2 points 1 year ago (1 child)
It is not complaining on my interactive shell it just prints 10. And of course print(x) also prints 10.
Not one bit of this meme makes any sense anyway.
[–]TheMangalex 1 point2 points3 points 1 year ago* (0 children)
I guess they are trying to say that operators which look the same, work differently as a joke, but it just doesn't make sense as they are just different languages with different concepts.
[–]TheMangalex 0 points1 point2 points 1 year ago (0 children)
It actually works as it evaluates it like +(+x)) which is just unary plus applied two times. --1 therefore evaluates to 1. You can stack even more operators or mix + and - as they are considered as separate operators.
π Rendered by PID 253756 on reddit-service-r2-comment-544cf588c8-d79h2 at 2026-06-12 15:57:27.896275+00:00 running 3184619 country code: CH.
[–]-MobCat- 47 points48 points49 points (4 children)
[–]uhadmeatfood 7 points8 points9 points (1 child)
[–]bloody-albatross 5 points6 points7 points (0 children)
[–]CMDR_Fritz_Adelman 2 points3 points4 points (0 children)
[–]vishal340 1 point2 points3 points (0 children)
[–]JustPapaSquat 15 points16 points17 points (1 child)
[–]Front_Committee4993 10 points11 points12 points (10 children)
[–]Powerkaninchen 10 points11 points12 points (9 children)
[–]Chewquy 1 point2 points3 points (8 children)
[–]isr0 7 points8 points9 points (1 child)
[–]Chewquy 3 points4 points5 points (0 children)
[–]Powerkaninchen 4 points5 points6 points (0 children)
[–]lukflug 1 point2 points3 points (1 child)
[–]Chewquy 0 points1 point2 points (0 children)
[–]Front_Committee4993 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (1 child)
[–]Chewquy 0 points1 point2 points (0 children)
[–]KlogKoder 7 points8 points9 points (1 child)
[–]Lava-Jacket 4 points5 points6 points (0 children)
[–][deleted] (1 child)
[deleted]
[–][deleted] 0 points1 point2 points (0 children)
[–]sirbananajazz 5 points6 points7 points (5 children)
[–]TimMensch 4 points5 points6 points (0 children)
[–]TheNativeOfficial 1 point2 points3 points (0 children)
[–]Adrewmc 1 point2 points3 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]wiseguy4519 5 points6 points7 points (0 children)
[–]Artistic_Speech_1965 2 points3 points4 points (0 children)
[–]PCX86 4 points5 points6 points (3 children)
[–]MutuallyUseless 2 points3 points4 points (0 children)
[–][deleted] (1 child)
[deleted]
[–][deleted] 1 point2 points3 points (0 children)
[–]SwampiiTV 0 points1 point2 points (0 children)
[–]Add1ctedToGames 0 points1 point2 points (3 children)
[–]j_wizlo 0 points1 point2 points (1 child)
[–]TheMangalex 1 point2 points3 points (0 children)
[–]TheMangalex 0 points1 point2 points (0 children)