Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it standard practice to use all caps for a JavaScript Namespace?

Tags:

javascript

I have been using namespaces to package my JavaScript code. In some of the examples that I have read, all caps have been used for the global name. For example: MYAPPLICATIONNAME.module.function

Is using all capitals the best practice since it seperates the vars in the global namespace, or is it just more confusing?

like image 345
rsideb Avatar asked Feb 25 '23 18:02

rsideb


1 Answers

I think it is a good practice to use all caps to represent global variables, see: http://javascript.crockford.com/code.html

YUI is one of the example, e.g. YAHOO or YUI

like image 169
tszming Avatar answered Feb 28 '23 08:02

tszming