M
Martin Rinehart
The Dojo Style Guide suggests prepending an underscore to indicate a
"private" variable. Crockford says don't; JavaScript doesn't have
privates. Which should be the convention?
I'll vote first: Dojo. Crockford is correct, but I find his logic
broken. The prepended underscore says clearly "If we had 'private's
this would be one of them." That is useful information, conveyed
succinctly.
"private" variable. Crockford says don't; JavaScript doesn't have
privates. Which should be the convention?
I'll vote first: Dojo. Crockford is correct, but I find his logic
broken. The prepended underscore says clearly "If we had 'private's
this would be one of them." That is useful information, conveyed
succinctly.