views:

585

answers:

9

I want to teach myself to program. To give a little background, I have a history degree and my math skills are about the college algebra level (and probably on the lowish end of that). I'm looking for recommendations for books that teach how to think about programming, rather than focusing on a particular language. I've already determined that SICP is out of my league for now.

The two primary alternatives appear to be How to Design Programs and Concrete Abstractions. I'd be interested in hearing from anyone who has used either, or both, with specific discussion on why one might be preferable to the other. Also, if someone could recommend a basic course of study using freely available materials, that would be great. Something like: start with HtDP->SICP->?

Thanks for your time.

A: 

How about online resources a quick search on google ("How to be a programmer?") turns up good results e.g. http://samizdat.mines.edu/howto/HowToBeAProgrammer.html

SDX2000
Glancing over the topics will show that this collection of articles talks little about theory of programming, but rather mostly about character traits and habits of programmers. A good read, but not likely to solve Cena's problem.
Scottie T
I appreciate your taking the time to answer my question, but it doesn't really address what I'm asking; namely, comparative difference between 2 specific books.
Cena
+1  A: 

"How to think like a computer scientist" is a good open source book on programming in python. I find HTDP and SICP to be a little to academic.

A: 

This is not meant to be mean in any way, but if you wanted to learn how to ride a bike, would you start with a book on the elementary laws of physics (momentum, centripetal force, etc)? If you bought yourself a lego kit, would you start by reading books on the theory of masonry and construction?

I bet when you first started learning history, you didn't start with "how to learn history" - you read books about historical periods that fascinated you and moved you and got you thinking.

Instead of theoretical research, consider buying a book on Ruby, downloading the program, and experimenting with the language first. Understand the nuts-and-bolts of the language, how the elements seem to connect together. And then, after you've spent some time building simple programs, then read your theoretical books. Go back and forth between practice and theory.

Granted people are different, and not everyone is going to flourish using this technique. But I think that getting your hands dirty will make the concepts seem more clear than learning the concepts first.

johnbr
I appreciate what you're saying, but dont think the analogy holds. Ive attempted to do just that, with both Ruby and Python. I end up giving up in frustration because I dont understand what's going on.What Im finding with HtDP is that since I'm understanding the concepts better, I'm learning more.
Cena
@Cena Have you looked at the book "Dive Into Python" ?
elviejo
+2  A: 

I can't speak to Concrete Abstractions, but my introductory CS course my freshman year was taught in HtDP by one of the authors. I didn't much care for the text or the approach, but I think there was a reasonable mix of people who did. I will say that it encourages a number of good habits that will serve you well as a professional programmer - small methods, test first - and it's a reasonably gentle start.

You'll be learning a dialect of Scheme, which is in turn a dialect of Lisp, which as a language does not see much commercial use. It did not help me much with Java, which is very different in syntax and approach, but it's a good thinking tool to have under your belt, and will help you if and when you start to explore higher-level languages than Java.

In order to use it properly you'll need to download DrScheme, which will move you through several ever-more-complex learners' programming languages as you progress through the book.

Brian Guthrie
A: 

Always good to start with Hello World and learn more from there.

Chris Ballance
I think this is not how most people can learn to program. It doesn't give any insight into how computers work, nor is it by itself so rewarding ("Look honey, my computer says "Hello world!" ") that it can provide the motivation.For many (most?) newcomers, books or classes are IMHO better.
JDelage
@JDelage My point was that you should learn by doing. Learn how to do the most basic program in the new language such as "hello world" and then build from there, learning by doing. At least that's how my brain works.
Chris Ballance
Learning by doing works best if you're just a kid, when making a computer do something is magical in itself.
Jon Purdy
Chris Ballance
+1  A: 

I know this doesn't directly answer your question, but you might find my comment useful.

I have a background in T-SQL, C# and a bit of perl. Since 1996 I've worked as a DBA and a database developer and I'm keen to sharpen my programming skills. I can pick up any language reasonably quickly (except perl and assembly) but I am weak on design. So I picked up SICP and found it to be very steep and too focused on engineering/academia. I am now working through HtDP and find it to be great because there are many exercises to follow and the pace suits me perfectly. Obviously some books will suit you better than others, but when you have finished this book, you should be ready to learn any other language, be it python, C, Java, whatever.

Mark Allison
A: 

Buy a decent 'teach yourself' C++ book. I suggest C++ in 24 hours, it was what I used when I was learning.

No, you won't learn in 24 hours. Or 24 days. Possibly a bit 24 weeks, though, and 24 months will definitely get you on the right track.

The important thing is that you need a book that walks you through both how to program and how to program in your language. I recommend C or C++. "The C Programming Language" is the book on C; haven't read it though, so can't comment further...

Paul Nathan
A: 

In my opinion, there are three ways to become a good programmer:

  1. Through dedication and rigorous study of books and online materials;
  2. Doing it and playing with it until you understand it; or
  3. Being taught by a good programmer.

Option 1 works because you consciously force yourself to think like a programmer by solving problems that are given to you. Option 2 works because you are subconsciously conditioned to think like a programmer by solving problems that you yourself create. Option 3 works because really good programmers know how to explain programming to people in non-programming terms.

Sounds like you're going for Option 1. I went with Option 2 as a kid, and I think it's the best. Now I try to provide Option 3 to people when I can.

I believe that high-level languages such as Ruby, Python, and Java are uniquely bad as introductory languages. They lead people, at worst, to completely misunderstand or ignore how the machine actually works, and at best to forget that strings are hard.

Jon Purdy
A: 

There are many approaches to learn how to program. Some opt for what's currently being used in the market. I prefer to suggest an approach that'll teach you how to create programs that are structured, malleable and understandable. For that, start with SICP (get a used version to save some bucks). Obviously you won't get a job programming in Scheme or Lisp, but that's not the intention behind my recommendation. The idea is to learn the methodical thinking process that goes about breaking problems down and creating composable and maintainable solutions for them.

Once you work the bulk of the book, get an introductory book on either Python or Ruby. Work the main concepts (procedures, control structures.) At the same time, search for Bohm and Jacobini's "Structured Program Theory" and Jackson Structured Programming.

Notice that I've made no mention of object-orientation. The fact is that OO is excellent for analysis and implementation, but difficult for the design phase. Procedural, modular and structured programming are more tractable, and to be honest, it is extremely hard to learn and properly utilize object orientation without fully understanding structured, procedural and modular programming concepts.

Once you get that done, take a dive into C (use the good old Kerninghan and Ritchie's C Programming Language book.)

Once you get that done, then jump into Java or C# to your heart's content. Then, read this paper:

http://sdg.csail.mit.edu/pubs/2009/hoare-jsp-3-29-09.pdf

As a real-world Java developer, I would find it unconscionable to suggest anyone who is serious about learning how to program to start with Java or C#. They are a great tool for work, but not a great language for teaching (not unless the person already has substantial experience or exposure to procedural and structured programming.)

Even if it is done for leisure, programming is a lot more than coding with a marketable language. You want to develop lessons and habits that will help you program cleanly and efficiently in any language. I strongly suggest you follow the outline I presented here. Good luck.

luis.espinal