From: Intransition Date: 2012-05-24T04:25:28+09:00 Subject: Re: Opinion on String#camelcase ------=_Part_754_26769198.1337800523081 Content-Type: multipart/alternative; boundary="----=_Part_755_12087002.1337800523081" ------=_Part_755_12087002.1337800523081 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tuesday, May 22, 2012 12:02:21 PM UTC-4, Bartosz Dziewo=C5=84ski wrote: > > While your change might be more "correct", I can't think of a single=20 > situation in real-world Ruby code where you would need to camelcase=20 > something and keep the first letter small.=20 > > Ruby's constant/module/class names are (by convention) always=20 > UpperCamelCase or UPPERCASE; Ruby's method and variable names are (by=20 > convention) always lower_snake_case. There's no reason to convert=20 > anything to lowerCamelCase, unless you're maybe interfacing with=20 > legacy database or really want to cause yourself trouble by coming up=20 > with different conventions than the usual ones.=20 > > Libraries should be optimized for the typical use case. If someone=20 > wants typical camelcasing, they'd just call ".camelcase"; if someone=20 > wants atypical, they'd have to call ".capitalize.camelcase" or=20 > whatever.=20 > > You make a good point Matma. And you caused to me to recollect one of the= =20 prior changes that made this change even possible in the first place. A=20 while back I separated out the need for converting paths, methods and=20 module/class names to dedicated methods, rather than trying to double duty= =20 the #camelcase and #snakecase methods for this purposes. So we're okay in= =20 this regard. In the particular case you mention we have String#modulize. ------=_Part_755_12087002.1337800523081 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Tuesday, May 22, 2012 12:02:21 PM UTC-4, Bartosz Dziewo=C5=84ski wrote:<= blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bord= er-left: 1px #ccc solid;padding-left: 1ex;">While your change might be more= "correct", I can't think of a single
situation in real-world Ruby code where you would need to camelcase
something and keep the first letter small.

Ruby's constant/module/class names are (by convention) always
UpperCamelCase or UPPERCASE; Ruby's method and variable names are (by
convention) always lower_snake_case. There's no reason to convert
anything to lowerCamelCase, unless you're maybe interfacing with
legacy database or really want to cause yourself trouble by coming up
with different conventions than the usual ones.

Libraries should be optimized for the typical use case. If someone
wants typical camelcasing, they'd just call ".camelcase"; if someone
wants atypical, they'd have to call ".capitalize.camelcase" or
whatever.

You make a good point Matma. And you caused to me to = recollect one of the prior changes that made this change even possible in t= he first place. A while back I separated out the need for converting paths,= methods and module/class names to dedicated methods, rather than trying to= double duty the #camelcase and #snakecase methods for this purposes. So we= 're okay in this regard. In the particular case you mention we have String#= modulize.

------=_Part_755_12087002.1337800523081-- ------=_Part_754_26769198.1337800523081--