I was looking into ES6, because it appears to be promoted when writing reactJS apps. I was a bit surprised about the way constructors work:
class Human{
constructor(name){
this.name = name;
}
toString(){
return "Name = " + this.name;
}
}
class Person extends Human{}
var person = new Person("kim");
How likely is it that one of the following might make my app brittle when writing a front end app in JS using class based system:
- Parametered constructors are implicitly inherited (is this a good idea overall and what is the chance that it will stay like that?);
- Disability to overload constructors within the same class;
- Disability to overload based on parameter types;
Optional question:
The secondary question I have is on how smart of a decision it would be to use ES6 for large production apps today and if it's useful to just use ES6 for experimenting for now. I'm not sure whether it's misplaced to think that JS is tending towards a full fledged class based system like Java, and that things might change (evolute) faster than my code base will be able to digest.