▲ 1410 ▼ Tests are code too (lemmy.world) submitted 2 years ago by jroid8@lemmy.world to c/programmerhumor@lemmy.ml 79 comments fedilink hide all child comments
[–] cupcakezealot@lemmy.blahaj.zone 14 points 2 years ago (3 children) turned out to be a semicolon permalink fedilink source hideshow 6 child comments replies: [–] Zaphod@discuss.tchncs.de 25 points 2 years ago (1 child) The tests wouldn't even run of that was the issue, pretty sure (depends on the language I suppose) permalink fedilink source parent hideshow 2 child comments replies: [–] gratux@lemmy.blahaj.zone 16 points 2 years ago (1 child) fun situations can arise when you write , instead of ; For those not in the know, in c++ the comma operator evaluates the left expression, discards the value, then evaluates the right expression and returns the value. if you now have a a situation like this int i = 0, printf("some message"); i has a completely different value, since it actually uses the return value of printf instead permalink fedilink source parent hideshow 2 child comments replies: [–] scubbo@lemmy.ml 5 points 2 years ago And people give Python shit for significant whitespace 😂 permalink fedilink source parent [–] rob64@startrek.website 4 points 2 years ago (1 child) I'll just write thousands of lines of code inside a global object... I'm sure I won't put a semicolon where a comma should be... permalink fedilink source parent hideshow 2 child comments replies: [–] Speculater@lemmy.world 1 point 2 years ago* Easy solution: Find all: ; Replace with: , permalink fedilink source parent [–] rwhitisissle@lemmy.ml 4 points 2 years ago And in python, no less. Sloppy. permalink fedilink source parent
[–] Zaphod@discuss.tchncs.de 25 points 2 years ago (1 child) The tests wouldn't even run of that was the issue, pretty sure (depends on the language I suppose) permalink fedilink source parent hideshow 2 child comments replies: [–] gratux@lemmy.blahaj.zone 16 points 2 years ago (1 child) fun situations can arise when you write , instead of ; For those not in the know, in c++ the comma operator evaluates the left expression, discards the value, then evaluates the right expression and returns the value. if you now have a a situation like this int i = 0, printf("some message"); i has a completely different value, since it actually uses the return value of printf instead permalink fedilink source parent hideshow 2 child comments replies: [–] scubbo@lemmy.ml 5 points 2 years ago And people give Python shit for significant whitespace 😂 permalink fedilink source parent
[–] gratux@lemmy.blahaj.zone 16 points 2 years ago (1 child) fun situations can arise when you write , instead of ; For those not in the know, in c++ the comma operator evaluates the left expression, discards the value, then evaluates the right expression and returns the value. if you now have a a situation like this int i = 0, printf("some message"); i has a completely different value, since it actually uses the return value of printf instead permalink fedilink source parent hideshow 2 child comments replies: [–] scubbo@lemmy.ml 5 points 2 years ago And people give Python shit for significant whitespace 😂 permalink fedilink source parent
[–] scubbo@lemmy.ml 5 points 2 years ago And people give Python shit for significant whitespace 😂 permalink fedilink source parent
[–] rob64@startrek.website 4 points 2 years ago (1 child) I'll just write thousands of lines of code inside a global object... I'm sure I won't put a semicolon where a comma should be... permalink fedilink source parent hideshow 2 child comments replies: [–] Speculater@lemmy.world 1 point 2 years ago* Easy solution: Find all: ; Replace with: , permalink fedilink source parent
[–] Speculater@lemmy.world 1 point 2 years ago* Easy solution: Find all: ; Replace with: , permalink fedilink source parent
[–] rwhitisissle@lemmy.ml 4 points 2 years ago And in python, no less. Sloppy. permalink fedilink source parent