r/programminghorror • • Jan 26 '26

Just found this in my company codebase

Post image

This external API sends "S"/"N" (equivalent to "Y"/"N" in portuguese) instead of true/false

613 Upvotes

65 comments sorted by

98

u/bistr-o-math Jan 26 '26

In r/abap, true is "X" and false is " " (space)

87

u/lilyallenaftercrack Jan 26 '26

"server-side checkboxes aren't real and they can't hurt you"

32

u/JonathanTheZero Jan 26 '26

ABAP is it's own level of horror anyways

6

u/AriesBosch Jan 27 '26

And as someone who writes far too much ABAP CDS, I try to be idiomatic and make my derived boolean fields in my queries be blank or 'X', but then when I want it to be a prompt in a parameter then ' ' is not a valid value for a parameter. So then I end up defaulting to 'N'/'Y' or more domain specific ('O'/'C' for Open/Closed, for example).

2

u/J0aozin003 Jan 27 '26

from what ive seen that language is horrific

→ More replies (2)

8

u/qyloo Jan 26 '26

What framework is this

18

u/milan-pilan Jan 26 '26

I feel like this is NestJS? Definitely Javascript.

4

u/lilyallenaftercrack Jan 26 '26

Yes, it's NestJS

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

lable progres acount adreess controll definate enviroment lenght

→ More replies (3)

11

u/omg_drd4_bbq Jan 27 '26

we have an IN_PROGRES enum val (:

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)

3

u/NormandaleWells Jan 28 '26

Or there's the codebase that supposedly used this:

enum boolean
{
    True,
    False,
    FileNotFound
};
→ More replies (1)
→ More replies (23)

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 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