622
submitted 10 months ago by jroid8@lemmy.world to c/programmerhumor@lemmy.ml
(page 2) 50 comments
sorted by: hot top controversial new old
[-] rimorso@feddit.it 9 points 10 months ago

I work with python so here's python

return a or b

[-] tetris11@lemmy.ml 4 points 10 months ago

I work with lisp so here's lisp

(or a b)
[-] solrize@lemmy.world 6 points 10 months ago

fromMaybe a b

[-] nigh7y@lemmy.ml 6 points 10 months ago

we can remove the return!

const fn = (a, b) => a || b
[-] nick@campfyre.nickwebster.dev 5 points 10 months ago
const fn = (a, b) => a ?? b
[-] nigh7y@lemmy.ml 3 points 10 months ago

Gotta love some peer review

load more comments (2 replies)
[-] shalva97@lemmy.world 6 points 10 months ago
load more comments (4 replies)
[-] heavyboots@lemmy.ml 4 points 10 months ago* (last edited 10 months 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 ›
this post was submitted on 08 Dec 2023
622 points (96.4% liked)

Programmer Humor

32271 readers
86 users here now

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

Rules:

founded 5 years ago
MODERATORS