javascript-patterns icon indicating copy to clipboard operation
javascript-patterns copied to clipboard

New method declaration convention

Open devinrhode2 opened this issue 12 years ago • 0 comments

I've come up with a really good convention for naming methods:

person.getData = function person_getData() {
};

We prepend with person_ so that the function name is unique from the identifier, avoiding errors in IE.

It also tells us EXACTLY what function we're dealing with in a stack trace.

@shichuan probably best to let you update the codebase with this new convention; if you approve. For a javascript error dashboard this will prove rather useful

devinrhode2 avatar Feb 09 '13 21:02 devinrhode2