Hi --
On Wed, 15 Nov 2006, James Edward Gray II wrote:
> On Nov 14, 2006, at 1:13 PM, Morton Goldberg wrote:
>
>> On Nov 14, 2006, at 10:39 AM, Alfonso wrote:
>>
>>> I have just started with ruby, and something that I have observed is that
>>> most of the code is indented with 2 spaces. Having programmed some time
>>> with C# and python, it's very strange to me so few identation. To me 4
>>> spaces is much better to read. Is there something like a style guide in
>>> ruby that says that you should use 2 spaces or is it all right using 4 or
>>> 3 spaces? What do you use in your code?
>>
>> Use whatever indentation looks right to you, and don't let anyone bully you
>> into doing it otherwise. I indent by three spaces and don't intend to
>> change.
>
> At the risk of being labeled a bully, "When in Rome..."
That's what it's really about
: that there is a traditional coding
style -- a "Rome". I think it's useful for it to be mentioned, not so
that no one ever deviates from it, but so that people who prefer to
use a language's traditional style will know that Ruby has one. That
sometimes gets overlooked amidst the excitement of how liberal the
parser is, etc.
One of my favorite things about Rails, and I think one of the
shrewdest things the Rails team has done, is that it's written for the
most part in a very vanilla coding style. Not all the code is
vanilla, of course

But it blends very well with the standard
library and so forth in style.
David
--
David A. Black |
Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3]
DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4]
[1]
http://www.manning.com/black | [3]
http://www.rubypowerandlight.com
[2]
http://dablog.rubypal.com | [4]
http://www.rubycentral.org