r/ProgrammerHumor • • Mar 20 '24

Meme areJSDevsActuallySane

Post image
14k Upvotes

554 comments sorted by

View all comments

Show parent comment

1

u/CaitaXD Mar 21 '24

Not a language error a unmanaged language doesn't know weather or not you are addressing valid memory

1

u/subject_deleted Mar 21 '24

An error is an error. If you expect a certain kind or value of output, but instead you get something else, it's an error. Whether it's valid memory or not.

If you write code that could possibly pass an empty object into your regex constructor, that's an error.. and the fault lies with the programmer who didn't validate.

Passing in an empty object instead of a string is not any more or less of an error than passing in a reference to an empty spot in memory, or just the wrong spot in memory.

1

u/CaitaXD Mar 21 '24

Is OS specific not language specific

1

u/subject_deleted Mar 21 '24

I'm trying to figure out how that's relevant to whether or not the programmer should not be passing variables to a function if they haven't verified the appropriate data type first...

Can you help me out?

1

u/CaitaXD Mar 22 '24

Cause you compared it to a segfaults, but segfaults happens for valid reasons that cannot be resolved by the language, this scheiße has exaclty 0 rights to be a thing

1

u/subject_deleted Mar 22 '24

So then replace seg fault with literally any other error that developers have complained about not being descriptive or helpful. There are thousands of them..

1

u/CaitaXD Mar 22 '24

Imo, a terrible error is still better than watherver is is doing