M
Martin Rinehart
I asked Google for "javascript code conventions". He pointed me to
seven convention documents. (More exactly, to Crockford and six lesser
convention documents.) I have compiled all the conventions in a single
document, here:
http://www.martinrinehart.com/articles/javascript-conventions.html
I stress that these are NOT my conventions; this is a compilation of
the others. My job: clerk. I tried to be a good clerk, organizing
sensibly so you can find things easily. Not always easy in a field
descended from Sun's Java conventions.
I was frankly disappointed to see that from all the available naming
styles (UpperAndLower, lowerAndUpper, ALLCAPS,
lower_with_underscores, ...) JavaScripters do almost nothing to use
these in an intelligent way. We should have conventions, as Java does,
that let you see immediately that you are looking at an object
reference, public method, etc.
For what it's worth, 6 conventions say JavaScript, one says
Javascript. None use anything else.
I'd like this thread to stick to the document (fixes, documents I
should include, ...) If you want to argue for or against particular
issues, please focus on the issue in a separate post. I'll set things
off in my next post.
seven convention documents. (More exactly, to Crockford and six lesser
convention documents.) I have compiled all the conventions in a single
document, here:
http://www.martinrinehart.com/articles/javascript-conventions.html
I stress that these are NOT my conventions; this is a compilation of
the others. My job: clerk. I tried to be a good clerk, organizing
sensibly so you can find things easily. Not always easy in a field
descended from Sun's Java conventions.
I was frankly disappointed to see that from all the available naming
styles (UpperAndLower, lowerAndUpper, ALLCAPS,
lower_with_underscores, ...) JavaScripters do almost nothing to use
these in an intelligent way. We should have conventions, as Java does,
that let you see immediately that you are looking at an object
reference, public method, etc.
For what it's worth, 6 conventions say JavaScript, one says
Javascript. None use anything else.
I'd like this thread to stick to the document (fixes, documents I
should include, ...) If you want to argue for or against particular
issues, please focus on the issue in a separate post. I'll set things
off in my next post.