What the fuck
this post was submitted on 14 Aug 2025
316 points (96.2% liked)
Programmer Humor
25750 readers
1746 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
Robert Martin is screaming somewhere. Say what you will about him being out of touch, he did have some good points on writing readable code.
Like null should never be a special value.
And obviously the horrible naming.
Same as ?
std::optional<bool> role;
if (role.value())
{ std::cerr ("User is admin");}
else if (!role.value())
{ std::cerr ("User is not admin");}
else if (!role.has_value())
{ std::cerr ("User is not logged in");}
Here has_value()
should have been checked first, but the JS seems kinda fine.
Which is it?
load more comments
(2 replies)