[Devculture] ruby question - try Python also (fwd)

hmmm, this doesn’t mesh terribly well with my experience. Anyone else car
to take a crack at answering it?

-pate

···

---------- Forwarded message ----------
Date: Wed, 06 Aug 2003 22:07:21 -0400
From: Anil R. Diwan adiwan@snet.net
Reply-To: devculture@lists.whirlycott.com
To: devculture@lists.whirlycott.com
Subject: Re: [Devculture] ruby question - try Python also

I looked at Ruby with great interest. I was dismayed by the insufficient
development in Ruby and poor support for many good things it has.
For Web development, the best project going on in Ruby is a replacement of
the JSP/ASP like architecture of web pages with an architecture which
cleanly separates the HTML page portion and the Ruby class that fills it in.
The ideas they have used are really clever. They claim they took inspiration
from Webobjects. However, I did not see any further development in that
project (last year). Then I saw Ruby trying to copy JSPs!!!
CONS of RUBY:
Ruby allows you to use MANY different coding syntaxes - It supports PERL
like syntax as also Python like syntax among others. This WILL make the Ruby
code archaic and uncommunicable across large teams when the teams are
brought together by hiring consultants as they generally are.
The syntax issues and support for mechanics of both PERL like and Python
like stuff makes programming more interesting to people who like to write
compact code undecipherable to others (read - job security as a PRO item
here).

My current favorite, after looking at a large number of languages is Python
or Jython, depending upon whether you want access to Java are you are happy
with the available C code base. Jyhton in particular sits as a
interpreter/compiler on top of the JVM. You write Python code in Jython, run
it like a script, and then you can even ask Jython to produce Java Source
code from what you wrote! All Java classes can be called from the Python
side. And you write compact code in the beautiful python language.

Python has excellent syntax (Ruby derived its syntax pretty much fully from
Python, and added the Perlish stuff). It is a TRUE Object-oriented language
offering first class objects like in SmallTalk or Haskell, that can modify
behavior by runtime binding with a type or class, and inheriting at run
time. Despite its roots as a scripting language, it actually is an
object-oriented language, unlike Java and C++. [Java and C++ are Class
oriented languages, as opposed to Object oriented languages].
Coding in Python is compact, and Python provides a lot of facilities. Also
because of Jython, its acceptance will rise (I hope). Jython is also an easy
way to write Java code.

I have not coded in either Ruby or Python, so all comments are based on
reading and learning the language.

Sincerely,


Anil R. Diwan, Ph.D.
Chief Technology Officer

AllExcel, Inc.
135 Wood St., Ste.200
West Haven, CT 06516.
Tel&Fax: (203) 937-6137.

The contents of this e-mail are privileged and confidential and intended
only for the use of the individual or entity named above or their
designee. If the reader of this e-mail is not the intended recipient,
you are hereby notified that the dissemination, distribution, or copying
of this communication is prohibited. If you received this communication
by mistake, please notify by replying to this e-mail and delete the message.
Thank You.

From: WHIRLYCOTT phil@whirlycott.com
Reply-To: devculture@lists.whirlycott.com
Date: Tue, 5 Aug 2003 21:42:39 -0400
To: devculture@lists.whirlycott.com
Subject: [Devculture] ruby question

I was just going to send this email to my friend Pat Eyler directly,
but I remembered that he’s on this list and that others here may be
interested in this… maybe :wink:

Anyway, my question is about Ruby. I’m wondering what it would offer
me, since I do most of my work in weblike environments and use all
sorts of funny stuff. I’ve compiled a laundry list and I’m wondering
if Pat knows about the answers to any of this… while I’m digging some
of this up myself.

Does Ruby have…? / How strong is ruby in the area of…?

  • SOAP support
  • XML support
  • inline web page building like asp/php/jsp
  • database access
  • application server type features for data caching, database
    connection pooling, session management ala j2ee/mod_perl/php

Just wondering what Pat may have run into during the course of his
travels… if others have experiences with Ruby as well, I’d like to
hear about them.

phil.


Whirlycott
Philip Jacob
phil@whirlycott.com
http://www.whirlycott.com/phil/


devculture mailing list
devculture@lists.whirlycott.com
http://lists.whirlycott.com/mailman/listinfo/devculture

You answered it well. It doesn’t mesh well with your experience. The
opinions below disclaim any experience. QED.

Despite the disclaimer, some of the claims are a bit grand, demonstrating
a very poor understanding of Ruby’s heritage. It’s pretty common that if
someone only understands language X, they will only see the aspects of
Ruby that resonate with language X. It takes an open mind and some
experience to overcome this natural human limitation. At the end of the
day, the notion that Ruby encourages archaic and uncommunicable code is
perverse.

For the WebObjects-like framework, I assume he is referring to CGIKit, a
fine package, to be sure, but a bit beyond my understanding at the moment.
It is actively developed, but not, to my knowledge, actively discussed,
which is a shame.

If there were a few useful, public webapps written in Ruby using this and
other frameworks, with source code published and documented, I’d die a
happy man…

Gavin

···

hmmm, this doesn’t mesh terribly well with my experience. Anyone else
care to take a crack at answering it?

-pate

---------- Forwarded message ----------
Date: Wed, 06 Aug 2003 22:07:21 -0400
From: Anil R. Diwan adiwan@snet.net
Reply-To: devculture@lists.whirlycott.com
To: devculture@lists.whirlycott.com
Subject: Re: [Devculture] ruby question - try Python also

I looked at Ruby with great interest. I was dismayed by the insufficient
development in Ruby and poor support for many good things it has.
For Web development, the best project going on in Ruby is a replacement
of the JSP/ASP like architecture of web pages with an architecture which
cleanly separates the HTML page portion and the Ruby class that fills it
in. The ideas they have used are really clever. They claim they took
inspiration from Webobjects. However, I did not see any further
development in that project (last year). Then I saw Ruby trying to copy
JSPs!!!
CONS of RUBY:
Ruby allows you to use MANY different coding syntaxes - It supports PERL
like syntax as also Python like syntax among others. This WILL make the
Ruby code archaic and uncommunicable across large teams when the teams
are brought together by hiring consultants as they generally are.
The syntax issues and support for mechanics of both PERL like and Python
like stuff makes programming more interesting to people who like to
write compact code undecipherable to others (read - job security as a
PRO item here).

My current favorite, after looking at a large number of languages is
Python or Jython, depending upon whether you want access to Java are you
are happy with the available C code base. Jyhton in particular sits as a
interpreter/compiler on top of the JVM. You write Python code in Jython,
run it like a script, and then you can even ask Jython to produce Java
Source code from what you wrote! All Java classes can be called from the
Python side. And you write compact code in the beautiful python
language.

Python has excellent syntax (Ruby derived its syntax pretty much fully
from Python, and added the Perlish stuff). It is a TRUE Object-oriented
language offering first class objects like in SmallTalk or Haskell, that
can modify behavior by runtime binding with a type or class, and
inheriting at run time. Despite its roots as a scripting language, it
actually is an object-oriented language, unlike Java and C++. [Java and
C++ are Class oriented languages, as opposed to Object oriented
languages].
Coding in Python is compact, and Python provides a lot of facilities.
Also because of Jython, its acceptance will rise (I hope). Jython is
also an easy way to write Java code.

I have not coded in either Ruby or Python, so all comments are based on
reading and learning the language.

Sincerely,


Anil R. Diwan, Ph.D.
Chief Technology Officer

AllExcel, Inc.
135 Wood St., Ste.200
West Haven, CT 06516.
Tel&Fax: (203) 937-6137.

The contents of this e-mail are privileged and confidential and intended
only for the use of the individual or entity named above or their
designee. If the reader of this e-mail is not the intended recipient,
you are hereby notified that the dissemination, distribution, or copying
of this communication is prohibited. If you received this communication
by mistake, please notify by replying to this e-mail and delete the
message. Thank You.

From: WHIRLYCOTT phil@whirlycott.com
Reply-To: devculture@lists.whirlycott.com
Date: Tue, 5 Aug 2003 21:42:39 -0400
To: devculture@lists.whirlycott.com
Subject: [Devculture] ruby question

I was just going to send this email to my friend Pat Eyler directly, but
I remembered that he’s on this list and that others here may be
interested in this… maybe :wink:

Anyway, my question is about Ruby. I’m wondering what it would offer
me, since I do most of my work in weblike environments and use all sorts
of funny stuff. I’ve compiled a laundry list and I’m wondering if Pat
knows about the answers to any of this… while I’m digging some of this
up myself.

Does Ruby have…? / How strong is ruby in the area of…?

  • SOAP support
  • XML support
  • inline web page building like asp/php/jsp
  • database access
  • application server type features for data caching, database
    connection pooling, session management ala j2ee/mod_perl/php

Just wondering what Pat may have run into during the course of his
travels… if others have experiences with Ruby as well, I’d like to
hear about them.

phil.


Whirlycott
Philip Jacob
phil@whirlycott.com
Philip Jacob


devculture mailing list
devculture@lists.whirlycott.com
http://lists.whirlycott.com/mailman/listinfo/devculture

hmmm, this doesn’t mesh terribly well with my experience. Anyone else car
to take a crack at answering it?

Date: Wed, 06 Aug 2003 22:07:21 -0400
From: Anil R. Diwan adiwan@snet.net
Reply-To: devculture@lists.whirlycott.com
To: devculture@lists.whirlycott.com
Subject: Re: [Devculture] ruby question - try Python also

<snip - lot of claims that make me wonder how he knows this when…>

I have not coded in either Ruby or Python, so all comments are based on
reading and learning the language.

How can you learn (‘the language’ - he doesn’t specify which)a without
writing some programs in it?

My response would probably be ‘shut up, troll’. :slight_smile:

···

---------- Forwarded message ----------


You will lose your present job and have to become a door to door
mayonnaise salesman.
Rasputin :: Jack of All Trades - Master of Nuns

Try Webplayer[1] based on Borges[2]. While Borges isn’t yet fully, or
completely documented (I still don’t fully understand it), Webplayer is
reasonably well documented, and should be simple enough to understand
in no more than a few minutes reading. If not, I’ll be happy to expand
documentation on any rough spots.

[1] http://segment7.net/ruby-code/webplayer/webplayer.html

[2] http://segment7.net/ruby-code/borges/borges.html

···

Gavin Sinclair (gsinclair@soyabean.com.au) wrote:

If there were a few useful, public webapps written in Ruby using this and
other frameworks, with source code published and documented, I’d die a
happy man…


Eric Hodel - drbrain@segment7.net - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

Rasputin wrote:

hmmm, this doesn’t mesh terribly well with my experience. Anyone else car
to take a crack at answering it?

Date: Wed, 06 Aug 2003 22:07:21 -0400
From: Anil R. Diwan adiwan@snet.net
Reply-To: devculture@lists.whirlycott.com

…I have not coded in either Ruby or Python, so all comments are based on
reading and learning the language.

How can you learn (‘the language’ - he doesn’t specify which)a without
writing some programs in it?..

Well, I have “some” familiarity with Ruby and Python. Don’t brush off
his comments lightly if you want Ruby to be more popular. The only way
for Ruby to be more popular is for more people to use it. Which means
for more peopel who are currently unfamiliar with it to use it.

Ruby has by far the best syntax of any language that I’ve encountered,
and for many purposes it’s semantics are as good as any. And it MAY
have good library support. But many libraries seem to be either
abandoned or only documented in Japanese (well, only adequately etc.).

This is, perhaps, quite understandable given the history, but if I
intend to do something, and I must choose between Ruby and Python, it
will frequently resolve down to “Which language can I most easily
figure out how to do things in”, and libraries can here be the
determining feature. I far prefer Ruby (I have this strong distaste for
using white space as a program structure indicator, and I prefer that my
indentation be done with tabs of width 3 rather than with spaces . I
know that using tabs this way doesn’t really cause Python problems, but
many people on the mailing list don’t seem to.) But, e.g., if I want to
use SDL, I can use apt-get to import all needed libraries for Python,
but Ruby… I was still working on getting all the pieces straight
after four hours. (I told you I wasn’t highly skilled.) Then turn to
the documentation. Pygame doesn’t have quite everything documented.
The english documentation of the RubySDL package nearly left me with the
C documentation of SDL (which I don’t know…I’ d prefer to use a higher
level language and then only optimize the parts that need it). And Rudl
doesn’t seem any better. (I think that Rubysdl is the appropriate
library. )

There are probably better ways to approach this, but I’m new, so I don’t
know them. And the correct (or at any rate, reasonable) approaches are
easier to find in Python.

A lot of this is probably because Ruby is more recent, and because the
primary focus of development is in Japan. But the result is the same
whatever the reason.

Another thing is this wonderfully promissing thing called Pyrex. This
is a purportedly nearly transparent interface between Python and C. It
looks like it makes interfacing so much easier than Swig [or hand
coding] that no comparison is reasonable. I haven’t yet tried it, so
this may be overblown, but appearantly you can write a file [or
routine??] that is a mix of Python and C, with automatic translation
between the pieces.

Another thing is distributable executables. Very important for many
purposes (though I haven’t needed this recently). Python has a
(somewhat clunky) way to do this called distutils. What does Ruby
have? (I mean by this that if Ruby has a library that can handle this,
then I don’t know about it…It’s not a serious question as I don’t have
any need right now.) Now it is true that the Python distributable
executables seem to be exe files, so they may only work on MSWindows,
but to many people that is the vitally important place to have it work.

Now these are just some lacunae that I have noticed. But that I have
noticed these seems to me to imply that there are many other areas that
would have similar gaps, because I don’t have a large acquantance with
Ruby. Nowhere near what I was hoping to have a year ago. Because I
couldn’t figure out how to use in in the projects that I was working on
in the time that was available. AND NONE OF THESE PROBLEMS IS
INTRINSIC! These are all library issues. (I didn’t mention the many
areas where I didn’t have any problem. That’s not the problem.)

···

---------- Forwarded message ----------

“Charles Hixsn” charleshixsn@earthlink.net wrote in message
news:3F380D28.1040002@earthlink.net

and I prefer that my
indentation be done with tabs of width 3 rather than with spaces .

A religous concept, but spaces are IMHO best when source is shared between
multiple developers.

Another thing is this wonderfully promissing thing called Pyrex. This
is a purportedly nearly transparent interface between Python and C. It
looks like it makes interfacing so much easier than Swig [or hand
coding] that no comparison is reasonable. I haven’t yet tried it, so
this may be overblown, but appearantly you can write a file [or
routine??] that is a mix of Python and C, with automatic translation
between the pieces.

How about Ruby inline?
http://www.ruby-talk.org/blade/50763

Mikkel

Well, I have “some” familiarity with Ruby and Python. Don’t brush off
his comments lightly if you want Ruby to be more popular. The only way
for Ruby to be more popular is for more people to use it. Which means
for more peopel who are currently unfamiliar with it to use it.

Actually, based on the comments by Anil, I would dismiss them almost
entirely out of hand. “Insufficient development” is – as we on this list
know – utter crap. Just because the Ruby community doesn’t generally “karma
whore” the way that the Perl and Python community does at /. doesn’t mean
that there’s slow or “insufficient” development. I mean, the claim that the
“best” web project is a WebObject/JSP/ASP “replacement” doesn’t recognise
that there are dozens of approaches to web development and doesn’t recognise
any of the outstanding projects out there (Amrita, Webrick, the various
wikis and blogs, Borges, etc.).

Further, the claim that Ruby took its syntax from Python and then added
Perlisms is utterly ludicrous. I personally find Ruby syntax nothing like
Python syntax, the latter being far less clear. It also suggests that the
writer has little experience with any OO language. His suggestion that Ruby
allows more obfuscated code is contrary to every experience that every
person who has actually done any development in Ruby.

Not only that, he ignores the (behind-the-times, but extant) JRuby in favour
of his Python/Jython preference. No, the author of this rant doesn’t know
anything about Ruby and it shows in spades.

In answer to Phil’s friend’s questions directly:

Does Ruby have…? / How strong is ruby in the area of…?

  • SOAP support

SOAP4R. It’s apparently as complete as most other SOAP implementations, but
as I don’t (yet) do SOAP, I can’t answer beyond that.

  • XML support

IMO, I didn’t “get” XML development until I started playing with REXML,
which speaks very highly of Sean’s concepts.

  • inline web page building like asp/php/jsp

Amrita, Eruby, various others.

  • database access

Reasonably complete.

  • application server type features for data caching, database connection
    pooling, session management ala j2ee/mod_perl/php

Various projects available.

Ruby has by far the best syntax of any language that I’ve encountered,
and for many purposes it’s semantics are as good as any. And it MAY
have good library support. But many libraries seem to be either
abandoned or only documented in Japanese (well, only adequately etc.).

Some libraries may also be “complete.”

[snip SDL stuff: I don’t know SDL]

Another thing is this wonderfully promissing thing called Pyrex. This is
a purportedly nearly transparent interface between Python and C. It
looks like it makes interfacing so much easier than Swig [or hand coding]
that no comparison is reasonable. I haven’t yet tried it, so this may be
overblown, but appearantly you can write a file [or routine??] that is a
mix of Python and C, with automatic translation between the pieces.

Beyond RubyInline, I think that something like Pyrex is needed in Python
because the C interface is nearly as ugly as that with Perl – or so I’m
told. Ruby has a very clean C interface, so such projects are less
necessary.

Another thing is distributable executables. Very important for many
purposes (though I haven’t needed this recently). Python has a (somewhat
clunky) way to do this called distutils. What does Ruby have? (I mean
by this that if Ruby has a library that can handle this, then I don’t
know about it…It’s not a serious question as I don’t have any need
right now.) Now it is true that the Python distributable executables
seem to be exe files, so they may only work on MSWindows, but to many
people that is the vitally important place to have it work.

Look into Exerb for Windows. There’s even a GUI for it now.

-austin

···

On Tue, 12 Aug 2003 06:39:57 +0900, Charles Hixsn wrote:

austin ziegler * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.08.12
* 11.40.12

Just curious why you would think that. A tab can be be equivalent to any number of spaces, per the reader’s preference. Spaces force the reader to accept your idea of proper indentation.

···

On Tue, 12 Aug 2003 08:00:12 +0900 “MikkelFJ” mikkelfj-anti-spam@bigfoot.com wrote:

“Charles Hixsn” charleshixsn@earthlink.net wrote in message
news:3F380D28.1040002@earthlink.net

and I prefer that my
indentation be done with tabs of width 3 rather than with spaces .

A religous concept, but spaces are IMHO best when source is shared between
multiple developers.

Austin Ziegler wrote:

Well, I have “some” familiarity with Ruby and Python. Don’t brush off
his comments lightly if you want Ruby to be more popular. The only way
for Ruby to be more popular is for more people to use it. Which means
for more peopel who are currently unfamiliar with it to use it.

Actually, based on the comments by Anil, I would dismiss them almost
entirely out of hand. “Insufficient development” is – as we on this list
know – utter crap. Just because the Ruby community doesn’t generally “karma
whore” the way that the Perl and Python community does at /. doesn’t mean
that there’s slow or “insufficient” development. I mean, the claim that the
“best” web project is a WebObject/JSP/ASP “replacement” doesn’t recognise
that there are dozens of approaches to web development and doesn’t recognise
any of the outstanding projects out there (Amrita, Webrick, the various
wikis and blogs, Borges, etc.).

Further, the claim that Ruby took its syntax from Python and then added
Perlisms is utterly ludicrous. I personally find Ruby syntax nothing like
Python syntax, the latter being far less clear. It also suggests that the
writer has little experience with any OO language. His suggestion that Ruby
allows more obfuscated code is contrary to every experience that every
person who has actually done any development in Ruby.

Not only that, he ignores the (behind-the-times, but extant) JRuby in favour
of his Python/Jython preference. No, the author of this rant doesn’t know
anything about Ruby and it shows in spades.

In answer to Phil’s friend’s questions directly:

Does Ruby have…? / How strong is ruby in the area of…?

  • SOAP support

SOAP4R. It’s apparently as complete as most other SOAP implementations, but
as I don’t (yet) do SOAP, I can’t answer beyond that.

  • XML support

IMO, I didn’t “get” XML development until I started playing with REXML,
which speaks very highly of Sean’s concepts.

  • inline web page building like asp/php/jsp

Amrita, Eruby, various others.

  • database access

Reasonably complete.

  • application server type features for data caching, database connection
    pooling, session management ala j2ee/mod_perl/php

Various projects available.

Ruby has by far the best syntax of any language that I’ve encountered,
and for many purposes it’s semantics are as good as any. And it MAY
have good library support. But many libraries seem to be either
abandoned or only documented in Japanese (well, only adequately etc.).

Some libraries may also be “complete.”

[snip SDL stuff: I don’t know SDL]

Another thing is this wonderfully promissing thing called Pyrex. This is
a purportedly nearly transparent interface between Python and C. It
looks like it makes interfacing so much easier than Swig [or hand coding]
that no comparison is reasonable. I haven’t yet tried it, so this may be
overblown, but appearantly you can write a file [or routine??] that is a
mix of Python and C, with automatic translation between the pieces.

Beyond RubyInline, I think that something like Pyrex is needed in Python
because the C interface is nearly as ugly as that with Perl – or so I’m
told. Ruby has a very clean C interface, so such projects are less
necessary.

Another thing is distributable executables. Very important for many
purposes (though I haven’t needed this recently). Python has a (somewhat
clunky) way to do this called distutils. What does Ruby have? (I mean
by this that if Ruby has a library that can handle this, then I don’t
know about it…It’s not a serious question as I don’t have any need
right now.) Now it is true that the Python distributable executables
seem to be exe files, so they may only work on MSWindows, but to many
people that is the vitally important place to have it work.

Look into Exerb for Windows. There’s even a GUI for it now.

-austin

austin ziegler * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.08.12
* 11.40.12

It sounds like the problems I had last time (about 8 months ago) may be
largely resolved. (I know that some of the web pages that gave me grief
have been redesigned…that’s promissing.)

Also promissing is the documentation that I found for
RubyGtk2/RubyGnome. It’s nearly what it needs to be, and is more than
sufficient for many purposes. (Last time I checked the documentation
for bit map handling wasn’t in, but that’s clearly not one of the things
that one would work on earlier.) And just today on LinuxToday there was
the announcement of a new release.

I will need to look up RubyInline. Two references to it in answer to my
not-really-a-question are a very strong pointer. I may not need it now,
but knowing that it exists could allow me to consider Ruby for projects
when it would otherwise be inconceivable. (Back after checking the
references…) That looks very nice, but it doesn’t LOOK to be in the
same ballpark as Pyrex. Again, though, I haven’t tried, or yet had
reason to try, either approach. Certainly the coding approach taken at
http://www.ruby-talk.org/blade/50763 would be expected to slow things
down most remarkably. One can nearly always expect the translation
between a Ruby variable and a C variable to be the slow step of a
process. (OTOH, that code was created to demonstrate a relative
slowdown when certain things happened, so…)

The project that I’m currently planning would require getting access to
a byte-mapped representation of an XPM file, and I’m contemplating the
correct approach. A JIT module that was generated with an #include
for the xpm file would seem to be a quite reasonable approach, which
wouldn’t have (i.e., didn’t) occurred to me. I may be coming back to
this around a month from now.

···

On Tue, 12 Aug 2003 06:39:57 +0900, Charles Hixsn wrote:

Albert Wagner alwagner@tcac.net writes:

A religous concept, but spaces are IMHO best when source is shared between
multiple developers.

Just curious why you would think that. A tab can be be equivalent
to any number of spaces, per the reader’s preference. Spaces force
the reader to accept your idea of proper indentation.

Because tabs can vary widely, and indenting that looks reasonable on
your system with tabs set to 3 spaces looks like crap on mine, where
it’s set to 8. As you point out, tabs can be set to display at any
number of spaces, but if people don’t actually do that (and my
experience is that most people don’t, but YMMV) then all the theory in
the world won’t make ugly code non-ugly.

Whereas if you use spaces, it looks the same in everybody’s editor, no
matter what that might be. Unless they’re using proportional fonts of
course, but that’s evil, and you shouldn’t accomodate evil.

-=Eric

P.S.: Please wrap your own lines (~72 characters is good); it’s hard
to read when it wraps around at random places, depending on the
width of my newsreader.

···

On Tue, 12 Aug 2003 08:00:12 +0900 > “MikkelFJ” mikkelfj-anti-spam@bigfoot.com wrote:

Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
– Blair Houghton.

“Albert Wagner” alwagner@tcac.net wrote in message
news:20030811184028.6a1197ee.alwagner@tcac.net

A religous concept, but spaces are IMHO best when source is shared
between
multiple developers.

Just curious why you would think that. A tab can be be equivalent to any
number of spaces, per the reader’s preference. Spaces force the reader to
accept your idea of proper indentation.

Eric already answered the most important reason.

If you want to reformat with spaces you can sometimes use autoformatting
features
of editors, or you can do a regular expression search replace /^\s\s/ to
/^\s\s\s/ for example (or even to tabs if you like).
So you don’t really loose anything by using space but up front spaces print
nice in all editors.
You can’t avoid the occasional space in indentation so tabs generally only
work for one specific width.

I tend to use either two or four spaces - in Ruby I tend to use only two
spaces.
Using three spaces makes it difficult to quickly add a new level between two
other levels. And again this is also difficult if I had been using tabs.

Typically have my editor set to autoexpand tabs to 4 spaces so I can either
tab or hit space twice.

Please don’t flame - as I said this is a religous issue - I have just
augmented my view upon request.

Mikkel

> P.S.: Please wrap your own lines (~72 characters is good); it's hard > to read when it wraps around at random places, depending on the > width of my newsreader.

Sorry, I have been installing/swapping mail readers and didn’t notice. It should wrap at 72 now.

···

On Tue, 12 Aug 2003 09:00:32 +0900 Eric Schwartz emschwar@pobox.com wrote:

MikkelFJ wrote:

I tend to use either two or four spaces - in Ruby I tend to use only two
spaces.
Using three spaces makes it difficult to quickly add a new level between two
other levels. And again this is also difficult if I had been using tabs.

Typically have my editor set to autoexpand tabs to 4 spaces so I can either
tab or hit space twice.

Please don’t flame - as I said this is a religous issue - I have just
augmented my view upon request.

Mikkel

For me a three space wide tab makes the indentation v. obvious. I like
that. I also like, if the nesting starts getting too deep, being able
to alter the indentation by only changing one value (the amount to
indent with each tab) in the editor preferences.

Now I will grant you that one should try to avoid nesting things deeply
enough to need to do that. But sometimes it happens to me. I
generally refuse to use editors that convert tabs to spaces. The two
aren’t equivalent, and sometimes, especially in strings, they are
extremely distinct, and serve vastly different purposes. E.g., when I
write a CSV file, I use tabs for separators, and have commas a
legitimate internal character. (I also don’t use quotes around string
valued fields. I find things easier to read and to parse that way.)

But the point is, in Ruby I can do this without worrying that I might
change the meaning of the program. I really dislike not having that
certainty in Python.