melonJS icon indicating copy to clipboard operation
melonJS copied to clipboard

Create a document to explain coding standards

Open lsix opened this issue 15 years ago • 7 comments

In order to have every contributors to comply to the same coding conventions, it would be interesting to have a small document explaining the conversions already in use (indentation realized with tab char, no tab char inside comments, and so on).

lsix avatar Aug 28 '11 06:08 lsix

One example can be : http://javascript.crockford.com/code.html

lsix avatar Aug 28 '11 06:08 lsix

Very interesting document. It may be a little generic, some specific MelonJS coding standards would be more efficient, beginning with a diagram of how all classes interact together (I'm sure Olivier got that scribbled on a ripped piece of paper somewhere... Or maybe a clean document if he's more organized than I am), some insight on how inheritance is implemented, etc...

Ben2303 avatar Aug 29 '11 19:08 Ben2303

@lancelot : am I right, or we just did the opposite ? :):):) "The unit of indentation is four spaces. Use of tabs should be avoided because (as of this writing in the 21st Century) there still is not a standard for the placement of tabstops"

@ben2303 : effectively, that's a good point... and yes I have it somewhere and I should take the time to write something. A least a visio diagram, let's see after for the clean document ! Actually I was hoping to get this generated with jsDoc (to show the inheritance tree, and how classes are interacting), it's good to generate the documentation, but for more, it's not really working as I was expecting to.

ghost avatar Aug 30 '11 02:08 ghost

While lookng for a JS beautifier, I stumbled upon http://jslint.com/ , looks very interesting (no command line though or I missed it). Guess an Eclipse plugin doing the same things should exist somewhere :/ Edit : should read a little better... : https://github.com/douglascrockford/JSLint

Ben2303 avatar Aug 30 '11 08:08 Ben2303

Has any progress been made with this? Because, I would like to know what, if any, coding standards there are. The two links above are nice, but don't really give any explanation. Thanks,

prestonberrett avatar Oct 17 '11 15:10 prestonberrett

Except for the complete reformatting of the source code, no, no major changes to coding standard except for the 2 mentioned links :)

In the mean time and to be objectives, seeing the very low amount of significative code contribution on this project, so far it's not really a problem. If later contributions are reaching a higher level, it will then be time to talk again about this, and ensure everybody is on the same page. Until that, provide some code that works and more or less looks like the here mentioned standard and/or the rest of melonJS is already awesome !

On 17 oct. 2011, at 23:29, rberrett [email protected] wrote:

Has any progress been made with this? Because, I would like to know what, if any, coding standards there are. The two links above are nice, but don't really give any explanation. Thanks,

Reply to this email directly or view it on GitHub: https://github.com/obiot/melonJS/issues/14#issuecomment-2430111

ghost avatar Oct 17 '11 17:10 ghost

I'm closing this ticket, we don't need documentation about how to write clean Javascript (this is not the purpose of the library), but we however need to ensure that the library is properly written. So I will open a new one to integrate something like JSLint into the build process (that could then be used as well for other projects using melonJS).

ghost avatar Mar 20 '12 02:03 ghost