3 ms·
Does a file containing one method need comments? initialize: function(model_name, callback) It would be pretty pointless to add comments before every line o
by wavephorm 15y ago
Does a file containing one method need comments?
initialize: function(model_name, callback)
It would be pretty pointless to add comments before every line of code like some people do:
// here is a for loop
for (var i...)
// declare a variable
var x = 0;
If there is supporting documentation about the operation of the method, which there is in that github page, then I fail to see what would be gained by adding verbose useless comments about typical code.
- phoboslab 15y ago"Does a file containing one method need comments?" So, the whole whole jQuery source is just one function, because its wrapped in one? It's not so much the lack of comments, but the whole formatting of the source. It's just hard to read. On a lesser note, it also seems that the author is pretty new to JavaScript. Underscores in variable names instead of lower camel case, "wrong" bracing style etc. (I'm ok with this, when it's applied consistently - which it is for this lib).