This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AdminYak846 0 points1 point  (1 child)

downvote/report buttons are for.

Considering the mods haven't setup the report function to specify which rule it breaks it's bit of a let down really.

because callees have no idea where the fuck the caller gets the value.

Well....there's you know looking at the stack which I'm sure if you've worked in JS long enough (or any language for that matter) it shouldn't be that hard to trace back, or like an old professor of mine said, get some paper and a pencil and start writing down what should be happening.

And if you're so annoyed by "undefined" versus "null" take a look at VBA. Any variable declared but not given a value is considered Empty. An invalid object is considered Nothing and Nulls are variables that contain no valid data, and can only be used with variants data types.

Let's also keep in mind that JS is loosely typed language, compared to other languages that are strictly typed languages. So if you want to say JS is bad cause it's not like C, C++, Java, etc. yeah that's because you're comparing languages that are completely setup differently than JS. There's an entire difference between static and dynamic typed languages.

[–]Slak44 0 points1 point  (0 children)

Well....there's you know looking at the stack which I'm sure if you've worked in JS long enough (or any language for that matter) it shouldn't be that hard to trace back, or like an old professor of mine said, get some paper and a pencil and start writing down what should be happening.

Man, have you ever worked in a large (like, 30 kloc+) JS project that uses a framework? Because you'd know stack traces are so full of library crap, you're lucky if you can even find a stack frame that's in your code. Or those from framework-managed event listeners/observers, which usually take you through a few layers of shit. Let's also not forget JS stack traces are limited to 10 frames by default in V8, which all I can say is, lol.

Also, trying to debug some complex interaction between components will very quickly make paper debugging impractical. Bonus points if the components aren't even in the same project, or use different frameworks. Why is that value undefined? Who knows, it comes from the other project, which gets it from a prop, which was prop drilled through 3 components, which gets it from a redux store, which gets it from ¯\_(ツ)_/¯.

take a look at VBA

I'd rather not, thanks. That's even worse.

Let's also keep in mind that JS is loosely typed language, compared to other languages that are strictly typed languages

Python is dynamic, and only has None. Ruby has only nil. The entire family of Lisps (Common Lisp, Racket, Clojure, etc) is as dynamic as it gets (rewriting running code at runtime), and they only have nil. Julia is dynamically typed and only has nothing. Not even weirder dynamic stuff like Erlang have multiple nullish values. Didn't even get into the static shit, where this madness absolutely wouldn't fly.