开发者

Local variable naming convention with JS Lint

Industry standard for most locally scoped variables is an '_' but JS Lint complains mightily about these _'s.

Does anyone else have a naming convention for locally scoped variable开发者_StackOverflow社区s in a JavaScript file


We develop in .NET here, and made the simple decision to standardize on a simple convention. C# and JavaScript code should be as close to one another as possible.

Hence, camelCase for local variables, TitleCase for types, and so on.

It's actually worked out pretty well, since there's no jarring transition between the two languages, and it does a great job of distinguishing our code from native JS code and that of 3rd party libraries.

My 2 cents.

P.S. We use the StyleCop standards, FWIW. And they probably won't make JSLint any happier.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜