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
619
Upvotes
98
u/bistr-o-math Jan 26 '26
In r/abap, true is "X" and false is " " (space)
8
u/qyloo Jan 26 '26
What framework is this
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.
22
u/chamberlain2007 Jan 26 '26
Could be representing an enum on the other side
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 [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" 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
u/[deleted] Jan 26 '26
I found junior engineers at my company using ‘True’ and ‘False’ instead of Boolean true / false 😭
2
u/wowawiwowa Jan 26 '26
Daily occurrence
2
u/Traqzer Jan 26 '26
Seems fine, it allows implicit support for other values other than S/N
1
u/alessandrobertulli Jan 29 '26
i mean, it's still 1 byte
0
u/[deleted] Jan 26 '26
[deleted] — view deleted comment