May 2000

The New Programmer's Road Map: Scripting Languages

Python, the New Intro Language

The Python programming language is an interpreted type of language in that source code is not compiled into binary form. It is also the most recommended introductory language by many good sources (ESR among them) for several reasons. I have learned Python all the way up to creating a class and I admit, I liked it a lot. Some of the main reasons that Python is popular as a first language is that it is very forgiving and helpful about syntax errors when not used interactively. If used interactively it can be somewhat difficult. Python also has another interesting facet, it uses indentation to determine how statements are to be operated upon and does not have closing marks for statements, instead multi-line statements are marked like a multi line UNIX command with a backslash.

Another reason that Python is preferred as a starter programming (or scripting) language is that it has a great deal of built in capabilities. For instance, console I/O is extremely easy both ways, making things like I/O loops easy to write. What that means is one can learn some very handy techniques without doing a great deal of coding thus freeing up the learners mind to explore and be creative early on instead of memorizing a great deal of long programming to accomplish such techniques.

Finally, Python scales quite well as a learning tool goes. One can learn it at a basic procedural level and stretch all the way to the fundamentals of Object Oriented Programming (OOP) in a relatively short period of time. As a case in point, I will use myself since I really do believe if I can do it, anyone can. My first language was Perl (I did shell program before that), it took me three months before I could write a Perl program that could do something worthwhile and believe me, it was not object oriented. It was strictly "block level" programming. Next I learned C and C++ (sort of at once) and it took me about three months until I reached and mastered the basics of OOP in C++. With Python it took me one week. Now, granted, I already had the Perl, C and C++ experience, but I still believe that was fast.

So as you can see, Python is very good as a first language for the following reasons:

  • It is very forgiving
  • It has a great deal of good built ins (and modules)
  • It scales very well
  • It frees up the learners brain to focus more on techniques

Shell Scripting

Shell scripting is not just a great way to get a feel for programming but is an essential skill for UNIX power users (e.g programmers). Understanding shell scripting and the shell environment (whichever one you choose) is essential. I can guarantee it will come in handy someday. Shell scripting is basically putting UNIX commands in a file along with shell built in functions to do things (such as if iterations for example). Obviously you can already see the inherent advantage to learning it. I use shell scripts for maintaining file systems, log-files, sources and my own packaging. I also use them to rapidize packaging for large projects until I am ready to finish the Makefiles associated with them. In addition to the obvious benefits of learning shell scripting, there is also it's similarity to more procedural types of languages.

Shell scripting (and programming) is also a vague term because, there are many to choose from. Following is a short list of the ones I have seen (not necessarily scripted in):

  • sh - bourne shell
  • bash - bourne again shell
  • ksh - korn shell
  • csh - cshell
  • tcsh - an enhanced cshell
  • zsh - a sort of combination shell
  • ash - minimalist shell
  • sh-posix - the "posix compilant" shell

Final Notes

There are other languages out there for starting, however I honestly believe Python is the best starter language. Some readers recommended ADA or Pascal. I definitely do not agree with Pascal as a starter language - or for anything actually and I have never used ADA so naturally - I cannot recommend it either.

Next: More Programming Language Previous: Choosing an Editor & Primer