4 ms·
> The clear convention in JavaScript is camelCase, why switch away from it? Citation?
by Segmentation 13y ago
> The clear convention in JavaScript is camelCase, why switch away from it?
Citation?
- lowboy 13y agoJavascript was created in camelCase, and most major open source projects I've used have been camelCase. I can't find any data on it, but it fits with my experience for what that's worth.
- jessedhillon 13y agoHow would you even expect this to be cited? Seriously, does someone need to crawl every Javascript project on Github and compile statistics on naming styles before they can make an obviously true statement like this? The fact that camelCase is the norm in the language and browser environment is obvious to anyone who has written even a modest amount of JS. notQuantified != false
- cstigler 13y agonotQuantified !== false to avoid type coercion here
- mendelk 13y agoS/he was using CoffeeScript, obviously! :)
- madeofpalk 13y ago> crawl every Javascript project on Github and compile statistics on naming styles You mean... like this? http://sideeffect.kr/popularconvention/#javascript http://sideeffect.kr/popularconvention/#javascript Unfortuantely there's no stat there for camelCase for Javascript.
- chrisfarms 13y agoLet's just try some searches for some common names using github code search with a ".js" extension filter hideImage vs hide_image: 424 vs 50 toggleItem vs toggle_item: 1022 vs 52 clickElement vs click_element: 3469 vs 368 Coding conventions by statistics :) https://github.com/search?q=searchPage+extension%3Ajs&type=Code&ref=searchresults https://github.com/search?q=searchPage+extension%3Ajs&type=C...
- ceejayoz 13y ago> Citation? Well, it's sure as hell not window.set_timeout, window.clear_interval, window.on_load, etc.
- wildermuthn 13y agoSuggestion: JavaScript.
- janus 13y agoCamel cased would actually be javaScript
- Stratoscope 13y agoIdiomatic JavaScript code uses both PascalCase and camelCase. Constructors use PascalCase; variables and methods use camelCase. So, it's OK to call it JavaScript! :-)