News for hackers. Stuff that matters.
Re:Zurb Foundation 5 Released by chrismorgan on Thursday November 21, 2013 @04:23PM (#6777600)
I'm puzzled about the switch from camelCase to snake_case for JS as shown in http://foundation.zurb.com/docs/upgrading.html#javascript-va.... The clear convention in JavaScript is camelCase, why switch away from it? (I say this as someone who in normal life using Python and Rust uses and prefers snake_case but who uses camelCase when writing JavaScript.)
Re:Zurb Foundation 5 Released by avolcano on Thursday November 21, 2013 @05:03PM (#6777860)
This is insane.

I have literally never seen a large-scale open source project or JS style guide that uses snake_case.

The DOM is camelCase. jQuery is camelCase. Node APIs are camelCase. Why on earth do Zurb think their library is any different?

Re:Zurb Foundation 5 Released by __david__ on Thursday November 21, 2013 @10:20PM (#6779068)
> This is insane.

Really? Why on earth would you care? What if they were to indent their code with 3 spaces? Would that be "insane", too? What if they don't like putting in unnecessary braces around one line "if" statements? Insane?

It's a (very common) stylistic choice. It's hardly insane.

Re:Zurb Foundation 5 Released by avolcano on Thursday November 21, 2013 @10:43PM (#6779155)
It's a public API meant for consumption by other developers, 95-99% of which are going to be use camelCase.

I don't care what their code looks like internally. I do care about the public interface to it.

Re:Zurb Foundation 5 Released by jakethehuman on Friday November 22, 2013 @02:03AM (#6779615)
>What if they were to indent their code with 3 spaces?

Whoa buddy! Put down the gun...

On a serious note... is this trolling or are people seriously complaining about camel-case vs snake-case?

Re:Zurb Foundation 5 Released by jakethehuman on Friday November 22, 2013 @01:58AM (#6779602)
>What if they were to indent their code with 3 spaces?

Whoa there buddy! Put the gun down...

Re:Zurb Foundation 5 Released by jimmytucson on Thursday November 21, 2013 @08:06PM (#6778646)
Meteor did, at least in the beginning.
Re:Zurb Foundation 5 Released by camus2 on Friday November 22, 2013 @08:18AM (#6780521)
While I hate camelCase, i have to agree, javascript core lib uses camelCase and PascalCase , so should 3rd party libraries.
Re:Zurb Foundation 5 Released by smrtinsert on Friday November 22, 2013 @09:05AM (#6780716)
What has this site come to...
Re:Zurb Foundation 5 Released by Spiritus on Thursday November 21, 2013 @04:41PM (#6777711)
I wouldn't mind if more projects did this to be honest.
Re:Zurb Foundation 5 Released by lowboy on Thursday November 21, 2013 @04:50PM (#6777772)
I would, just because it causes fragmentation. PEP-8[0] is a big win for Python. Javascript relies on adhoc standards and best practice docs from respected entities.

I'm open to change and debate, but it should be approached carefully.

[0]: http://www.python.org/dev/peps/pep-0008/

Re:Zurb Foundation 5 Released by jessedhillon on Thursday November 21, 2013 @06:31PM (#6778317)
To be fair, at the time JS was developed, there was a body of well-documented knowledge involving camelCasing. First and foremost was, of course, Java. There are various RFCs involving LDAP schemas as well -- I recall seeing a hilarious document once describing how to properly name the attribute corresponding to an entity's certificate:

   cACertificate*
Talk about slavish consistency.
Re:Zurb Foundation 5 Released by Segmentation on Thursday November 21, 2013 @04:46PM (#6777750)
> The clear convention in JavaScript is camelCase, why switch away from it?

Citation?

Re:Zurb Foundation 5 Released by chrisfarms on Thursday November 21, 2013 @05:05PM (#6777870)
Let'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=C...

Re:Zurb Foundation 5 Released by jessedhillon on Thursday November 21, 2013 @04:56PM (#6777813)
How 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
Re:Zurb Foundation 5 Released by cstigler on Thursday November 21, 2013 @06:36PM (#6778343)
notQuantified !== false

to avoid type coercion here

Re:Zurb Foundation 5 Released by mendelk on Thursday November 21, 2013 @09:01PM (#6778806)
S/he was using CoffeeScript, obviously! :)
Re:Zurb Foundation 5 Released by madeofpalk on Friday November 22, 2013 @04:41AM (#6779940)
> crawl every Javascript project on Github and compile statistics on naming styles

You mean... like this? http://sideeffect.kr/popularconvention/#javascript

Unfortuantely there's no stat there for camelCase for Javascript.

Re:Zurb Foundation 5 Released by ceejayoz on Thursday November 21, 2013 @05:39PM (#6778038)
> Citation?

Well, it's sure as hell not window.set_timeout, window.clear_interval, window.on_load, etc.

Re:Zurb Foundation 5 Released by lowboy on Thursday November 21, 2013 @04:52PM (#6777789)
Javascript 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.
Re:Zurb Foundation 5 Released by wildermuthn on Thursday November 21, 2013 @05:46PM (#6778070)
Suggestion:

JavaScript.

Re:Zurb Foundation 5 Released by janus on Thursday November 21, 2013 @07:25PM (#6778512)
Camel cased would actually be javaScript
Re:Zurb Foundation 5 Released by Stratoscope on Thursday November 21, 2013 @11:49PM (#6779346)
Idiomatic JavaScript code uses both PascalCase and camelCase.

Constructors use PascalCase; variables and methods use camelCase.

So, it's OK to call it JavaScript! :-)