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

Classlessness in OO systems was around a long time before JS was even conceived of.

Oh I know that. It's just that being the most popular programing language in the world helps setting trends, even when you don't invent them.



I find it unfortunate that lack of classes is seen as some chief defect of JS. It's actually one of the things I like about it.

Messed up scoping rules, and bizarre type coercions, yes, ugly. But the object system I think is nice.


Well , not anymore since ES2015 has classes,class inheritance,super and co. Prototypical inheritance is bizarre, verbose and dangerous.


ES2015 doesn't have classes, it has a class statement which desugars to prototypal inheritance.

And as Self demonstrated long before Javascript even existed, prototypal inheritance is neither bizarre nor verbose let alone dangerous. As with most other things, Javascript just has a completely mangled version of it for (I can only assume) original implementation simplicity.


Yes I find it very unfortunate that 99% of people's exposure to 'prototype inheritance' is JS's rather inelegant form of it. Though like many things with JS if you are disciplined it can be used elegantly.




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

Search: