The latest simply_helpful generates dom id’s using underscores. It
seems to me that the RoR community is unofficialing standardizing on
that format.
Most CSS designers use camelCase. It seems that there are some
compatibility issues with using underscores.
- Why doesn’t RoR follow the standard and use camelCase?
- What are the exact problems with using underscores? Is it worth it?
Robert J. wrote:
- Why doesn’t RoR follow the standard and use camelCase?
Because you can usually improve Ruby’s readability by pushing
statements closer to grammatically-correct English. The success of
ActiveRecord despite twiddling the plurality of table names
demonstrates this effect.
An underbar among lower-case letters is slightly closer to English than
camelCase…
And it’s not a ‘standard’ - everything supports _ these days.
- What are the exact problems with using underscores? Is it worth it?
CSS designers probably inherited camelCase from Java. 'nuff said.
–
Phlip
Hi,
On 12-Dec-06, at 11:59 AM, Robert J. wrote:
- Why doesn’t RoR follow the standard and use camelCase?
Camel case isn’t a standard I think. It works but, if there’s a
‘standard’ at all, and I’m not saying there is, it’d be using ‘-’ so
‘admin-user’ rather than ‘admin_user’.
- What are the exact problems with using underscores? Is it worth
it?
It is illegal in CSS1, and was illegal in CSS2 until an errata was
published circa 2001. Before the errata, you had to escape
underscores, like ‘admin_user’ and many browsers screwed that up
(probably still do). This is for both class names and ids by the way.
Cheers,
Bob
–
Posted via http://www.ruby-forum.com/.
Bob H. – blogs at <http://www.recursive.ca/
hutch/>
Recursive Design Inc. – http://www.recursive.ca/
Raconteur – http://www.raconteur.info/
xampl for Ruby – http://rubyforge.org/projects/xampl/
Robert J. wrote:
Most CSS designers use camelCase. It seems that there are some
compatibility issues with using underscores.
- Why doesn’t RoR follow the standard and use camelCase?
Where did you get that camelCase is some kind of standard? Of all the
CSS books I have in my shelf (there are plenty of them, ranging from
B(udd) to Z(eldman)), only CSS Mastery uses camelcase in some places,
and even it doesn’t use it consistently. Most seem to favour using
dashes.
- What are the exact problems with using underscores? Is it worth it?
Netscape before 4.79 and Opera versions 5 and below didn’t support it
(see[1]). Since they are very old (I haven’t had a single request from
either during the whole year on my site), I don’t see any reason to
avoid it.
//jarkko
[1] http://www.nic.fi/~tapio1/Teaching/Models/Model6.html
–
Jarkko L.
http://www.railsecommerce.com
http://odesign.fi