User: Password:
Subscribe / Log in / New account

The next generation of Python programmers

The next generation of Python programmers

Posted May 1, 2014 19:20 UTC (Thu) by smorrow (guest, #95721)
In reply to: The next generation of Python programmers by pr1268
Parent article: The next generation of Python programmers

Shell script has the same one-line, boilerplateless "hello world" that Python people seem to think makes their language the best. But in a Python script you're combining together library functions, that have to be *learned*, whereas in a shell script you're combining together programs that you *already knew*, from using the computer interactively. Plus you already knew a subset of the shell's grammar, from using it interactively.

In fact, that's where scripting got its name from: a shell script is a transcript of the commands you would've typed if you'd been sitting at a terminal using the computer in the normal, interactive way. So the computer is an actor replaying your "script". For this reason, I'm not even sure that Python/Perl/Ruby type languages should even be called scripting languages. They're interpreted, but that alone doesn't make them scripts.

If you're going to make people use a language whose objects must specifically be learned, you ought to go all the way and teach them C/C++/Go. Which are closer to Python than to (what I've seen of) Java in terms of how much needless boilerplate you've got. And they can use the shell to write programs that basically amount to combining existing programs together, and the aforementioned general-purpose langs for when they need to write a brand new program.

All of the above points seem valid to me, but I've got to say, in a world where Bourne-derived shells are all that's generally available, I still feel weird advocating the shell as the first language for beginners. An rc- or es-derived shell would be better for the syntax alone, but then they've also gotten rid of the "$@" voodoo and $IFS and so on.

(Log in to post comments)

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds