Wintergatan / Midi-to-laser-cutter

https://wintergatan.github.io/Midi-to-laser-cutter/
MIT License
126 stars 16 forks source link

TODO: Decide on javascript version and coding style #16

Open Yuleblinker opened 7 years ago

Yuleblinker commented 7 years ago

Those wishing to contribute will have different levels of experience in Javascript coding and Javascript versions e.g. ES5, ES6 . At some point in the is project it is likely a decision will need to be made by the group as to which version of Javascript to adopt as the project standard.

Do we now, or in the future want to standardise on ES6? Inisiting at this stage in the project that all code conforms 'strctly' to ES6 syntax, styling and features may, however, discourage those who are not yet familiar with ES6 to contribute. Also, if we adopt a suitably modular approach to the application model then individuals or teams can work on their own part using whatever Javascript style they are comfortable with. All that's necessary is that the 'modules', 'objects' or 'code chunks (or whatever you want to call them) have clearly defined, and agree upon, inputs and outputs. This highlights the necessity of a clearly defined model for the application (please consider, discuss and contribute to to this issue https://github.com/Wintergatan/Midi-to-laser-cutter/issues/15 and this file https://www.draw.io/#HWintergatan%2FMidi-to-laser-cutter%2Fmaster%2FUML%2FApplication%20model.xml)

Please comment below if you have any thoughts on which Javascript version and coding style to adopt.

ChemiCalChems commented 7 years ago

What are we coding in right now? ES5, ES6? As I have already said a couple of times, I don't have experience with JS that much, I just get stuff done.

Is there a resource where one can check differences between ES5 and ES6?

Yuleblinker commented 7 years ago

The code that's been done so far is ES5. A good place to see some ES5 side-by-side with ES6 equivalents is: http://es6-features.org/#BlockScopedVariables

Lars-Kristian commented 7 years ago

The javascript code that we are publishing, should always be ES5. But often the source code is run through a transpiler like babel js or similar (ES6 to ES5). This is what I have done with the other prototype (TS to ES5).

drallieiv commented 7 years ago

ES6 is not natively supported by browsers, or at least not completely. So public client site Javascript is always transpiled to ES5 (using babel), but you can directly run ES6 on a node.js backend.

Pierstoval commented 7 years ago

I think it's good to keep the work going in ES5 for now, and when the project will be much more mature, rewrite it.

As it's more like a POC now, I think it's better for now to focus on the features, and rewrite when features list are 100% complete and the project can be divided into "scenarios", "features list", decoupled into app logic and business layers. Maintainability is not 100% mandatory for a POC πŸ˜„

I'm just seeing this from an external point as a web-developer πŸ™‚

DrSkunk commented 6 years ago

ES5 is chosen for compatibility. Should be added to CONTRIBUTING