[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: script languages



On Wed, Aug 02, 2006 at 07:09:30PM -0700, charles norwood wrote:
} On Wed, 2006-08-02 at 08:14 -0400, Roberto C. Sanchez wrote:
} > On Wed, Aug 02, 2006 at 08:37:13AM -0300, chiappa@oi.com.br wrote:
} > > Hello,
} > > 
} > > I need to write several scripts for file manipulation, for example:
} > > change name files, read specific columns and write them in a new file,
} > > call fortan programs to read these files, etc. Because I have to learn
} > > how to do this, I wonder what scrip language is better: Perl or Phyton?
} > > or another one? (no flame war please!)
} > > 
} > > Thanks in advance
} > 
} > My view is that you can likely accomplish what you want with bash
} > scripting and some command line tools.  However, if you want to learn
} > another language (which I think is always a good idea), then consider
} > Python.
[...]
} > Additionally, Python
} > makes it difficult to write bad code.  That is, you must actively try to
} > write bad code (assuming you already have knowledge of sound software
} > development practices).  On the other hand, while Perl is also very
} > powerful, it makes it hard to good code.  That is, even if you have
} > knowledge of good software development practices, it is very easy to
} > write unreadable and unmaintainable code in Perl.
[...]
} > Regards,
} > -Roberto
} 
} I don't know Python, but I agree with Roberto about Perl.  It is easy,
} even encouraged, to write unstructured code in Perl.  On the other hand,
} it provides quick, compact solutions to common scripting problems.

I know enough about Perl to hate it, for the same reasons I hate Visual
Basic: the language itself, as well as the culture surrounding it,
encourages godawful code. You can write good code in almost any language
(Intercal may be an exception), and you can write bad code in any language
("You can write Fortran in any language"), but some language encourage
better code than others. Python actually encourages pretty good code, but I
find semantically significant whitespace vaguely offensive.

Now, pure Bourne shell scripting (no, not bash) is a good thing to know
regardless, for much the same reason that vi is good to know: it's
available essentially everywhere. I think it is also sufficient to the
tasks listed above.

For tasks that demand more than that, however, I am fond of Ruby. It
encourages quality of code at nearly the same level as Python while being
remarkably readable even to the uninitiated. There are very few surprises
in the language itself, and there is a rich community of helpful people and
available code libraries. It's gotten a lot of hype recently due to Rails,
but it is an excellent scripting language in its own right.

--Greg



Reply to: