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

> And yes, javascript supports many kinds of inheritance

Funny you mention it, since JavaScript has absolutely no concept of contracts, which is one of the most important side-effects of inheritance. Especially not at compile time, but even at runtime you can compose objects willy-nilly, pass them anywhere, and the only way to test if they adhere to some kind of trait is calling a method and hoping for the best.

At least that had been the case till ES6 came around, but good luck finding anyone actually using classes in JavaScript. Mainly because it adds near-zero benefits, basically just the ability to overwrite method behavior without too much trickery.



Yes. JavaScript is an incredibly dynamic language. If you don’t like that, don’t use it.




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

Search: