From: David Vallner Date: 2006-11-15T08:04:25+09:00 Subject: Re: ruby indentantion --------------enig97E9E0E60351E271ED2DC3B6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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? >=20 For another take on the situation: I'd go out and blame blocks for using only two spaces. Since you tend to do stuff using a block so often, you end up with more levels of nesting in a method than in other languages. Non-loop blocks aren't really nesting, so you don't run into the readability issues with those so badly, but you'd get a larger chunk of whitespace on the left for code with the same levels of cyclomatic complexity (I -think- that's the term)= =2E And either way, the convention -seems to- be two, so I'd observe that for publically released code. For personal code, whatever, for work code, keep it consistent in the team, while remembering that the wiser man yields. Weirdly enough, I never found indentation or brace style nearly as important enough as to warrant trying to ever go against predominant custom in a language. However, there was one time someone asked me to stop using IDE shortcuts (even for copy-paste) when typing out some example code for him, and that's when your code-grinding brain -really- breaks ;P David Vallner --------------enig97E9E0E60351E271ED2DC3B6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) iD8DBQFFWktxy6MhrS8astoRAnnGAJ9OhYrW/uukf9Hy/dRGpoY3hqkjkQCcDPYc pRIllYjZs4qbxTeiz8XyoJY= =a1SH -----END PGP SIGNATURE----- --------------enig97E9E0E60351E271ED2DC3B6--