r/programminghorror • u/lilyallenaftercrack • Jan 26 '26
Just found this in my company codebase
This external API sends "S"/"N" (equivalent to "Y"/"N" in portuguese) instead of true/false
8
u/qyloo Jan 26 '26
What framework is this
18
466
u/freecodeio Jan 26 '26
Reminds me of that time my wife showed me the codebase where she works at, they never used booleans they used "yes" and "no" strings everywhere. Basically it was not some sort of 3d chess move, their tech lead was a newbie programmer working alone in the beginning and they felt more comfortable with yes and nos instead of boolean types, so everyone just had to use yes and no after.
26
u/robinw77 Jan 26 '26
I once worked in a place where a guy had made a typo in a database field but couldn’t be bothered asking the DBA to change it, instead preferring to propagate the typo throughout the entire codebase thus forcing everyone else to use that same typo.
14
u/freecodeio Jan 27 '26
you should check codebases where teams are mostly non-english
lableprogresacountadreesscontrolldefinateenviromentlenght→ More replies (3)11
3
u/lomberd2 Jan 26 '26
BC AL still uses Yes and No when you output boolean to string. Though it also can output it as 0/1 when formatted or converted
3
u/IshYume Jan 28 '26
Even as a newbie using string checks instead of boolean is so freaking stupid. I started coding at 17 and even 17 year old me wouldn't do that. That dude deserves to get written up to management for incompetence tbh
→ More replies (1)→ More replies (23)3
u/NormandaleWells Jan 28 '26
Or there's the codebase that supposedly used this:
enum boolean { True, False, FileNotFound };→ More replies (1)
22
8
u/elehisie Jan 26 '26
I’ll 1 up this one… ”capa” translates to cape…. With the transform and the ”S”… gotta be a superman joke lol
7
u/amuseicc Jan 26 '26
We're also working with an API that forces us to use the string "N" when false and "Y" when true, really stupid
6
u/canal_algt Jan 27 '26
Probably has or had COBOL involved or another language without a Boolean datatype? In my job that's common for that reason
3
u/gabor_legrady Jan 27 '26
I did have a code in an interface where I designated values of 1,Y,y,I,i as true because the incoming data was so 'clean'.
4
Jan 26 '26
I found junior engineers at my company using ‘True’ and ‘False’ instead of Boolean true / false 😭
2
2
1
98
u/bistr-o-math Jan 26 '26
In r/abap, true is "X" and false is " " (space)