My boss insisted, before I arrived at the company, that everything in the database be coded so that 1 = Yes and 2 = No, because that's the way he likes to think of it. It causes us daily pain.
this post was submitted on 15 Jan 2025
0 points (NaN% liked)
Programming
19909 readers
135 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 2 years ago
MODERATORS
Something like if (stupid_bool & 0x01)
should work for those.
I imagine this would still lead to a never ending stream of subtle logic errors.
from bossland import billysbool, billysand
from geography import latlong
import telephony
def send_missile_alert(missiles_incoming: billysbool, is_drill: billysbool, target: latlong):
if billysand(missiles_incoming, not is_drill):
for phone in telephony.get_all_residents(target):
phone.send_alert("Missiles are inbound to your location")
Can you spot the bug?
The conventional 'not' would not behave differently for the two non-zero values. Insidious.
Correct! I made a number of other mistakes (edited away now due to shame), but that's the one I made on purpose.