
I am still struggling with the dynamic typing of JS. I guess the benefit of such an approach is needing less characters - which makes sense in a scripting language like bash, but in real programming it opens us up to a whole class of avoidable errors.
To program defensively in JS would mean loading the start of function with a series of type checks. I don’t see much of that in other people’s code, so I assume we just, don’t?
Obviously TypeScript squarely addresses this concern, so that’s probably my future, but I was intrigued to hear Kyle Simpson (the You Don’t Know JS guy) talking on JavaScript Jabber about how since JavaScript was designed from the ground up as dynamically typed that it’s better to embrace and understand this that to overlay it with a type system. That was a challenging thought I didn’t want to have, but the man knows his JavaScript so I’ll ruminate on it.