Study Fundamentals,
Not API's, Tools nor OSes

Advice from an experienced professional on how to become a better programmer.

Mike Crawford

Mike Crawford
Consulting Software Engineer
mike@soggywizards.com

August 26, 2000

Copyright © 2000 Michael D. Crawford. All Rights Reserved.

I posted the following to Slashdot, a news and discussion forum for the open source community ("News for Nerds. Stuff that Matters"), as a comment in a discussion about Coding Classes & Required Development Environments.

My post is a reply to a comment by Slashdot user adrien entitled teaching "programs" versus teaching "thought".

The original article poster was upset because he was required in a programming class to do all of his work using Metrowerks Codewarrior for Windows, when he would prefer to write using GCC running on Debian Linux.

In my discussion below I decry the plethora of API's and toolsets that a programmer must know these days to keep up in the work world (it seems there is no end to the buzzwords that appear in job and contract listings), and advise that a better course of action is to study fundamental concepts that will serve you well on any project.

Now, you certainly do have to learn API's to get your work done - I suggest simply learning enough to do a job and then move on. Don't invest in learning a particular API or toolset, invest in improving your core programming skills.

(Note that I consider a mark of good design in an API the fact that one can do a lot of useful work with it without knowing the whole thing. For over a year I got a lot of mileage using only STL deque and a couple of its member functions, and I was able to start exploiting the STL to great effect in my programs after just learning a few more things, even though understanding the entire STL is a huge undertaking. The ability to take just a little and leave the rest is not a property of most API's I encounter.)

Modern Operating Systems cover

Modern Operating Systems (2nd Edition)

by Andrew Tanenbaum

[ Buy at Amazon]
[ Buy at Powell's]

And note that while I don't advocate learning a particular OS in great detail (unless you're actually developing one), I do advocate learning the fundamentals of operating systems, so you can understand what they all have in common, what is different between each kind, and what each kind's strengths and weaknesses are. So learn how processes, virtual memory, threads, semaphores, interprocess communication and networking work - on all systems.

In the era of low-cost and free operating systems and large hard drives, there's no reason you can't run at least three operating systems on a Pentium class computer, as I do on my Compaq laptop - Windows NT, BeOS, and Slackware Linux. Pretty soon I'm going to be adding QNX to the mix.

If you don't believe I know what I'm talking about, that this strategy can benefit you too, maybe you ought to have a look at my resume.

Study Fundamentals Not API's, Tools or OSes (Score:4, Insightful)
by goingware (mike@soggywizards.com) on Saturday August 26, @07:39AM EST (#826501)
( User #85213 Info) http://soggywizards.com

I heartily agree.

I'd further like to say that I think everyone should spend less time concentrating on learning specific API's in great detail, and instead focus on improving your core skills and fundamental understanding of programming.

Algorithms in C cover

Algorithms in C, Parts 1-5 (Bundle)
Fundamentals, Data Structures, Sorting, Searching, and Graph Algorithms (3rd Edition)

by Robert Sedgewick

[ Buy at Amazon]
[ Buy at Powell's]

I used to spend a lot of time learning API's (bought every volume of Inside Macintosh as they came out, and when I was just starting out and broke and hungry, used to read them in the bookstore before I could afford to buy them).

I prided myself on knowing all the little bugs and intricacies of the MacOS so I could just know to code around an OS bug without having to research why my code didn't work. I got so good that I was hired as an OS engineer at Apple where I concentrated on debugging the MacOS system software with MacsBug (a machine level debugger) - I had the MacOS source code at my disposal but that usually didn't help when I was visiting a tester's cubicle to diagnose a machine with a hard-to-reproduce crash.

Then I moved to the BeOS, shipped a product and wrote a lot of code but got fed up with their lack of commitment to their developers. And without getting paid to write BeOS code, I never could keep up with the BeOS API's I wanted to work with, like the new Media Kit (which I do know enough about to say it is pretty cool).

A couple years back I stopped spending much time learning and mostly just cranked out routine code. I felt I didn't want to learn anymore because, as I would sometimes say:

I feel that if I have to learn another API my head will surely explode.

Ever since I read C++ Answers from Bjarne Stroustrup I got the gumption to start learning again. What I decided to do was go back to learning the basics.

Effective C++ cover

Effective C++: 50 Specific Ways to Improve Your Programs and Design (2nd Edition)

by Scott Meyers

[ Buy at Amazon]
[ Buy at Powell's]

I read Scott Meyers' Effective C++ and More Effective C++ and as I read through each item I inspected my program top to bottom and applied the advice to it (thus fixing a lot of bugs).

I also bought Bjarne Stroustrup's The C++ Programming Language: Special Edition (I recommend the special edition to professional programmers).

I started reading the newsgroups comp.lang.c++, comp.lang.c++.moderated and comp.std.c++ and posting questions there - in one case I found a construction on the very edge of the C++ standard and as a result of a compiler bug managed to instantiate an object of an abstract base class - its pure virtual function had a nil pointer in the vtbl and my program would crash when this function was called. An engineer from the compiler vendor read my post on the newsgroup, agreed that it was a bug that his product would compile my code, and logged a bug.

The C++ Programming Language Special Edition cover

The C++ Programming Language (Special 3rd Edition)

by Bjarne Stroustrup

[ Buy at Amazon]
[ Buy at Powell's]

I didn't used to use the Standard Template Library very much at all. I had read too many mailing list and newsgroup postings from people whose code wouldn't compile when they changed platforms.

But I figured that by now compilers must have matured enough I could reasonably start trying out the STL. I bought STL Tutorial and Reference Guide by Musser and Stepanov and actually only read a little bit of it before I realized that the STL is actually really easy to use (the API is very simple and uniform), so if you know only a very little bit you can go a very long way.

In part because of challenging myself I became overwhelmed with programming stuckness as discussed in Overcomming Programmer's Block? (sic) and I suppose grew a little bit by taking a week off without pay to rest, contemplate, study and take a broader view of architectural issues.

STL Tutorial and Reference Guide cover

STL Tutorial and Reference Guide
C++ Programming with the Standard Template Library (2nd Edition)

by David R. Musser, Gillmer J. Derge and Atul Saini

[ Buy at Amazon]
[ Buy at Powell's]

One thing that helped quite a bit was learning about Extreme Programming.

These things have all had direct payoff in my code, both in making my code quicker to write, easier to debug, easier to make my classes more reusable within the one program I've been writing the last few months, and I'm pretty sure more likely to make some of the code I've written reusable in most any program in the future.

It's also made it a lot more pleasant.

But don't listen to the headhunters - what they're looking for is "skill sets" and industry buzzwords (COM, COM+, DCOM, TCP/IP, Visual C++, ASP, SQL, device drivers, CORBA, Unix internals, Java, Perl, PHP, JSP) - I get recruiter calls looking for all kinds of acronyms, most of which I don't mention anywhere on my resume.

Even I advise listing every skill keyword you can legimately claim on your online resume in Market Yourself - Tips for High-Tech Consultants - but while listing skillsets may be a valuable jobhunting tool in your resume, acquiring them should not be your focus.

More Effective C++ cover

More Effective C++
35 New Ways to Improve Your Programs and Designs

by Scott Meyers

[ Buy]

By the way, when someone asks me whether they should learn Java or C++, I usually advise beginners to learn Java as it's easier to get something working reliably without crashing, but emphasize they should learn both languages as well as at least one kind of assembly code. I stress that it's important to learn both C++ and Java well enough to understand the strengths and weaknesses of each (pop quiz - why does Optimizeit claim to remove memory leaks from Java programs, when Java is a garbage collected language?).

Most new programmers these days are most concerned with which language will make them the most money the fastest. I tell them that they won't go anywhere until they can pick up any new programming language as a matter of course and have at least a couple under their belt.

I've got bad news for you neophytes - friends, just knowing a programming language doesn't win you very much in the work world, you have to understand the concepts and how to apply them, and you have to know how to apply them in a production environment, working in a business under pressure, shipping working products and dealing with people who don't understand anything of substance about computers.

Help Spread the Word!

Please encourage others to read this article by linking to it from your website, weblog or from message boards.

Your focus should be on acquiring skills that will be applicable to any program you write. You should just learn enough of a skill or tool to get the job done and then leave it. Take with you what can be applied anywhere.

BTW - learning the fundamentals and not getting too specialized enables you to develop for any platform, as I do - you can see this from my homepage. (Perhaps one reason why I prefer understanding the fundamentals is that my degree is in Physics, and I've always wanted to understand things at a fundamental level - Quantum Mechanics, Particle Physics, Cosmology and so on.)

Computer-Related Risks cover

Computer-Related Risks

by Peter G. Neumann

[ Buy at Amazon]
[ Buy at Powell's]

One final word of advice - read The Forum on Risks to the Public in Computers and Related Systems. It's often entertaining and funny, occassionally tragic, usually insightful and will make you a more responsible programmer and a wiser computer user. You'll certainly learn to avoid using computers for anything of real importance and take extra caution to protect yourself when you choose to do so.

Michael D. Crawford

Make a Bonfire of Your Reputations

One Must Not Trifle With Wizards For It Makes Us Soggy And Hard To Light