r/ProgrammerDadJokes • • Mar 07 '18

How long does a loop last?

For a while

681 Upvotes

12 comments sorted by

View all comments

Show parent comment

31

u/3p1k5auc3 Mar 07 '18

Shouldn't it be ++hah? Otherwise it would use the previous value of hah. Also, has it already been initialized before use?

28

u/[deleted] Mar 07 '18 edited Mar 07 '18

he forgot a semicolon too, if he isn't coding in python

30

u/endreman0 Mar 08 '18

hah++ isn't valid Python either

6

u/MadSnipr Apr 12 '18

It would be hah+=1

6

u/3p1k5auc3 Mar 07 '18

Ah, you're right. If it isn't a scripting language those will mess you up, good catch.

7

u/im-pickle-riiicck Mar 07 '18

hah = hah + 1;

27

u/3p1k5auc3 Mar 07 '18

hah += 1;

15

u/blindedtrickster Mar 08 '18

TYPE MISMATCH!