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

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



On 2007-08-09 10:19:51 -0700, Steve Lamb wrote:
>     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.

Braces are not a problem: they are kept in a copy-paste, and if for
some reason a brace is missing (because you did a mistake), then you'll
get a syntax error (at least in Perl, where braces are mandatory).
In Python, you may need to re-indent (correctly!) all what you've
copy-pasted, and if you forget an indentation, the syntax will still
be valid.

> 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?

In languages like Perl, the indentation can automatically be done by
the editor (and checked by the developer in real time), and after a
copy-paste, the indentation can be fixed automatically, without any
ambiguity.

> 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.

If you need to paste code from web pages (that could be mailing-list
archives, for instance), whitespace can have already changed by
generic tools.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)



Reply to: