Welcome Guest, Not a member yet? Register   Sign In
"camelCase" when and where?
#5

[eluser]slowgary[/eluser]
None of them are really 'standards', they're more of a style guide to encourage consistency both in your own code and between developers. I have never heard any recommendation to use camelCase in CSS and JavaScript, and I'd prefer not to. I like underscores as they promote readability.

The only benefit camelCase may provide is smaller file sizes (and since CSS and JS are clientside, I see why one would recommend it), although that argument really has no weight, because I could name my CSS class 'column_1' while you could name yours 'leftColumn' and mine would be smaller. Also, a smaller file size is better, but only positively affects download speed when you manage to shave an entire packet off of the client's load. In other words, if the client's connection requires 20 packets to download your CSS file, and you shave 50 bytes off of that file by using camelCase, your client may STILL require 20 packets of data to complete the download. Basically all you did was made your code less readable and saved a few bytes on someone's hard drive (but probably not, because the winblows filesystem has the SAME problem with hard drive cluster size).

Moral of the story: A camelCase is something that belongs in the dessert filled with cold water, not in your source code.


Messages In This Thread
"camelCase" when and where? - by El Forum - 06-23-2009, 03:36 AM
"camelCase" when and where? - by El Forum - 06-23-2009, 04:26 AM
"camelCase" when and where? - by El Forum - 06-23-2009, 04:37 AM
"camelCase" when and where? - by El Forum - 06-23-2009, 04:38 AM
"camelCase" when and where? - by El Forum - 06-23-2009, 01:28 PM
"camelCase" when and where? - by El Forum - 06-23-2009, 01:45 PM
"camelCase" when and where? - by El Forum - 06-23-2009, 01:49 PM
"camelCase" when and where? - by El Forum - 06-23-2009, 01:59 PM
"camelCase" when and where? - by El Forum - 06-23-2009, 02:07 PM
"camelCase" when and where? - by El Forum - 06-23-2009, 02:15 PM
"camelCase" when and where? - by El Forum - 06-23-2009, 02:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB