fromMaybe a b
this post was submitted on 08 Dec 2023
622 points (96.4% liked)
Programmer Humor
32561 readers
389 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
we can remove the return!
const fn = (a, b) => a || b
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.