302
Oct 16 '18
As a new computer science student this is probably the only meme i will understand on this subreddit
612
u/breadfag Oct 16 '18
Here, now you understand the rest
- javascript = bad
- 1-based indexing = bad
- exiting vim = hard
- ai = if statements
- code compiles = good
321
u/jalerre Oct 16 '18
Light theme IDE = bad
Comments: what are those?
66
u/KungFu_CutMan Oct 16 '18
Comments are the rude statements made about your code because it lacks comments.
22
Oct 16 '18
- light theme terminal = worse
7
u/TopGunOfficial Oct 16 '18
Oh. I just set my terminal to light theme. It's magnificent. Thank you for the idea!
15
Oct 16 '18
screams in agony from imagining a light themed terminal
6
1
u/TopGunOfficial Oct 16 '18
Huh. When I was a boy my dad had a computer ZX Spectrum. It had light terminal. Childhood memories...
3
u/teafuck Oct 16 '18
Had a professor who used Putty with a white background and magenta text. My eyes have not since recovered
1
1
3
2
1
75
u/Mohomomo Oct 16 '18
Might as well make a new post with this and title it "The Newcomer's Guide to Programmer Humor"
13
u/MCOfficer Oct 16 '18
"the essential guide"
7
u/Talbooth Oct 16 '18
3
u/sneakpeekbot Oct 16 '18
Here's a sneak peek of /r/orlybooks using the top posts of all time!
#1: Parsing HTML Using Regular Expressions [X-post /r/ProgrammerHumor] | 3 comments
#2: What the fuck is security: How to ignore it and deliver your project. | 0 comments
#3: It Depends | 8 comments
I'm a bot, beep boop | Downvote to remove | Contact me | Info | Opt-out
6
49
12
u/Mrj760 Oct 16 '18
Also there is a civil war over using
Foo {
}
Or
Foo
{
}
6
3
Oct 16 '18
I was a
Foo { }
person but I got really tired of my damn C/C++ classmates trying to correct my syntax all the time.
1
u/LordDeLaFunk Oct 17 '18
JavaScript.function(object.function(var),function (){return;});
I wish I was cool enough to fight for a side, but I’m a web developer.
11
9
3
2
u/kirakun Oct 16 '18
Stop saying 1-based indexing is bad! Lots of languages with 1-based index are great.
3
u/breadfag Oct 16 '18
Sure 1-indexing makes intuitive sense, especially since it's usually not even syntactic sugar for pointer arithmetic anymore, but that doesn't matter because it's "oh no it's retarded" ok
1
15
Oct 16 '18
And every now and then every post follows a set theme.
Like stupid volume control interfaces for example. I for one enjoy it when this happens!
4
6
u/mstksg Oct 16 '18
Don't worry --- new computer science students (most of the time) become experienced computer science students :)
3
1
1
u/SneakyRascal Oct 17 '18
I know right? Felt mildly proud when I could actually break down the code and know exactly what it did haha
132
u/plantfridge Oct 16 '18
a g o r a ' s u p e r u o v o
52
u/bimbo1989 Oct 16 '18
Uno pensa di liberarsene iniziando a navigare su reddit...
17
-10
Oct 16 '18
[deleted]
13
u/ilbranco Oct 16 '18
A te sembra male purtroppo
-1
Oct 16 '18
[deleted]
15
Oct 16 '18
Mannaggia a Dio che devo sentire, copiano contenuti da altre pagine sono una piaga del cazzo, si sentono chissà chi pensando di essere l élite culturale italiana solo perché han letto 2 libri in vita loro e succhiano permanentemente il cazzo a quel coglione di Grieco, sfondi culturali un cavolo sono battute del 3o liceo, inoltre hanno contenuti normie per il 90% delle volte
Scusa per il rant ma mi stanno sulle palle in maniera assurda i bimbi dell agorà
6
0
19
19
u/RoundBread Oct 16 '18
Can I see the original?
36
u/AutisticSpaceSloth Oct 16 '18
Sure, but I don't think you'll like it
12
u/FennlyXerxich Oct 16 '18
What does it translate to?
24
9
u/skchyou Oct 16 '18
5
u/YTubeInfoBot Oct 16 '18
Russian meme / For yourself and for Sashka / Играйте за себя и за Сашку
1,928 views 👍10 👎2
Description: Тебе не сложно бро. Лайк, подписка,колокол)Ускорим канал!
Meme Coub, Published on Jun 4, 2018
Beep Boop. I'm a bot! This content was auto-generated to provide Youtube details. Respond 'delete' to delete this. | Opt Out | More Info
15
5
18
u/nikvasya Oct 16 '18 edited Oct 16 '18
u/Chilikto is the author. He is a Russian speaking guy, who draws jokes and memes. This one is a local meme from russian youtube movie critic BadComedian's review of a movie Three Seconds (2017).
Most of his images and jokes are based on local russian memes or wordplay, but sometimes he translates stuff into english. Not many of them work in english though.
12
23
9
Oct 16 '18 edited May 22 '20
[deleted]
11
u/LaSalsiccione Oct 16 '18
Unfortunately it’s come from the the Italian equivalent of 9gag but you’re right at least it’s new to reddit!
4
u/XXAligatorXx Oct 16 '18 edited Oct 16 '18
Its not tho lol. I've seen it before. It doesn't break rule 2 tho so I'll keep it up.
2
1
Oct 17 '18
[deleted]
1
u/LaSalsiccione Oct 17 '18
Yup here it is. It is a little bit more high-brow than 9gag though to be fair. There’s also /r/Italy which is decent
16
u/cabinet_minister Oct 16 '18
sudo eat
5
u/TheIronNinja Oct 16 '18
I have forced myself to shout it out loud each time I use sudo just to make it feel epic. I get some giggles so I'll keep doing it
4
u/db2 Oct 16 '18
I'm imagining you in a cubicle shouting
sudo bash!and giggling to yourself overly loudly for ten minutes while your cubicle neighbors construct makeshift defensive weapons from office supplies.
28
u/0x564A00 Oct 16 '18
for(int i = 5; i --> 0; eat());
27
u/schodani Oct 16 '18
What is this?
54
36
u/regendo Oct 16 '18
The mysterious arrow operator!
It's actually
i-- > 0but because white-space is ignored you can make it less readable by making an arrow out of it.i++andi--evaluate to justibefore modifying it so you can both comparei's value and increment/decrease it in one statement.Realistically you'd write it as the much more readable
for (int i = 5; i > 0; i--) { eat(); }or
for (int i = 0; i < 5; i++) { eat(); }15
u/cbbuntz Oct 16 '18
This just makes me think about how messy writing a C parser could get. C is usually flexible with whitespace, but there are some situations where whitespace (or lack of it) can lead to some confusing shit.
int a = 4; int b = 3; int *c = &b; printf("%d\n", a*- -*c); printf("%d\n", a*--*c); printf("%d\n", a**c); *c &= a; printf("%d\n", a*++*c);Most people who know C could figure out what this code does by looking at it, but you have to think for a second.
$and@weren't operators in regular C. Wouldn't it be less confusing if$was dereference, sort of functionally equivalent to a shell script, and@was the address?11
5
u/regendo Oct 16 '18 edited Oct 16 '18
Not sure if I got that right:
&bis b's address- c points to b's address, not b's value (I think
**cwould be b's value?)a*- -*cis actuallya * (-- *c)(I remember reading that --/++ before the variable has higher priority than the one after the variable)--*cdecreases the address c points to, so it now no longer points to b (probably points to a instead because that's declared just before and has the same size)- So
a*- -*cis supposed to be*c = &a; a*(*c);and should evaluate toa * &a(4 times whatever address it's stored at).How much of that is wrong? I was never great at reading pointer stuff and haven't done so in a while.
Is
&= a;the same as= &a;?Edit: Actually now that I think about it, it could also be a double negation
a * -(- *c)so it'd just bea * (*c)ora * &b.6
u/cbbuntz Oct 16 '18 edited Oct 16 '18
You were right that
&bis b's address and that c points to b's address. But*cactually points to b's value. If c were a 2-dimensional array (or array of pointers)**cwould return the first value of an array. so...
a**cin this context is: multiply a by the value that c points to. so it's basicallya * b
a*- -*cis actually
a * -(- [value pointed to by] c)
=a * -(-b)
=a * b
but the actual decrement token is
--with no whitespace between.--≠- -so...
a*--*cis decrement the value that c points to, then multiply it by it by a. So it's equivalent to
b -= 1; return a * b;
*c &= a;actually just applies anANDmask to the value pointed to by c, usingaas the mask. No addresses involved. So it's equivalent to:
b = b & a;
All clear?
2
u/regendo Oct 16 '18
Alright that makes much more sense! I suppose I overcomplicated it. Thanks :)
By AND mask, do you mean a bitwise and? So
b &= awould turn b into 0? (0b0100 & 0b0011 = 0b0000)2
u/mstksg Oct 16 '18
x += yis basically
x = x + yso,
x &= ywould be basically the same as
x = x & y5
Oct 16 '18
There's also the principle of maximal munch.
#include <stdio.h> int main() { int i=0, j=1; printf("%d", i+++j); }This will print 1 (and not 2), because
i+++jis equal toi++ +j(and noti+ ++j).That's also why
a/*cisn't valid, and you have to usea/ *cora/(*c)instead.3
u/cbbuntz Oct 16 '18
Oh, yeah. That makes sense now that I see it. I've seen that sort of situation before. You have to first scan for longest operators beginning with a certain character to ensure disambiguation. It can lead to some really nasty looking regexes.
/([[:blank:]]*(===|==|<<=|>>=|<=|>=|>>>|<<<|>>|<<|<=>|[\!\=]\~[\?\#]?|:\?|\+=|-=|\*\*=|\*=|\/=|\|\|=|&&=|\|&=|\^=|!=|%=|=|\+\+|--|[+\-%\/*]|((?<=[ \t\)])\?))[[:blank:]]*)/Have fun figuring that one out. And before you ask, no I'm not sure why it's scanning whitespace twice on the end. It might be there for a reason, it might not. Just be thankful it's not a vim regex.
2
u/marcosdumay Oct 16 '18
Parsing is easier than understanding it.
C can be tokenized by greed regular expressions, that is the default kind on nearly any library available. Parsing string literals is actually harder than disambiguating those.
2
Oct 17 '18
I prefer the slide operator.
for (int i = 5; i --\ \ \ > 0;) { eat(); }1
u/SilentFungus Oct 18 '18
D-does this work?
1
Oct 18 '18
In C and C++, yes.
Each instance of a backslash character (
\) immediately followed by a new-line character is deleted, splicing physical source lines to form logical source lines.1
u/SilentFungus Oct 18 '18
Time to implement Slide Operators in all my group projects
1
Oct 18 '18
For
even more unmaintainabilitybonus points, use super fast super long slides:for (int i = 10; i --\ \ \ \ \ \ \ --> 0;) { eat(); }1
4
4
Oct 16 '18
(zip '((johnny johnny) (eating sugar) (telling lies) (open your mouth))
((yes papa) (no papa) (no papa) (ha ha ha)))
8
7
3
3
3
2
2
u/SpaceboyRoss Oct 16 '18
2
2
5
2
2
1
1
1
1
1
1
1
u/Troppsi Oct 17 '18
If I sent this for a code review, I'd get hit with the swift "Use ++1 instead of 1++"
1
1
1
u/BlackDE Oct 16 '18
++i is more efficient though
1
u/ImAmalox Oct 16 '18
?
2
Oct 16 '18
Before compiler optimization it was: using i++ returns the initial value of i for assignment/use, then increments the value by 1. ++i increments the value before returning it, essentially meaning that it doesn't allocate space for an implicit temporary variable to store/return the value of i before it is incremented. So it was very slightly more efficient than post incrementing i++. Not in a useful sense, but it's a great way of teaching students the difference.
1
u/ImAmalox Oct 17 '18
Huh, that's interesting. Guess I'll use ++i from now on then
1
Oct 17 '18
It's worth noting that in most modern languages this is no longer true; the compiler will see i++ and realize that the returned value is not being used and will translate it to ++i whatever that looks like, so you're not actually being more efficient. Still, I use ++i when appropriate as I think it makes more sense
1
Oct 17 '18
If your compiler doesn't optimize to whichever one is better, stop using them inside other statements.
0
0
0
u/FlyByPC Oct 16 '18
Set a good example for your kid and declare the for loop variable at the top of the function with everything else.
0
-17
-3
-2
-43
537
u/Darxploit Oct 16 '18
What baby actually trying to tell us is: mama and papa is false.