Open pjeweb opened 12 years ago
See http://trac.osgeo.org/openlayers/wiki/CodingStandards
Not saying it's complete, but it is related. At some point we'll need to deal with old wiki content.
So it would help to consolidate the collection of links and information in a simple markdown file? I will write one!
Then I have some questions (and these are just some):
'
or double-quote"
?function (
or function(
?===
before ==
or ==
before ===
?I've seen various versions of for statements as: Question: What's the right way?
for (var i=0, len=jsFiles.length; i<len; ++i) {
Source: http://trac.osgeo.org/openlayers/wiki/CodingStandards -> Conventions.
Also seen (and as Crockford says):
var i,
len = jsFiles.length;
for (i = 0; i < len; i += 1) {
Also I've seen whitespaces like: Questions: Is that right? Is 80/79 chars per line really still useful?
method: 'post',
asynchronous: true,
contentType: 'application/xml',
parameters: ''
and
olBounds = new OpenLayers.Bounds(sw.lon,
sw.lat,
ne.lon,
ne.lat );
OpenLayers' code should be more consistent in its style. Suggestions: http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml or good old Crockford: http://javascript.crockford.com/code.html.
Also see #310 and #24.