WHAT "confusing scope" -- it's scoped to the function if any. That's not hard or confusing, and if your function is so complex that's insufficient, it's time to break it into smaller bits.

I dunno, maybe I've been at this too long and spent far too many years working in Wirth family languages like Pascal, Modula 2, and Ada.

... and instanceof works great for inheritance since it's valid for the entire inheritance chain. I want all nodes be they text, comment, or element, "a instance of Node" is true. Meanwhile if I have a textNode and only want elements, "textNode instanceof Element" is false. Exactly what I need in most cases.

So I'm not sure what you're on about there -- though I find with my radically different background in programming from most a lot of what people call "side effects" are exacty what I want, a lot of what people call "easy" I find painfully cryptic and complex, and much of what things like "linters" get their panties in a twist over I call good code... and a LOT of what people call good code and good practices I find to be the exact opposite.

I spent nearly a decade working in ADA, I could tell you for whom, but then I'd have to kill you. That's a joke... kind of. It gives you a very different perspective on what secure, efficient, and quality coding practices are. Things modern JavaScript are utterly and totally lacking in, particularly with these derpy "promises" in a non-multithreaded language, agonizingly cryptic and ultimately pointless "arrow functions", and this current habit of throwing callbacks at every problem dragging performance into the 9th ring of hell.

Just like the first lesson I learned hand assembling RCA 1802 machine language. The less code you use, the less there is to break. Another lesson lost on today’s crowd of “let’s use 2 megabytes of JavaScript in two dozen separate files to do 48k or less in one file’s job”

Written by

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store