(2013/09/09 21:18), Dao wrote:
On 09.09.2013 05:15, ishikawa wrote:
I have been recently editing javascript files to
reduce warnings but found an issue of adopted styls in comm-central
thunderbird codes.

I checked for the preferred style:

[1] I found one reference here:
http://autonome.wordpress.com/2006/03/24/javascript-style-guide-for-mozilla-projects/

[2] I found another which looks official.
https://developer.mozilla.org/en-US/docs/Developer_Guide/Coding_Style

It is not entirely clear which indentation levels are preferred.
   - two spaces in [1], or
   - four spaces (Java style section of the official-looking page in [2]
     states  that it intentionally deviates from Java Style guide.

The MDN doc seems unambiguous to me in that it demands two spaces for
Javascript (which you asked about) and four spaces for Java (which you
didn't ask about).

Right, 2 spaces for JavaScript and 4 spaces for Java.

But to be honest, I wonder why 2 for JS and 4 for Java.
As far as the indentation requirement is concerned, there does
not seem to be much difference between the two languages.
But there must be a reason. But for a casual programmer, it is not clear.

Thank you for pointing it out, though.





_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to