chuanxshi / javascript-patterns

JavaScript Design Patterns

Home Page:http://shichuan.github.io/javascript-patterns

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New method declaration convention

devinrhode2 opened this issue · 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