Live data from Hacker News

How can I learn to program?

news.ycombinator.com

1–10 of 77 posts

How can I learn to program?

#1
I am in my early twenties and am seriously considering a career in entrepreneurship. I have a partner and we are in the midst of entering our business idea into numerous entrepreneurship contests. We have met with several business and tech professors and have been thoroughly encouraged to pursue this. The only problem? Neither of us know any code. One of our business coaches, a successful entrepreneur himself, suggested that the programming can be done with little problems -that there is still much utility in two idea boys. However, to be truly successful, it has occurred to me that we will need to know the ins and outs of programming. Perhaps we won't need to be experts, but a successful leader must be well versed in every aspect of his company. Does everyone agree? Can anyone make some recommendations about where I should get started learning code and the strategies to keep in mind while doing so? Help is much appreciated.

Re: How can I learn to program?

#2
You could probably get away with not knowing how to code, but even an elementary understanding helps you to know what is and isn't possible. Spend a week or two getting the fundamentals of programming (even if you won't be able to program very well at the end of that time), and you'll be in a much better place.

Try Mark Pilgrim's Dive Into Python. It's free online, and python is one of the better introductory languages: http://diveintopython.org/toc/index.html

Aside from that, search stackoverflow for variations of your question - it's been answered lots before!

Re: How can I learn to program?

#4
If you're starting from the very beginning, learn a good text editor. (Editing is such a huge part of programming and has so many other payoffs that it is a very good first step.)

Use a forgiving and simple language like Python, and ideally an operating system where the tools you need are already installed.

Learn the documentation systems for your language of choice. For instance, in Python, you can go to http://www.python.org, run the command-line "pydoc" tool, and use the "help" function in an interactive session.

Use things like StackOverflow and Google (i.e. learn how to find answers and ask questions). These days, help isn't too far away.

Choose some programming goal, even that goal is something arbitrary like reading 20 lines of a text file and printing all the words that start with A. Make yourself write programs that achieve arbitrary goals so that you're satisfied with how well you're learning the language. Do this for a few weeks before you attempt anything remotely related to the "real" reason you learned programming.

Re: How can I learn to program?

#5
I wonder if my site can help you. It is intended as a online tutor designed for programmers preparing for job interviews but I think you'd find the find the practice problems, in-depth tutorials and the video lectures (coming soon) helpful once you get a bit of programming experience.

If you happen to try it out, I can answer any programming questions you may have, give you tips, feedback, etc.

Check it out at:

http://blueberrytree.ws

Re: How can I learn to program?

#7
A friend of mine is in the same boat. I forwarded him all the usual suspects, from "Why's Poignant Guide to Ruby", to "Learn Python the Hard Way", to "The Schemer's Guide". But none quite worked for him. He finally found and settled on Harvard's intro CS course, CS50:

https://www.cs50.net/

Re: How can I learn to program?

#8

You could probably get away with not knowing how to code, but even an elementary understanding helps you to know what is and isn't possible. Spend a week or two getting the fundamentals of programming (even if you won't be able to program very well at the end of that time), and you'll be in a much better place. Try Mark Pilgrim's Dive Into Python. It's free online, and python is one of the better introductory languag…

>> Try Mark Pilgrim's Dive Into Python.

I have to disagree with the book choice - for this case. The first sentence on the main site for the book[1]:

>> Dive Into Python is a Python book for experienced programmers.

It might be a great book, but not for someone who knows nothing about programming.

[1] http://diveintopython.org/

Re: How can I learn to program?

#9

You could probably get away with not knowing how to code, but even an elementary understanding helps you to know what is and isn't possible. Spend a week or two getting the fundamentals of programming (even if you won't be able to program very well at the end of that time), and you'll be in a much better place. Try Mark Pilgrim's Dive Into Python. It's free online, and python is one of the better introductory languag…

>> Try Mark Pilgrim's Dive Into Python. I have to disagree with the book choice - for this case. The first sentence on the main site for the book[1]: >> Dive Into Python is a Python book for experienced programmers. It might be a great book, but not for someone who knows nothing about programming. [1] http://diveintopython.org/

True, my mistake ... I've done a python class at school and consider myself a beginner, so I never noticed the split. What book would you recommend instead?

Re: How can I learn to program?

#10
Set up a Linux computer (Ubuntu Linux is the easiest to set up), and spend the summer learning to program in Python.

Here are some of the best online Python tutorials, including a link to videos and course material for MIT's introductory computer science course, which uses Python: http://www.quora.com/How-can-I-learn-to-program-in-Python/an...

Build something that you want to use so it will be meaningful to you. Do you have a blog? That's usually a good first exercise. It's easy to do using Flask -- follow the tutorial (http://flask.pocoo.org/docs/).

Here are some tips to get you started:

Use Emacs as the text editor to write your code -- it usually comes pre-installed on Ubuntu, and it has a Python mode. Here are some Emacs tutorials (there are some good videos on YouTube too):

http://philip.greenspun.com/teaching/manuals/usermanual/emac... http://www2.lib.uchicago.edu/keith/tcl-course/emacs-tutorial... http://www.gnu.org/software/emacs/tour/ http://cmgm.stanford.edu/classes/unix/emacs.html

Use PostgreSQL as your database. To install it on Ubuntu, use this command:

$ sudo apt-get install postgresql

Use SQLAlchemy (http://www.sqlalchemy.org/) to connect your Python website to PostgreSQL.

Here's a good SQL tutorial: http://philip.greenspun.com/sql/

When you build a blog, you don't have to worry about building a public authentication and comment system if you use something like Disqus (http://disqus.com/) -- you just include the Disqus JavaScript tag at the bottom of the blog's entry page.

Here are some good JavaScript tutorials: http://www.quora.com/What-are-good-books-preferably-found-on...

Use StackOverflow to ask programming questions: http://stackoverflow.com/

Post reply on HN