Fog Creek Software
Discussion Board

Good resources for learning programming?

My apologies in advance if this post is off-topic. Since that other guy got away with a shameless self-promotion, I figured this would be acceptable.

I am a teenager interested in learning programming. I signed up for an AP Computer Science class this year and after six weeks, we aren't very far beyond "Hello World", and the teacher seems to know C++ syntax but so far he has given no demonstration that he knows how to write a non-trivial program. I'm afraid he'll give me a bad grade if I ask questions.

Anyway, I was wondering if I should just stick to what everyone is learning (C++, Java) or should I learn languages used more commonly in academia (LISP comes to mind)? How important is math?

What are some good books to learn? Is it possible to teach oneself through books and trial and error? What are some good websites?

Any answers are appreciated.

Warren Henning
Monday, October 15, 2001

Don't bother with LISP or scheme.  If you want to get a job writing application software it won't matter.  You'll of course need to know what a "functional" programming language is, but they'll have a class on this when you get to college.

For now, I would suggest learning Perl really well.  (C++ and Java are also very important, but most of your college classes will be using those languages, and most likely none will use Perl).  You'll find that by knowing Perl, you'll be able to write the small kinds of programs that you need in college (web apps, utilities, help desk stuff).

Of course, it all depends on what *you* want to do.  But when I got to college, I didn't know a thing about computers or programming.  I decided I wanted to and got a job at the computer help desk and taught myself Perl.  Pretty soon, I was writing CGI scripts and creating cool web programs and professors and administrators really liked those sorts of apps.  They are quick and usually one-offs.  Perl is certainly practical and useful in college, and you most likely won't learn it in school.  I met a lot of people and made some great contacts by having that bit of practical knowledge.

Also get a linux box, and install X on it, and learn all about window managers and all the crazy shell tricks and editors.  Thats something else they don't teach you in class - how to use vi or emacs.

Michael Pryor
Monday, October 15, 2001

I'd agree pretty much with Michael's advice, and add on a few things.

1) Learn all you can about UI design. Read Joel's book (most of which is on this site) and a few other UI design books. It won't help you build your resume, or help you get better grades, but it will help you do your job better. Almost every app has an interface, and it's what your users really care about.

For practice, you'll want to get something like Visual Basic for your platform of choice. I'm a self-described VB nut, but you might try Delphi on Linux now, or Dreamweaver for web apps. Start building interfaces and small apps with it.  Building UIs by hand is painful, especially when you're trying to experiment.

2) You'll end up taking a lot of funky math on the way to a CS degree that you'll probably rarely use after graduation. But every once in a while the theory comes in handy.

Dave Rothgery
Monday, October 15, 2001

The knowledge required to become a top programmer/developer is just lying around.  Most programmers are just to lazy or arrogant to pick it up and learn.

Keeping an open mind and being curious is very important. Just asking this question on the Joel site is a very good indication that you already possess this learning capability.

How to learn more? Reading a couple of books from the geniuses in this world is a good start. Make sure you read Code Complete by Steve McConnell to learn fast how to code. GUI Bloopers by Johnson and Joel's User Interface Design for Programmers are good books to learn how to create GUI's. This aspect is way too often often neglected. IF you want to learn about how software teams work read Peopleware by DeMarco.

The second recommendation is: just do it. Don't be too theoretical. It's no fun to do theoretical stuff for weeks. Nothing more satisfying than the dragging a button on a form adding an event to the button to change a label to Hello World in 2 minutes, hit the compile button and seeing your first GUI in action. Get your teeth in developing software right away, make many mistakes and learn. Making mistakes is one of the best ways to learn as long as you learn from them.

I recommend a development environment which provides results fast and is powerful like Delphi. It has the ease of Visual Basic combined with the strength of C++. You can download a personal version for free from the Borland web site: If you have Linux running, get the Kylix which is Delphi for Linux. If you want to learn Java get JBuilder from the same site. Forget about line compilers they make you inefficient.

If you want to create dynamic web pages. Learn PHP and read "PHP and MYSQL Web Development" by Welling and Thomson. You can download and install the Apache web server, PHP and MYSQL database for free. It will work both on Windows and on Linux web servers.

If you want to make money as a programmer learn either Java or C/C++, forget about LISP or Scheme. There is a reason nobody uses these thingies to create real world applications. They are far too theoretical and take away the fun. And having fun is what life is all about.

Jan Derk
Tuesday, October 16, 2001

It seems that Lisp and Scheme are getting a pretty bad rap in this discussion.  It's true that they don't enjoy the same commercial success of C/C++ and Java, but they are indeed used in real-world applications.  Just take a look at Emacs, a large majority of it is written in ELisp. 

Actually, one of the best (programming) classes I took in College was taught completely in Lisp.  Lisp, Scheme, and functional programming in general causes you to approach problems in a completely different way, which will prove to be a valuable experience when faced with real-world problems.

Chap Lovejoy
Tuesday, October 16, 2001

Jan Derk: "I recommend a development environment which provides results fast and is powerful like Delphi. It has the ease of Visual Basic combined with the strength of C++"

You could also take a look at PB/DLL from PowerBasic, the fastest Basic compiler on earth. You can build dependency-free Windows apps that are as small or smaller than Delphi or C. Pretty cheap too. It's marketed as an add-on to VB to build DLLs (hence the name), but it also lets you build .EXEs:


Frederic Faure
Tuesday, October 16, 2001

>How important is math?

It's unimportant (in my experience, and speaking as a math graduate); arithmetic is good; I read once that the mental skills that let you be a mathematician are similar to those which let you be a programmer, maybe that's why (e.g. before they taught computing at school) companies would hire mathematicians and train them.

> Is it possible to teach oneself through books and trial and error?

I think those are necessary. Are they sufficient? In addition, at least: a goal (a particular program to be written); a gain (a reason for writing it, eg for learning or fun or money); tools (a computer); a community, for feedback etc. (peers, or something like a newsgroup rather than a Web site).

> What are some good books to learn?

Below are some of the books that I've read.

Code Complete

Effective C++

More Effective C++

Thinking in C++

Large Scale C++ Software Construction

Advanced C++

Estimating Software Costs (I skimmed this one)


About Face

SQL Puzzles and Answers (I skimmed this one)

Understanding the Professional Programmer

Zen of Code Optimization

Java Developer's Reference (I browsed this one)

TCP/IP Illustrated (volume 1)

Rapid Development

The Deadline

SQL For Smarties

Pattern Languages of Programming (4 volumes)

Design Patterns

Christopher Wells
Wednesday, October 17, 2001

> Is it possible to teach oneself
> through books and trial and error?

I've been a successful programmer for 12 years and I'm almost entirely self-taught.  I did take the occasional programming course in high school and college but learned very little new information from them.
Anybody who enjoys thinking for themselves and solving complicated problems will be good at programming, with or without a formal education.

Shawn Yarbrough
Wednesday, October 17, 2001

Duh, I totally forgot... LEARN SQL.
Its simple and it will pay off big time.  Play around with MySQL or even oracle (i think they have a cheap or free developer version).

I don't think many CS programs actually teach you SQL.

Michael Pryor
Wednesday, October 17, 2001

Well, enough SQL to get by is simple; figuring out the nuances of complex query design and the extensions of $Database_Server_Vendor is far from simple, especially since SQL performs very badly if you try and treat it like a procedural language.

If, as an undergrad, I had known how much of my time would be devoted to building database front-ends (whether in VB or ASP/VBScript), I definitely would have taken the databases class that sounded boring...

Dave Rothgery
Wednesday, October 17, 2001

While I agreed with most of the advices above, I would like to add some of my observations.

If you are new to programming, you need to pick up something that will keep you interested to keep on going.

This is why a lot of people dislike Lisp, Scheme. It's just plain difficult for some teenagers to install these in their win98 boxes (let alone using the emacs-like runtime to run their code). Well this goes back to what Joel used to advocate : please take the time to write some a installation program and a decent 1990's editor where people can figure out 70% of the features with a mouse.

Web page scripting and perl fall good into this category for beginners since they are easy to setup,  fun to play with and you see the result instantly.

But no, you are just getting your hands dirty. There are so many "golden rules" that you can hardly learn by playing with those "practical" languages.

There are so many to unlearn when I first picked up Structure and Interpretation of Computer Programs. From data abstraction, OO design, callback fuctions, modulation to compiler design! It covers almost 80% of what I need to know to become a good programmer.

But then, it was written with MIT students as their target audiance. So no, there is no "step by step" guide (let alone screen shot) to teach you how to setup your environment to write and run your program. You have no clue as to how to run the hello world equivalent of scheme [(+ 1 2) , that is]

While I must say that it's way more fun for a teenage to pick up a "Teach yourself Visual Basic in 24 Hours" than to read SICP. There are so much he/she is missing.

Friday, October 19, 2001

People have mentioned the "pain" of languages like Lisp and Scheme.  Those people underestimate far too much.  But judge for yourself:

Also, there is a very elegant "Dr. Scheme," which runs under all the main platforms (Win, Mac, Unix/X).  It has multiple levels depending on your experience level and is an all-around wonderful program.

You can use it with Structure and Interpretation of Computer Programs, a book that someone else mentioned:

I have to say that I don't understand the people who strongly dislike these non-C++ languages.  Computer languages are just notations that have interesting side-effects.  Don't let your mind be locked into one notation or method of thinking.

Friday, October 19, 2001

I think its mostly about attitude.  Writing code on the whole is not hard but sometimes I get the impression that CS students think getting a clean compile is a major win rather than the equivalent of putting your coat on to go out into a thunderstorm. 

Read code.  Read more code.  Critique code.  As to what kind of code you read?  Find an application that does something to a stream of data, tr srt, cat even.  Get the source and walk through it, chances are there won't be any comments worth reading so ignore any there are and treat the code as if you were the actual compiler. 

My examples imply C, but that's my own prejudices, the language really isn't important.

Take that example and do something with it, it doesn't much matter what. Subverting an old utility to do something else will get you into all of the major software development knots, learning how to untie them will stick with you.

Use all the system tools you can lay your hands on to debug, trace, watch and add performance probes.  Debugging is a major and basic skill.  Practicing with a straightforward utility will teach you all of the gubbins of what happens to code when its running without getiing into complicated abstractions like event handlers and such.

The books I used to recommend are all ancient now but I think still worth investing in.  Software Tools in (either C or Pascal) by Kernighan, The C Language, Kernighan & Ritchie (actually anything ever written by Ritchie, old Dr Dobbs columns etc), Proving Programs Correct by Robert B. Anderson. 

I wish you luck.

Simon Lucy
Friday, October 19, 2001

If you are just starting out, deciding what kind of software you want to write may be as important the as languages you use or the books you read.  You aren't getting paid for this, and projects taken on strictly for learning can be tedious. You need a project that you can get exited about, something that can begin small, but grow or lead to other things.

Games might fit the bill. When I got started 20 years ago that meant 6502 assembly language, but today you have all kinds of language options - Java, Delphi, Python, Flash, whatever. Just learn what you need as you need it. If you like the process of designing something and then dealing with all the details of making it work, you'll be on your way. College can fill in the gaps later, if you decide to go that route. You may even have learned enough that you'll find your CS classes dull, and decide to study english or history..


Scott McKissock
Saturday, October 20, 2001

*  Recent Topics

*  Fog Creek Home