1404
Tests are code too (lemmy.world)
you are viewing a single comment's thread
view the rest of the comments
[-] cupcakezealot@lemmy.blahaj.zone 14 points 9 months ago

turned out to be a semicolon

[-] Zaphod@discuss.tchncs.de 25 points 9 months ago

The tests wouldn't even run of that was the issue, pretty sure (depends on the language I suppose)

[-] gratux@lemmy.blahaj.zone 16 points 9 months ago

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

[-] scubbo@lemmy.ml 5 points 9 months ago

And people give Python shit for significant whitespace ๐Ÿ˜‚

[-] rob64@startrek.website 4 points 9 months ago

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...

[-] Speculater@lemmy.world 1 points 9 months ago* (last edited 9 months ago)

Easy solution:

Find all: ;

Replace with: ,

[-] rwhitisissle@lemmy.ml 4 points 9 months ago

And in python, no less. Sloppy.

this post was submitted on 02 Nov 2023
1404 points (98.5% liked)

Programmer Humor

31687 readers
572 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS