Hacker News new | comments | show | ask | jobs | submit login

The only way to learn how to program is to just do it. Pick a language. Start with small programs. Learn the features and syntax of the language. When you feel you know the language well enough to write a program that uses most of its features, then pick an open source program and learn its code. Make some modifications to it. When you feel you're pretty comfortable in one language, pick a new language.

Rinse repeat. You'll find that once you have one language down, the process will go much faster with the second. The features and syntax of most languages are pretty similar.

You can pick any language you like to start with, but personally I'd recommend starting with a hard typed compiled language rather than a dynamic language. Dynamic languages are easy to learn, but its easy to be a lazy and bad programmer in them. They let you get away with too much. Hard typed compiled languages are a) much better at catching your errors and b) much harder to be a lazy programmer in. They don't let you get away with things nearly as much.

I'd recommend Java, seems to be the language a lot of people start with. It will also give you a good founding in open source programming. I started with C/C++ and I'm glad I did. But that was more of a challenge - had to learn pointers and memory management in my first language. And after that I took a little while to learn the open source mindset, since I'd started in a procedural language.

Once you have a good grasp of an object oriented language like Java (or Python) and what object oriented programming means, then I'd recommend reading the Gang of Four book on Design Patterns (http://www.amazon.com/Design-Patterns-Elements-Reusable-Obje...) and Martin Fowler's book on Refactoring (http://www.amazon.com/Refactoring-Improving-Design-Existing-...). Those will give you a pretty good basis in software design and maintenance.

In terms of recommended reading for learning a language, the O'Reilly books are nearly always good in my experience. Here's one for Java (Learning Java: http://www.amazon.com/Learning-Java-Patrick-Niemeyer/dp/0596...) and here's one for Python (Learning Python: http://www.amazon.com/Learning-Python-Powerful-Object-Orient...)

Amazing. No Google search led me to an answer this helpful. Thank you for your input on languages also...it seems there is quite a debate between Java and Python.

Python's a good language, but it's a soft-typed interpreted language. Which means it will let you get away with certain things.

It is also has some differences in syntax from a lot of other languages that might give you some trouble when you switch. C/C++, Java, PHP, Perl, Javascript and many other languages share a lot of common syntax. Python's still really similar, but it deviates in some key ways.

It also tends to have really hard core adherents who will swear by it above and over anything else, which is why there is something of a debate. It really doesn't matter that much what language you start with.

One of the keys to being a good programmer is knowing your toolbox. And that includes knowing multiple languages. The best programmers don't have one favorite language. Rather they have a toolbox of a half a dozen or more, and they pick the best language for the task at hand.

"...it will let you get away with certain things..."

...like reading what she just typed in? Yes. Python will let her "get away" with reading her code. ;-)

Here's a link to the Beginners Guide to Python...


I disagree with starting with Java. Rather I second coffeemug's advice in the following comment, focus on C, Lisp, and Haskell:


My first manager taught me something college had failed to (or that I failed to learn there), which is that programming languages come and go in trends, but they are all based on recurring fundamental concepts, which endure beyond any single language.

Most new programming languages are a remix or mashup of some or all of these concepts, so if you master those concepts you'll be able to easily pick up any other language.

It's like learning Latin as your first foreign language, and being able to quickly pick up any Latin-based language after that. C, Lisp, and Haskell are the Latin of the CS world.

Since you're at MIT, take the famous Structure & Interpretation of Computer Programs (used to be 6.001, not sure if it still is). http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussma.... That'll get you started with Lisp (specifically the Scheme dialect).

For C, start with K&R (http://en.wikipedia.org/wiki/The_C_Programming_Language_(boo...).

For Haskell, Real World Haskell is good, and the e-version is free. (http://book.realworldhaskell.org/)

Joel Spolsky has an article worth reading on why not Java:


And of course PG's essays on Lisp are a must read:


Since it sounds like you're running a business you may feel pressured to learn Java or whatever your coders are currently using to get your business off the ground. But I heartily recommend resisting that pressure, doing it right, and mastering the enduring fundamentals first. It may cost you something in immediacy and expedience, but that's what school is for, especially one such as MIT. You should carefully weigh how you spend your time there, and unless you think you've got the next Facebook, focus on mastering the enduring concepts, not the trends. You'll be glad you did the rest of your life and career.

PS - there's little to nothing that Clojure (a Lisp dialect on the JVM) and Haskell can't do in the web space, so the cost in immediacy and expedience is slim to none anyway.

PPS - it didn't register till just now that you're an Econ Major not going into CS or Software Engineering as a career. If you just want a tried-and-true, versatile, easy-to-get-started-with language with tons of libraries and frameworks (reusable code) to hack in, huge and helpful community go with Python. Java is too bureaucratic a language for this purpose.

Start with Zed Shaw's excellent introduction, Learn Python the Hard Way (hard way = by doing lots of follow-along examples until it gets into your brain muscle memory), then go from there.


Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact