On 21/04/2007, at 2:27 PM, Rafael Bejarano wrote:
I suspected as much--that counting spaces might get tedious, that
is. For my own programs, at least, I've found that one space is
sufficient. So, for example, if I write a function, I indent the
lines in the body
by one space, if I have conditional (if) or loop (while)
structures in the function I indent by two spaces, etc. In light of
the ease of programming in python, I've decided to continue on, at
least for the time being.
Rafael
Well, go for it then, I guess. As I said, though, if you ever end up
distributing your programs, or reading anyone elses and this
*includes* modules which, believe me, you'll end up using before very
long, everyone else uses 4. In other words, everything inside, say, a
class is indented 4 spaces. The code of a function inside that class
is indented 8. A loop inside that function is indented 12. Gah!!!
I've seen as much as 16 or 20. *that* is tedious. As I said, if I'd
stuck to Python, I was going to have to investigate some kind of
applescript system for counting spaces. I still might, since I still
occasionally work with Python myself, and if I ever do, I'll be sure
to post my findings to the group. As it is, though, I've switched to
Ruby for my own programming work. It's about as easy to read as
Python without most of the mess and madness that is Perl, and indent
is not significant.
Not to mention the fact that, even if it was, the standard in Ruby
seems to be *2* spaces, a much more useful thing.