Comment on What are some common misconceptions about programming that you'd like to debunk?
owsei@programming.dev 9 months agoThat’s what I hate about javascript, it doesn’t warm you about undefined behavior, it just throws.
I used to not really care about that, but after learning C and Rust, damm, I wish there where result types everywhere
spartanatreyu@programming.dev 9 months ago
Some small nits to fix:
C has it’s own undefined behavior.
JS has confusing behavior, not undefined behavior. Its specs are well defined and backwards compatible to a fault, making things harder to learn if you don’t learn the history of the language.
Problems with both should be avoided by learning and using standard practices. (Don’t pretend C is object oriented, always use
===
instead of==
in js, etc…)In complete agreement:
owsei@programming.dev 9 months ago
thank you very much.
By undefined I meant the usage of undefined in the language, however you phrased it way better :)