How's ruby compare to it older brother python
Steve Lamb
grey at despair.dmiyu.org
Mon Apr 26 16:22:26 EDT 2004
On 2004-04-26, Phil Tomson <ptkwt at aracnet.com> wrote:
> Well, there is one big difference syntactically: Python uses indentation
> as syntax and Ruby doesn't. Personally I don't prefer Python's
> 'indentation-as-syntax' since it means that syntactically significant
> pieces of my code are invisible and if the tab settings in my editor are
> not the same as yours it can make it difficult to share code (or even
Why is this trotted out every time? I guarentee that my code will look
perfectly fine in your editor. I cannot guarentee the reverse as while you
might have a penchant for tabs I do not. I am not alone in that regard.
Here's a snippet from the Python style guide:
Tabs or Spaces?
Never mix tabs and spaces. The most popular way of indenting Python is with
spaces only. The second-most popular way is with tabs only. Code indented with
a mixture of tabs and spaces should be converted to using spaces exclusively.
(In Emacs, select the whole buffer and hit ESC-x untabify.) When invoking the
python command line interpreter with the -t option, it issues warnings about
code that illegally mixes tabs and spaces. When using -tt these warnings
become errors. These options are highly recommended!
So unless your tab setting is 0 syntactically significant pieces of code
should always have a different indention level. Furthermore if the
program(mers) follow the style guide then that is a non-issue.
--
Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
PGP Key: 8B6E99C5 | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------
More information about the Python-list
mailing list