Is there any reason why Typescript can't support a little syntax sugar similar to C# in allowing the base constructor call to be made inline? So Instead of:
class Car extends Machine {
constructor(radiator: RadiatorMechanism) {
super(); <- eww, please add sugar
var engine = EngineFactory.createEngine('V8');
}
}
it could be:
//aaah, much better
class Car extends Machine {
constructor(radiator: RadiatorMechanism): super() {
var engine = EngineFactory.createEngine('V8');
}
}
It's pretty trivial because all it does is clean up the constructor body, (especially when the following line is really long it just looks weird and my OCD kicks in), but usually that's exactly what syntax sugar is for.
For whatever other reasons it has support in C#, I petition for its support in Typescript ✌️
Is there any reason why Typescript can't support a little syntax sugar similar to C# in allowing the base constructor call to be made inline? So Instead of:
it could be:
It's pretty trivial because all it does is clean up the constructor body, (especially when the following line is really long it just looks weird and my OCD kicks in), but usually that's exactly what syntax sugar is for.
For whatever other reasons it has support in C#, I petition for its support in Typescript ✌️