this post was submitted on 08 Dec 2023
623 points (96.4% liked)

Programmer Humor

32710 readers
1362 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
(page 2) 50 comments
sorted by: hot top controversial new old
[–] [email protected] 9 points 1 year ago (1 children)

I work with python so here's python

return a or b

[–] [email protected] 4 points 1 year ago

I work with lisp so here's lisp

(or a b)
[–] [email protected] 6 points 1 year ago

fromMaybe a b

[–] [email protected] 6 points 1 year ago (1 children)

we can remove the return!

const fn = (a, b) => a || b
[–] [email protected] 5 points 1 year ago (3 children)
const fn = (a, b) => a ?? b
load more comments (3 replies)
[–] [email protected] 6 points 1 year ago (4 children)
load more comments (4 replies)
[–] [email protected] 4 points 1 year ago* (last edited 1 year ago)

I hate this so much. Literally stopped using Perl and switched to PHP to get away from the "Look, ma! I can condense 6 comprehensible lines to one complete gibberish line that still works!" crowd.

I'm not saying I won't use shorthand if/else format on very rare occasions where you have to do a bunch of different if else's within your HTML for some reason, but in general, I try to avoid it.

load more comments
view more: ‹ prev next ›