4 ms·
Indeed; and I was talking about the Javascript "object model" as it existed at the time, not the ES5 thing that adds classes back in after we failed to teach JS
by grahamlee 4y ago
Indeed; and I was talking about the Javascript "object model" as it existed at the time, not the ES5 thing that adds classes back in after we failed to teach JS developers what "this" is. Those little dynamic effects were, after all, working almost exclusively with the Document Object Model.
- TimTheTinker 4y agoThe object model hasn't changed -- ES5 classes are syntactic sugar on top of standard prototype-based JS classes :-)
- cxr 4y agoThe fact that you both refer to "ES5 classes", when in fact ES5 has no classes, is very relevant to the meta/epistemological aspects of this discussion and an indicator of whether or not some of the other remarks should be taken as authoritative truths.
- TimTheTinker 4y agoMy bad, I forgot when the class syntax was introduced. And yes, don't take my points as authoritative. Here's a more authoritative resource: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- grahamlee 4y agosorry, on my keyboard 5 is right next to 6.
- grahamlee 4y agoIt's true that the implementation model didn't change, but the conceptual model did: the new "class" thing lets people express designs containing what they call "classes" with "methods" even though what they're building is constructor functions that return objects where some of the properties are occupied by functions. That kind of chicanery isn't unique to JS, by the way, which I mention because of the unfair malignment of JS in the original article. Smalltalk-80 syntactically has blocks, but the code in a block is just compiled into the surrounding method and the block invocation is a fancy GOTO statement.