June 1st, 2017

(no subject)

Here’s an example of something that I notice pretty frequently in recorded workshops.

Here’s this guy teaching javascript debugging (mostly basic stuff, but still has occasional interesting bits). To illustrate his points, he is using some demo Backbone-based app. The fact that it’s written in Backbone is, as the guy says, irrelevant. Still, at some point he goes on to explain memory leaks, and focuses on a bit of code, where Backbone views are being added to an array and then just left there. So he shows that the array holding those Backbone objects should have been cleaned. So far so good.

Then a student asks him about a function that he has shown on the screen (the `remove` function called on each Backbone view before clearing the array of views).

And then a srange thing happens. The guy is clueless about what this function does. "We could probably just get away with that," he says. The thing is though, those `remove` functions are crucially important for the topic of memory leaks that he is talking about. If not called, they will not disassociate Backbone views (no longer needed for the UI) from the DOM nodes that they hold on to, and so those views will not be garbage-collected. This is a classical example of memory leaks when using jQuery (or Backbone, which is jQuery based and is notorious for leaking memory). The fact that the teacher just glosses over this issue is embarrassing.

And things like that (instructors’ mistakes, I mean) happen all the time. What the actual fuck?

(no subject)

It’s 2017. Why do talks like this keep reappearing? Why not just have one talk listing all the quirks of JavaScript (which have been around for ages), make everyone watch it, and just be done with it?