this post was submitted on 25 Feb 2024
960 points (98.1% liked)

Programmer Humor

32812 readers
186 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] sbv@sh.itjust.works 78 points 10 months ago (18 children)

I feel like modern compilers would turn their nose up at that shit. "Dead code? Ewww! No way I'm letting that into my syntax tree!"

[–] ShortN0te@lemmy.ml 72 points 10 months ago (13 children)

A lot of IDEs would probably throw a warning about unreachable code.

[–] bus_factor@lemmy.world 25 points 10 months ago (1 children)

Golang won't even compile with dead code. Unfortunately that's too strict, you just end up commenting out the whole block instead. At least the commented out code is obvious in review, and some automated checks catch it if you have them.

[–] ramjambamalam@lemmy.ca 3 points 10 months ago

commenting out the whole block

var foo is declared but not used is such a pain in my asshole when doing this.

load more comments (11 replies)
load more comments (15 replies)