Re: bash vs. python scripts - which one is better?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 08/18/07 21:33, Douglas A. Tutty wrote:
[snip]
>
> I guess a problem is the lack of definition of 'clean coding'. I don't
> consider one-liners as clean code. Terse yes but they lack the visual
> flow that I need when I need to revamp code a year later. One-liners
> are more of a challenge to do in python since indentation has an impact
> on syntax.
>
> As for which language is best, the answer is none. Any language can
> probably do anything, but for any problem one may be easier than
> another. It will likely be the one you are more generally good at. I
> find sh to be more cryptic than python so I turn to it sooner, which
> leads over time to me becoming more and more comfortable with python.
> So for problems that are best solved with some disposable code, it comes
> down to in which language in which you produce functional code the fastest
> and easiest.
While I write lots of bash code, I don't have lots of .sh files
hanging around $HOME, but there are lots of .py files.
Anything I *know* is one-off I try to do in bash (usually making my
xterm very wide!), whereas stuff that I'll be doing repetitively
(even if not frequently) gets written in python.
> Perhaps the OP can restate his needs and we can help him make a reasoned
> choice without it becoming a religious issue.
- --
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)
iD8DBQFGx66QS9HxQb37XmcRAlOZAJ4ryFWnomJ2k9797gBuCGqW9mN1LQCcDsLk
TF4aIgaKZb+9mE+gPpQOcEE=
=HzxP
-----END PGP SIGNATURE-----
Reply to: