I'm definitely in favour of using classes. Personally I find them easier to 
read and write. We are already using them in at least one place, the 
ProjectBuilder in cordova-android.[1] This came about from a refactor I did a 
few months ago, and since we dropped support for Node 6, it made sense to me to 
use a class. I don't think we need to go refactoring everything, but if there 
are new features to be added, I would strongly favour using classes in those 
cases.

[1] 
https://github.com/apache/cordova-android/blob/master/bin/templates/cordova/lib/builders/ProjectBuilder.js

On Fri, 30 Nov 2018, at 15:49, Oliver Salzburg wrote:
> I'm in favor of ES6 classes.
> 
> But that doesn't mean that everything that _can_ be written with classes 
> should. Pick the right tool for the job.
> 
> While you can achieve the same object structure by just extending the 
> prototype, classes have the benefit of keeping related code parts close 
> to each other. A class is usually defined in a single `class {}` block. 
> With prototype extensions that is not required and it can be a lot 
> harder to determine how an object is constructed.
> 
> So, as a language feature, they might not provide any benefits, but from 
> a code point of view, I think there are several. I'd put some of that 
> syntactic sugar in my tea.
> 
> On 2018-11-30 03:20, Chris Brody wrote:
> > I was wondering what our sentiment should be about using ES6 classes?
> >
> > My own opinion in coming in a response email.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
> > For additional commands, e-mail: dev-h...@cordova.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
> For additional commands, e-mail: dev-h...@cordova.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to