Python dos2unix one liner

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Sun Feb 28 03:03:12 CET 2010


On Sat, 27 Feb 2010 11:27:04 -0600, John Bokma wrote:

> When do people learn that a
> language is just a tool to do a job?

When do people learn that there are different sorts of tools? A 
professional wouldn't use a screwdriver when they need a hammer.

Perl has strengths: it can be *extremely* concise, regexes are optimized 
much more than in Python, and you can do some things as a one-liner short 
enough to use from the command line easily. Those are values, as seen by 
the millions of people who swear by Perl, but they are not Python's 
values.

If you want something which can make fine cuts in metal, you would use a 
hacksaw, not a keyhole saw or a crosscut saw. If you want to cut through 
an three foot tree truck, you would use a ripsaw or a chainsaw, and not a 
hacksaw. If you want concise one-liners, you would use Perl, not Python, 
and if you want readable, self-documenting code, you're more likely to 
get it from Python than from Perl.

If every tool is the same, why aren't we all using VB? Or C, or 
Javascript, or SmallTalk, or Forth, or ... ? In the real world, all these 
languages have distinguishing characteristics and different strengths and 
weaknesses, which is why there are still people using PL/I and Cobol as 
well as people using Haskell and Lisp and Boo and PHP and D and ...

Languages are not just nebulous interchangeable "tools", they're tools 
for a particular job with particular strengths and weaknesses, and 
depending on what strengths you value and what weaknesses you dislike, 
some tools simply are better than other tools for certain tasks.



-- 
Steven



More information about the Python-list mailing list