back

by masswerk·2y ago·view on hn ↗
Regarding implicit type conversion: Arguably, this is the way all scripting language went about that time, and, notably, shell scripting, as well. (Meaning, it was pretty much the expected behavior for a language of that kind. Hence, the appeals for adding this to JS, as well.) JS was much like a shell for the web browser window and not meant to be a full-fledged application language. And, if you really needed it, you could still check the very nature of any value by the use of `typeof`.

The same applies to the "standard library", which is really just a collection of helper functions under the umbrella of a few top-level built-in objects to keep the core language clean.

I'd rather blame the generations of devs implementing add-ons and syntactic sugar according to the fashion of the day and mimicking their respective favorite language, which adds loads of inconsistencies to the various extensions of the language (often leading to duplicate mechanisms and implementations), depending on when it was done. So there is no common way of communicating with these interfaces and no implicit design philosophy (it may be JFX-style, callback based, a promise, functional, whatever). This is even true for the core language, e.g., arrow-functions breaking the basic convention of arguments always coming as a list.