Hacker News new | past | comments | ask | show | jobs | submit login

Some people already use it as though it had classes.

I don't like those people.




It has objects which you can use as prototypes and create instances of those objects using the new keyword. Doing this has the side effect of my better performance. With all of that being the case, what do you expect people to do? The good thing about maximally minimal classes is that it prevents people from making mistakes by assuming that prototypes work just like classes in java/etc.


In my experience (and some benchmarking), there's no real difference in speed between using a Module-based factory method or using object prototypes. Modern JS engines optimize for both.


Well it's not very good at not having classes either, due to the constructor mess (and `instanceof` being broken if you're doing constructorless JS as far as I know, which is very frustrating — of course it's even more broken if you have cross-frame objects involved) so...




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: