HN2new | past | comments | ask | show | jobs | submitlogin

Out of curiosity, where do you stand on ES6 classes?


Certainly cleaner than using the old prototypal inheritance syntax.

    // Dog Class
    function Dog(_name){
       // call the parent constructor
       Animal.apply(this,arguments);
    }

    // extends the Animal prototype chain
    Dog.prototype = new Animal();
Although the new class syntax may obfuscate from what's actually happening in an effort to look more like traditional class-based languages like Java.

However I'm the type of person that will only use React function components in my codebase. I don't think the object-oriented style has added much too my programming, except the temptation to reach for an unnecessary abstraction.




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

Search: