Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The object model hasn't changed -- ES5 classes are syntactic sugar on top of standard prototype-based JS classes :-)


It'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.


The 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.


My 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/Refe...


sorry, on my keyboard 5 is right next to 6.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: