Re: bash vs. python scripts - which one is better?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/09/07 12:19, Steve Lamb wrote:
Manon Metten wrote:
Well, I find Perl easier to understand. The problem may be with some
programmers who don't know how to write readable code... Now, the thing
I really hate concerning python is that it is sensitive to indentation;
this means that some operations like copy-paste or inserting a loop can
easily destroy code. And "diff -b" or "diff -w" can't be used reliably.

Well, that's a major disadvantage to me too.

Actually, it isn't. At no time have I ever had any problems with Python
code which would not also be an issue in other code as well. The only
difference being you have to be careful about indention in one case, braces in
the other. Besides, let's face it, if there is a person who puts code into
place and then doesn't make the indention make sense to ensure they did the
job properly is that someone who's opinion we're going to trust when it comes
to decent coding practices? Most people are going to make the indention match
*anyway*. Since pretty much every programmer's editor comes with de/indent a
block of text there is no problem.

Just remember to tell you editor to "inserts spaces as tab" and set
the tab width to something reasonable like 4.

- --
Ron Johnson, Jr.
Jefferson LA USA

Give a man a fish, and he eats for a day.
Hit him with a fish, and he goes away for good!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGu1TRS9HxQb37XmcRAhLsAJ9jaJ+/CsXhjkiATKufjrJcUB1T+ACg3rPP
tJLPLTlCgvVtnsxumbRUXiM=
=4+Bb
-----END PGP SIGNATURE-----


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: Python/C and PYTHONPATH
    ... A co-worker once called me "obsessive" about indention. ... Then it's not a bad little snippet. ... If you're writing a big program for which the python ... it seems that someone already posted a cleaner fix than ...
    (comp.lang.python)
  • Python intention (Was: bash vs. python scripts - which one is better?)
    ... I chose 4 spaces because that is the standard of the Python community. ... Also you don't have to worry about indention as slavishly as in Fortran ... Significant indention does not apply inside statements or declarations. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: bash vs. python scripts - which one is better?
    ... I really hate concerning python is that it is sensitive to indentation; ... At no time have I ever had any problems with Python ... place and then doesn't make the indention make sense to ensure they did the ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: alternatives to making blocks like { } or other ??
    ... Blocks in Python are defined not with but rather ... with indention. ... HTH, Larry Bates ... > def sth: ...
    (comp.lang.python)
  • Re: bash vs. python scripts - which one is better?
    ... Because to some Perl is horrible compared to Python. ... Correct me if I'm wrong but wouldn't I just end up with with a bunch of ... Give a man a fish, and he eats for a day. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)