by dang · 10y ago · 0 comments
Once every couple years or so something comes up that forces me to dip a toe back into 'this'. If Plan A (find a way to avoid it) fails, I go to Plan B: relearn the minimum necessary and forget it as quickly as I can. I'll never pass a JS job interview, but since another life goal is to never endure another job interview, that part's ok too.
Now for tooling, infrastructure, and PL-focused engineers I think caring about the intricacies is important. First, because they'll be doing a lot of meta-programming to build frameworks and libraries. Second, is because to design good languages and frameworks you need to understand the ergonomics of the language and to pick the most intuitive and easy to use features.
Finally -- and this may sound like a contradiction to everything I said before -- I think that the best engineers are people who are able to jump between these two mindsets. Be able to bikeshed on the intricacies of frameworks one day and the next day -- when working on product -- to be focused on shipping while ignoring details that they have strong opinions on. A big part of this is dealing with cognitive dissonance. I can have a strong opinion on semicolons in JS but I can jump into a codebase without them and start cranking.
I felt that way when I was younger but eventually lost my taste for poring over masses of "just-because" detail, and became more sensitive to the cognitive cost of doing so. It isn't merely that the time and energy could be spent on other things, but that the brain responds to learning by patterning on it. If I spend energy on that, my work gets more like that and my brain thinks more like that, and I don't want them to.
(By the way, I'm not criticizing those books at all. I don't know them, but if they're as good as you say I think that's great.)
I mean, I do know common pitfalls and I can use `this`, etc., it's just that I find it's easier to avoid them entirely and leads to more readable code IMHO. In a way my JS tends to just be very scheme-like.
Mine too! I've felt for many years that we were lucky that Eich happened to have read SICP not long before those fateful two weeks in 1995. For all that we all love to hate JS, the language of the web could have—and to judge by all historical precedents, should have—been much worse.
Crockford succeeded in popularizing JS, partly by stressing the Scheme-like features of the language, but I'm not convinced that's where the strengths of the language lay.
There ARE times where I had to optimize though (HTML5 game developer, and we target mobile so this is expected) but for the most part 'premature optimization is the root evil'.
> A language that doesn’t affect the way you think about programming is not worth knowing.
There are many different motivations behind studying a language. You can study it for a job interview, for a job requirement, or for personal enlightment.
I had my enjoyment of reading some well written JavaScript books such as the "Rhino book" (https://www.amazon.com/JavaScript-Definitive-Guide-Activate-...) and Pro JavaScript Techniques by John Resig (https://www.amazon.com/Pro-JavaScript-Techniques-John-Paxton...). They really help you think in JavaScript just like K&R helps you think in C.
On the other hand, for JavaScript you might want to take a look (beyond technical merits) at its social context. Client side JavaScript is deeply related to the design and implementation of the DOM. Whether we like it or not, the social aspect of browser really makes JavaScript unique in the history of programming languages.
That is the context of "the way of thinking" I am looking at.