this post was submitted on 09 May 2024
449 points (92.3% liked)

Programmer Humor

35219 readers
98 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
[โ€“] avidamoeba@lemmy.ca 4 points 11 months ago* (last edited 11 months ago) (1 children)

I'm sure you are capable of rewriting that in 3 lines and a single nested scope followed by a single return. In fact in languages that use exceptions you have to use at least one subscope.

Notice that in my example I didn't even broach the example with error conditions, cause it's trivial to write cleanly either way. Instead I talked about returns inside business logic. You can't unfuck that. ๐Ÿž