On Computers

Start Programming

Jack 'daWabbit' Imsdahl, jack@oncomputers.info

20 July 2003

Making your computer do what you want it to in the manner you want it to is satisfying and fun, as anyone who has conquered a computer problem successfully will attest. At least at the first, that's the attraction in programming. I first started my little adventures in coding because my friends and I could not afford to buy or could not find software to do tricky and complex repetitive math necessary to design of internal combustion engines we were fooling with as a hobby. 

Later on, should you progress far enough, you can make a handsome living programming. Of course, you'll have to develop more skills than I have, but that's another story.

I must confess at the start of this that I am simply not much of a programmer. I do try. (Lord, how I try!) Despite my best efforts, though, I have never achieved any real skill at it, probably because I can't devote enough time to learning and using what I have learned. That which I have done is for the most part rough work (and I'm being generous when I say that). But it did what we needed and so was good enough.

Given that; it's fair to ask why I am taking it upon myself to write about computer programming? Well, because I can. I've already done most of this research for myself, over the last few years, and want to share what I've found out about it with you. What follows is information that has come up in the #icug chat room, many times, and things I've found out for myself or learned from those I've asked.

This is by no means complete. Even a cursory examination of the subject in full would require a very large book.

What Language Should I Learn?

There is an incredible span of languages in which one can program computers. Many are specific to one sort of application (SQL, etc.) or one operating system family (Visual Basic from Microsoft is one) and some are general purpose, such as C++, Python, Java. Some are compiled into code the machines can use at the time of authoring while others are interpreted on the fly, meaning as they are executed. More than a few can be used either way. Some computer programming languages are obscure in syntax and form while some read almost like plain text.

There are languages available in Integrated Development Environments (IDEs) that facilitate rapid development of an application once their use is mastered. Many such IDEs are available for a number of languages and not tied to a single language. Most languages can be used in the simplest of environments. Most languages can be used in a simple text editor like Notepad and the output compiled or simply transferred to the machine from there. And there are all sorts of intermediate levels of environment for programming, too. Tools for programming in many (if not most) languages can be obtained without cost. This includes compilers, editors, tutorials and reference works.

In the past, many people learned to program in BASIC or QBasic (which came with various versions of Windows). BASIC and variations on it worked and met a lot of needs, but it also has some real shortcomings (which might even be considered faults) and is no longer thought of as a good starter language, or even as a language worth pursuing (according to many I've spoken with). I still have loads of QBasic code I wrote for specialist applications around here and am slowly transitioning it to Python, as need and available time dictate. (Most of it was written to automate common and repetitive math work from a very simple command line interface.)

Code written in BASIC is not terribly portable, meaning that if I write it on one type of machine (say a Windows box) it will likely not run as well (or at all) on a Mac or Linux machine. Yes, these platforms do support forms of BASIC, but there are enough differences between the versions so as to commonly cause problems. This is the reason I'm converting the things I wrote to Python. Python runs nearly everywhere. So does Java, for that matter. There are other languages which are highly "portable", too. 

I spoke to several professional programmers, as well as teachers at local community colleges and Universities here in Texas about which is a good (note I did not say 'right' or 'best') language to start off learning to program in. Almost without exception, they answered either "Java" or "Python". Python came out slightly ahead in my informal survey, though the results were so close as to indicate that if I had talked to a larger number of people, it could have gone either way. 

Their reasoning follows:

#1) Java and Python are highly portable. This means you can use the skills you learn and the applications you write nearly everywhere. Binaries exist to run applications written in either language on nearly any computer platform and certainly on all those used on the desktop by us common folks. This feature was intentional in the design of the languages and is considered one of their best selling points. The slogan "write once, run anywhere" is not quite absolutely factual, but it is very nearly so and applies to Windows, GNU/Linux, Macintosh OS X and various Unices. Occasionally, allowances will have to be made for the various platforms, but not very often and these seem to occur most often in graphic applications. (My one GUI math program wouldn't run on Linux until I rewrote it. Now it runs on Windows and at least several flavors of GNU/Linux, interchangeably.)

One instructor I spoke with taught Java, but would rather teach Microsoft's Visual Basic. His opinion is based on the fact that Windows so predominates in desktop usage, which he considers makes most languages not proprietary to Microsoft and Windows irrelevant (his stated exception to this being C/C++). Neither I nor anyone else I spoke with shared this opinion. I'm already up against portability issues with my little amateur applications and needing to run them on Debian GNU/Linux. I'll not make that mistake again. The Java and Python languages are being updated and extended constantly and there is little likelihood they will disappear or become less relevant any time soon. And who knows what we'll all be running in the future, as far as operating systems go? I do not wish to be wedded to any one platform any more than I am now, if I have a choice about it.

#2) Java and Python can serve so many uses. Either one can be used in developing CGI code (Common Gateway Interface, used in web design) GUI (Graphic User Interface) and command line applications, free-standing applications and routines inserted into other applications. It's not that these languages can do everything. Indeed, no language is that universally applicable. But they can do a lot. In my little researches, I found several professional programmers who use Java and Python every day in their work. Certainly they can accommodate any new programmer's needs. You don't start out writing office suites or dynamic models for research, after all, though when I said that, one of my respondents told me these could be done in either language, though other languages were more suited to the job.

Both languages are widely described as being 'powerful', meaning they can do a lot of things, such as program a graphic environment or do higher level mathematics. (There are limits on math in both languages, but I do not know enough mathematics to approach them and so don't know how to describe them. I'm one of those "if it weren't for calculators and computers" types when it comes to serious math.)

#3) Large repositories of high quality free code exist. This keeps a programmer from having to reinvent the wheel, so to speak. Should you need a routine to determine (for example) whether or not a number is a prime, you can find the code on line and freely incorporate it into your work.

#4) Python and Java encourage good programming practices. Python and Java are "object oriented languages" and quite determinedly modular. This means that in learning them, you come up well suited to learn other languages and good practices in them. Mastering the terminology and methodology of programming in either will see you through to good utilization of other languages, should you decide to learn them at some point in the future. 

(As an aside; I've been repeatedly told by those who seem to know that once you've learned one language, learning additional ones is very much less trouble. This provided only that the languages involved do not use obscure and/or unique syntaxes.)

#5) Java and Python use syntax and terminology not too far removed from everyday english speech. This is a generalization, but not too damning a one. I have found it easier to learn as far as I have due to this, though, and was pleased that nearly everyone I spoke with confirmed my impression.

#6) Java, Python and related tools necessary to learn them are free of charge and freely available. Even with massive student discounts, proprietary languages and IDEs like Microsoft's Visual Basic and Visual Studio.Net or Borland's Jbuilder are expensive. We all pretty much agreed that there is no sense in spending money until you at least know some programming and whether or not you'd like to continue doing it. By then, you'll also have the knowledge to better assess your needs.

I could find no compelling case for any other languages as the first to learn. Java gets all the hype, nowadays, but Python is at least as good a choice and several of my respondents said Python is just a bit easier due to there being less choices regarding ways to accomplish different tasks. This, by the way, is why Perl was nearly universally disparaged as a first language among those I talked to. In Perl, as in some other languages, there are myriad ways to accomplish many tasks and this makes it less suitable for new programmers because there is so much more to keep straight in one's head.

It should also be said that neither Java nor Python is particularly resource thrifty. Code written in them will run just a bit more slowly than that written in some other languages because the interpretation of commands necessary takes up some cpu cycles. Don't let this worry you. The amount of computer power available today makes this less than serious. Does it really matter if your program takes 1.5 seconds to deliver an answer to an equation instead of 0.9 seconds? You can worry about speed later, after you learn to code workable apps.

Other than portability and possible cost, there does not appear to be any compelling reason not to learn a proprietary language, such as Microsoft Visual Basic or Borland's Delphi (which is available in a free "personal edition" at the Borland site listed below) or Borland's Kylix, which is Delphi for Linux (and currently available in a free version). They do as much as Java or Python does. Perhaps more. (I simply can't judge that one.) Should you be willing to be wedded to one family of operating systems, they are good choices. There are also some free tutorials and other resources (such as code libraries) for both languages. Performance of applications written in either language is perfectly satisfactory, too. In fact, my favorite Windows HTML editor, Matrix Y2K, is written in Delphi and my favorite text editor for Windows, Notespad32, is also. I've used and been perfectly satisfied with many Visual Basic applications, as well.

How Do I Begin?

Should you type "Java + tutorial" or "Python + tutorial" into Google's search engine, you'll be rewarded with a huge return from which to choose. I've listed a few below, including the ones I am using or have used. There are so many more that my list can only be considered a sample. 

User groups and forums abound and are for the most part filled with folks willing to be helpful and generous with their knowledge. Sun maintains an active developer community where newbies seem to be quite welcome and there are tons of unofficial sites. Python shares the same sort of large resource base, though they are more scattered as there is no one company driving it as Sun does with Java.

Rather than settle on one tutorial or resource, I ended up downloading a boatload of them and putting them on the computer which displays at my bedside, where I can read them in a leisurely fashion. I've about standardized on one tutorial to go through from start to finish, but find it a huge advantage to read from the others to clarify things as I go along. Every computer in the house, here, has the Java SDK and Python binaries installed on it, so I can play/work at whichever I find myself seated. 

There are also many good books available, but I recommend holding off buying anything at all until you've explored the subject in enough detail that you're sure you want to invest more time in it, much less money. The selection and descriptions at O'Reilly are particularly instructive. I'll post a link below.

Editors and development environments for either Java or Python are available as freeware all over the web. In Python, I mostly use IDLE, which comes with it, though I more and more tend to use Crimson Editor in Windows and Jext in Linux as they have syntax highlighting and error reporting more to my liking (a purely personal choice) which cuts down on my (inevitable) mistakes. Whatever you think you need as far as a work environment goes is available.

So; I've made my case for which languages to begin with and below you'll find a lot of links to various resources. Here's hoping you find programming as rewarding as I have (and it really is rewarding, even at my level) and useful, to boot! 

I've concentrated on Windows resources because that's what most of us run. Also, Linux distributions come with all sorts of developer tools and many more are available, so it seemed less necessary to post many of those.

Note; All links were functional as of morning, 19 July, 03

 

How to Think Like a Computer Scientist
Learning with Python
by Allen B. Downey, Jeffrey Elkner and Chris Meyers

How to Think Like a Computer Scientist
Java Version
by Allen B. Downey

Both at; http://ibiblio.org/obp/thinkCS/cpp.php along with similar texts on C++ (for you masochists who insist on starting with one of the most difficult languages to master) and Logo versions.

Python Bibliotheca (all free)
http://www.ibiblio.org/obp/pyBiblio/

Check out Live Wires courses, too
http://www.livewires.org.uk/python/

O'Reilly and Associates
Check out their resource centers, especially. These are maintained for a large number of programming languages.
http://www.oreilly.com/


Python;
http://www.python.org

Python for the Mac OS X
http://homepages.cwi.nl/~jack/macpython.html


Python & Perl at Active State
http://www.activestate.com/
Large selection of free and proprietary products. Of course, being the cheapskate I am, I'm only concerned with the free ones, here.

Some think Active State's Active Python is slightly superior to the "official" version. The difference is in execution only, as the binaries conform to each other closely in matters of standardization.

Python Snippets and Resources;

Vaults of Parnassus
http://www.vex.net/parnassus/

Python Game Developer Resources
Somewhat advanced, but very interesting and informative
http://pygame.org/
Java;
http://java.sun.com/

Java Linux
http://www.blackdown.org/

Java Snippets and resources;
Sun Java Tutorial;
http://java.sun.com/docs/books/tutorial/

Java Boutique;
http://javaboutique.internet.com/

JavaWorld
http://www.javaworld.com/

Collection of Java Programming Resources:
http://www.apl.jhu.edu/~hall/java/

Freeware Java Applets
http://www.freewarejava.com/

Borland Delphi
http://www.borland.com/delphi/index.html

Borland Kylix
http://www.borland.com/kylix/index.html

Jade IDE for Java
http://wkurz.com/

JawaBeginner IDE (no, that's not a mis-spelling)
http://www.pivotonic.com/

Crimson Editor
A very good editor with syntax highlighting for many languages and more coming all the time. Runs on Windows only.
http://www.crimsoneditor.com/

Jack

© 2003 Jack Imsdahl

Back • Home • Up • Next


© 2002 - 2004 by On Computers and the Videotex Services Coalition.