Design a site like this with WordPress.com
Get started

True vs. Useful

In this excellent blog post, in the epilogue, the author explains JavaScript’s difference between let and var.

I use var because it works really well, it’s very flexible, and it behaves according to a predictable set of rules (just like the rest of JavaScript). But, var doesn’t always work the way I want it to; and so, in those situations, I will gladly use let in order to get the job done.

https://www.bennadel.com/blog/4185-creating-jquery-function-parity-with-umbrella-js.htm

That bit about “behaves according to a predictable set of rules” stood out to me. It reads like an apology for JavaScript. Is it true that the language “behaves predictable”? Sure, nobody could program in a language that didn’t behave predictable. Even toy programming languages that are annoying for fun, like brainfuck, still behave predictably. That’s not really helpful. It is semantically true, but it isn’t honest.

A more helpful thing to say would be that JavaScript is predictable in the way that a 2yo toddler whose been given a caffeinated drink, sugary candy, and breakable glass tableware is predictable. The fact that the author has to deeply explain let versus var is a sign that the language has far too much going on for it’s own good. I can’t make this point any better than referencing Wat.

WATMAN

https://www.destroyallsoftware.com/talks/wat

I try to keep an eye out for this sort of thing. People say a lot of things that are true, but not useful.

Advertisement
%d bloggers like this: