Dougal Campbell's geek ramblings

WordPress, web development, and world domination.

Back to Basics

Over on Simon’s site, I ran across a link to a 2001 article where Joel Spolsky takes us Back to Basics in an essay about how high-level programming languages can lead us down the path to poor performance.

Today I want to think about CPUs. A little bit of silicon moving bytes around. Pretend you are a beginning programmer. Tear away all that knowledge you’ve built up about programming, software, management, and get back to the lowest level Von Neumann fundamental stuff. Wipe J2EE out of your mind for a moment. Think Bytes.

I also had to agree with this bit near the end:

These are all things that require you to think about bytes, and they affect the big top-level decisions we make in all kinds of architecture and strategy. This is why my view of teaching is that first year CS students need to start at the basics, using C and building their way up from the CPU. I am actually physically disgusted that so many computer science programs think that Java is a good introductory language, because it’s “easy” and you don’t get confused with all that boring string/malloc stuff but you can learn cool OOP stuff which will make your big programs ever so modular. This is a pedagogical disaster waiting to happen.

A couple of years ago, my wife was working towards her master’s, and needed to take some introductory programming classes. When I found out that they were using Java for these classes, I was dumbfounded. Java is a horrible language for teaching beginning-level programming! Even though it resembles C in syntax, it adds additional layers of abstraction (classes, objects) that are going to be hard to understand without a previous grounding in the fundamental elements of computer programming: data structures and algorithms.

I’ve had formal coursework in Pascal, Fortran, COBOL, and 8086 assembly. I’ve taught myself BASIC, C, Perl, 6809 assembly, and a smattering of other languages, some mainstream, others obscure/specialty, some that I’ve used extensively, and others that I’ve just tinkered with. But whether your programming language of choice is procedural, functional, or OOP, software design still boils down to data structures and algorithms. So it’s best to start with a programming language that exposes those concepts in a simple, accessible manner. Joel suggests C, but I think Pascal is a really good choice, too. For one thing, it was designed from the get-go as a teaching language (side-note: There were cross-platform P-code interpreters long before there was a Java Virtual Machine). Once you get the basics under your belt, then you can move on to higher levels of abstraction.

Or in some cases, move on to lower levels, because I wouldn’t suggest assembly language for a beginner, either. 🙂

And as I commented on Joel’s site, this is not to imply that I’m anti-Java. Far from it. Java is a great language for developing applications. It’s just not a great first language for beginning programmers.

About Dougal Campbell

Dougal is a web developer, and a "Developer Emeritus" for the WordPress platform. When he's not coding PHP, Perl, CSS, JavaScript, or whatnot, he spends time with his wife, three children, a dog, and a cat in their Atlanta area home.
This entry was posted in Tech and tagged , , . Bookmark the permalink.

4 Responses to Back to Basics

  1. I completely agree that Java is a poor language for beginner programmers. It’s taught at my University and the number of people now in their second or even third year who are still terrified of writing actual code is pretty terrifying. In my opinion a big part of this is that they have only been taught Java, which has a very high barrier to acvtually doing useful things.

    I’ve never used Pascal but I’ve done a lor with Python and it seems to me to be an ideal first language – it has a nice learning curve and while it supports full OOP it’s possible to start being productive with it without even knowing what an object is.

  2. Dougal says:

    I almost mentioned Python, but I must gotten distracted before I finished editing the post. I haven’t had a chance to really dig into Python yet (even though I bought two of the first Python books to hit the market, several years ago), but from what I know, it would be a good learning language. Perl would also be moderately good. I say ‘moderately’ because a beginner could get confused by Perl’s variable type indicators. For example, you refer to an array as a whole like @myarray, but you refer to individual elements like $myarray[5].

  3. Suze says:

    Actually being the aforementioned “wife” in the post, I most strongly agree with the sentiment expressed here. While I was fortunate enough to have a great instructor, Java was to say the least, perplexing. I found the language completely unenjoyable, and think I would’ve been more enthusiastic if I understood more of the basics without jumping into “instantiating” my big toe from day one. Further, at the time when I took the course, there were very few “textbooks” on teaching Java, and IMHO, the Dietel & Dietel book for the course was awful! I learned more by going to Barnes & Noble and picking up the “Sam’s Teach Yourself Java…” book.

  4. TechGnome says:

    I agree as well, a lower level language should be used for introduction, not one that has such an abstraction as Java. It’s nice and all, but then the student doesn’t get the benefit of WHY the abstration is so nice (ie, it hides all the nity grity details.) While going through technical training for the Air Force, one of the languages we had to learn was Assembler. While I have since long forgotten everything I learned, the basics of it stayed with me such that I now know how to code tighter to squeeze out a few extra instructions per second. It may not sound like much when we talk of the speeds of today’s computers, but when dealing with potentially millions of records, every little bit helps.

    Learning several languages has certainly helped me to appreciate what my VB IDE does for me these days. I’d go nuts if I ever had to go bac to MFC.


Leave a Reply

%d bloggers like this: