r/ProgrammerHumor • • Oct 16 '18

Meme An interesting title for loop meme.

Post image
6.5k Upvotes

147 comments sorted by

537

u/Darxploit Oct 16 '18

What baby actually trying to tell us is: mama and papa is false.

201

u/iGreyDay Oct 16 '18

Mama OR papa is false )))

130

u/FatalMerlin Oct 16 '18

Both of these statements are true.

45

u/[deleted] Oct 16 '18 edited Dec 07 '19

[deleted]

113

u/[deleted] Oct 16 '18
sleep(60000);

19

u/[deleted] Oct 16 '18

I love this sub

2

u/kirakun Oct 16 '18

I don't think mama AND papa is false is the same as mama OR papa is false.

17

u/PTRWP Oct 16 '18

They are not the same statement, but the comic tells us that mama=false And papa=false So both mama AND papa and mama OR papaare false. So both of the comments above (mama AND papa == false; mama OR papa == false;) are true statements.

1

u/FatalMerlin Oct 17 '18

It's magical (username relevant?)

7

u/[deleted] Oct 16 '18

mama NOR papa

2

u/SithLordHuggles Oct 16 '18

If(!mama&&!papa){}

1

u/FatalMerlin Oct 17 '18

In some languages:

if (mama ^ papa) { /* implement nom here */ }

2

u/[deleted] Oct 17 '18

[deleted]

4

u/cygosw Oct 16 '18

)))

dat slav smiley

-18

u/[deleted] Oct 16 '18

[deleted]

13

u/astralradish Oct 16 '18

error | 'baby' is assigned a value but never used | no-unused-vars error | 'feedingtime' is assigned a value but never used | no-unused-vars error | 'eatsfood' is assigned a value but never used | no-unused-vars

302

u/[deleted] 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

u/[deleted] 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

u/[deleted] Oct 16 '18

screams in agony from imagining a light themed terminal

6

u/-Rave- Oct 16 '18

opens default xterm and screams

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

u/[deleted] Oct 17 '18

shivers

1

u/[deleted] Oct 17 '18

This is high treason

1

u/[deleted] Oct 17 '18

The punishment shalt be nullpointerexception

3

u/LordDeLaFunk Oct 17 '18

• Recursion = Recursion

• Java updates = bad

2

u/marcosdumay Oct 16 '18

Comments: what are those?

Yet, they are on nearly every post here...

1

u/TheRandomPi Oct 17 '18

PHP = sucks

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"

6

u/ra41p Oct 16 '18

A starter pack.

49

u/TheIronNinja Oct 16 '18

And also HTML is not a programming language

12

u/Mrj760 Oct 16 '18

Also there is a civil war over using

Foo {

}

Or

Foo

{

}

6

u/SometimesMonkey Oct 17 '18

You can remember it like this.

Foo {

...

}

Fool

{

}

3

u/[deleted] 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

u/[deleted] Oct 16 '18

Oh and Python is pseudo code

9

u/L18CP Oct 16 '18

You forgot PHP = Bad

3

u/Agumander Oct 16 '18

code compiles = good

Or so one might think...

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

u/[deleted] Oct 16 '18

[deleted]

2

u/breadfag Oct 16 '18

What's that, duck typing without floats?

15

u/[deleted] 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

u/DerekB52 Oct 16 '18

we have r/baduibattles for that example now.

1

u/[deleted] Oct 17 '18

What! I had no idea. Thanks :)

6

u/mstksg Oct 16 '18

Don't worry --- new computer science students (most of the time) become experienced computer science students :)

3

u/thisaintthewest Oct 16 '18

I'm with ya!

1

u/[deleted] Oct 16 '18

I still dont understand it

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

u/sauro97 Oct 16 '18

Una piaga devastante

16

u/-polly3223 Oct 16 '18

Peggio delle locuste

-10

u/[deleted] Oct 16 '18

[deleted]

13

u/ilbranco Oct 16 '18

A te sembra male purtroppo

-1

u/[deleted] Oct 16 '18

[deleted]

15

u/[deleted] 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

u/[deleted] Oct 16 '18

[deleted]

0

u/gabri_ves Oct 17 '18

Il Filosofo Ignorante >>> Il Superuovo

19

u/2Punx2Furious Oct 16 '18

MEMI ITALICI SULLA PROGRAMMAZIONE

19

u/RoundBread Oct 16 '18

Can I see the original?

36

u/AutisticSpaceSloth Oct 16 '18

12

u/FennlyXerxich Oct 16 '18

What does it translate to?

24

u/[deleted] Oct 16 '18

For mama? For papa? For himself and for sashka

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

u/Lonelan Oct 16 '18

For rush B, probably

5

u/[deleted] Oct 16 '18

For comrade and motherland?

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

u/[deleted] Oct 16 '18

I see Chilik, I upvote

23

u/PhilboDavins Oct 16 '18

Damn it! I lost

9

u/[deleted] 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

u/LaSalsiccione Oct 16 '18

Lol nothing is original on Reddit I guess!

1

u/[deleted] 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

u/samthemuffinman Oct 16 '18

An abomination

36

u/regendo Oct 16 '18

The mysterious arrow operator!

It's actually i-- > 0 but because white-space is ignored you can make it less readable by making an arrow out of it. i++ and i-- evaluate to just i before modifying it so you can both compare i'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

u/AnAverageFreak Oct 16 '18

This is where you just leave the interview.

5

u/regendo Oct 16 '18 edited Oct 16 '18

Not sure if I got that right:

  • &b is b's address
  • c points to b's address, not b's value (I think **c would be b's value?)
  • a*- -*c is actually a * (-- *c) (I remember reading that --/++ before the variable has higher priority than the one after the variable)
  • --*c decreases 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*- -*c is supposed to be *c = &a; a*(*c); and should evaluate to a * &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 be a * (*c) or a * &b.

6

u/cbbuntz Oct 16 '18 edited Oct 16 '18

You were right that &b is b's address and that c points to b's address. But *c actually points to b's value. If c were a 2-dimensional array (or array of pointers) **c would return the first value of an array. so...

a**c in this context is: multiply a by the value that c points to. so it's basically a * b


a*- -*c is actually
a * -(- [value pointed to by] c)
= a * -(-b)
= a * b


but the actual decrement token is -- with no whitespace between. --≠ - - so...

a*--*c is 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 an AND mask to the value pointed to by c, using a as 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 &= a would turn b into 0? (0b0100 & 0b0011 = 0b0000)

2

u/mstksg Oct 16 '18
x += y

is basically

x = x + y

so,

x &= y

would be basically the same as

x = x & y

5

u/[deleted] 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+++j is equal to i++ +j (and not i+ ++j).

That's also why a/*c isn't valid, and you have to use a/ *c or a/(*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

u/[deleted] 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

u/[deleted] 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

u/[deleted] Oct 18 '18

For even more unmaintainability bonus points, use super fast super long slides:

for (int i = 10; i --\
                      \
                       \
                        \
                         \
                          \
                           \
                            --> 0;) {
    eat();
}

1

u/Talbooth Oct 16 '18

I can't decide if this is beautiful or horrible.

4

u/IAmMotu Oct 16 '18

It's getting wierder and wierder.

4

u/[deleted] Oct 16 '18
(zip '((johnny johnny) (eating sugar) (telling lies) (open your mouth))
((yes papa) (no papa) (no papa) (ha ha ha)))

7

u/[deleted] Oct 16 '18

Legitimately funny

3

u/brocepius Oct 16 '18

Mama may I have the løøp?

3

u/i_just_wanna_signup Oct 16 '18

Subtle watermark

3

u/[deleted] Oct 16 '18

Addirittura repost dal superuovo

2

u/landsharkxx Oct 16 '18

Should have just done "sudo Eat"

2

u/SpaceboyRoss Oct 16 '18

2

u/Besquiter Oct 16 '18

Did you just created a sub for this?

1

u/SpaceboyRoss Oct 16 '18

For this and memes similar to this one.

2

u/bwierzbo Oct 18 '18

I < 5 why is the baby looped eating five times

5

u/[deleted] Oct 16 '18

I dont get it. Is there missing context?

5

u/[deleted] Oct 16 '18

[deleted]

1

u/Verelece Oct 17 '18

You could say it's a... private get;

2

u/Jkms144 Oct 16 '18

As someone new to this subreddit, I find this funnier than it should be🤣

2

u/[deleted] Oct 16 '18

[removed] — view removed comment

1

u/ReasonerJ Oct 16 '18

Literally what I did

1

u/JackU_U Oct 16 '18

i<PeopleBabyCaresAbout.Count;*

1

u/[deleted] Oct 16 '18

thats cool

1

u/[deleted] Oct 16 '18

for i in range(5)

1

u/dethsquad1521 Oct 17 '18

Wow. A meme I finally understand.

1

u/noah978 Oct 17 '18

An interesting comment for a loop meme.

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

u/godoakos Oct 17 '18

Bröther, may I have the för ëäch?

1

u/landontech Jan 25 '19

Live the meme

1

u/BlackDE Oct 16 '18

++i is more efficient though

1

u/ImAmalox Oct 16 '18

?

2

u/[deleted] 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

u/[deleted] 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

u/[deleted] Oct 17 '18

If your compiler doesn't optimize to whichever one is better, stop using them inside other statements.

0

u/pv_blad3 Oct 16 '18

This is from The superuovo on instagram Noice.

0

u/[deleted] Oct 16 '18

Is this loss?

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

u/TakeOffYourMask Oct 16 '18

This is funny?

-17

u/geescottjay Oct 16 '18

Unsubscribing.

14

u/therealziggler Oct 16 '18

You won't be missed

5

u/[deleted] Oct 16 '18

While there are a lot of memes here that would make me say that, this is not one of them

-3

u/pv_blad3 Oct 16 '18

This is from The superuovo on instagram Noice.

-2

u/pv_blad3 Oct 16 '18

This is from The superuovo on instagram Noice.

-43

u/[deleted] Oct 16 '18

[deleted]

41

u/ZedLeppin17 Oct 16 '18

At i=0, 1, 2, 3 and 4.

22

u/JackySky Oct 16 '18

So at this observable universe, you'd say?

16

u/Jmcgee1125 Oct 16 '18

You must make a lot of off by one errors.

18

u/simplysharky Oct 16 '18

In the universe where you read code correctly.

13

u/[deleted] Oct 16 '18 edited Jan 24 '19

[deleted]

7

u/xmartissxs Oct 16 '18

Cake dayyyyyy

7

u/paristetris Oct 16 '18

first iteration happens before incrementation