Thursday 15 July 2010

Should numbers be avoided in Javascript function names? -



Should numbers be avoided in Javascript function names? -

i heard js developer should avoid using numbers within function names.

for example:

function test1test() { // function body }

i've never come across before wondering if it's true? if so, why?

there's nil wrong having numbers in function name, it's little unconventional. ultimate goal in function , variable naming readability , clarity of code, if think including number in function name create code more clear, should create priority.

however, maximum readibility , clarity in cases, function names should camelcase verb phrases follow predominant convention.

for instance, might want name function converttomp3(), in case silly instead name function converttompthree(). should avoid using names obj2array() or format2(), because don't create code more clear.

javascript

No comments:

Post a Comment