
How can I learn to program?  - rocamboleh
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.
======
espeed
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...](http://www.quora.com/How-can-I-learn-to-program-in-
Python/answer/James-Thornton)

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://philip.greenspun.com/teaching/manuals/usermanual/emacs.html)
[http://www2.lib.uchicago.edu/keith/tcl-course/emacs-
tutorial...](http://www2.lib.uchicago.edu/keith/tcl-course/emacs-
tutorial.html) <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...](http://www.quora.com/What-are-good-books-
preferably-found-online-for-free-like-eloquent-javascript-for-learning-
javascript)

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

~~~
rudiger
I agree with most of your points, except...

Use gedit as your text editor. It's the default GUI text editor in the Ubuntu
operating system, and works well enough for programming, and is significantly
easier than Emacs for someone just starting out programming.

I'd also suggest MySQL instead of PostgreSQL, for the same reasons (works well
enough, significantly easier for beginners).

~~~
forkandwait
Postgres is no harder than MySQL, except _maybe_ to set up; plus, postgres
wont bite you in the ass down the road due to the plethora of reasons that
make MySQL a pretty lame solution these days.

On the other hand, MBA types will have heard of MySQL -- that might be an
advantage, of a sort.

------
Todd
First off, keep things simple. Don't dive into Linux, Emacs/VIM, etc. right
away if you don't already know them. Your goal is to learn programming.

Next, you probably have an idea about where you want to be with your business.
Is it mobile? Is it web? I'll assume the latter, because even if it's the
former, you're going to need both eventually.

Even though it's not programming, you need to know HTML/CSS. Start there, even
though it's not programming. You can get your feet wet editing and you can add
programming shortly.

Start with a simple but capable editor. If you're on Windows, start with
Komodo Edit or Notepad++. On Mac, something like TextMate. You can always
'upgrade' to Emacs/VIM later.

Once you're comfortable with basic HTML, you'll probably want to make it do
things. You can start with JavaScript. This makes programming exercises simple
and quick. Just refresh the page.

Once you decide you need a bigger challenge, then a larger world of choices
becomes available: what server side language (Python and C# are two options),
what server (Linux is pretty standard), what web server (Apache or Nginx are
good), what database (Postgres, MySQL, MongoDB, etc...) are some of the many
choices to be made.

I would first survey the above and decide what you think you might need, then
pick the language based on that. Let's say you pick Python. Start playing with
it from the command line or with your editor like you did with HTML. Once you
understand the basics, then pick a web framework (like Django) and start
making it produce the HTML that you now understand.

It's a stepwise process. The goal is to pick off small, achievable pieces, and
then use them to build something more substantial. The core of it all, though,
is programming. Programming is how you make the gears turn the way you want
them to. Eventually, everything will start making sense and you'll just add to
your repertoire as the needs arise.

------
makecheck
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.

~~~
eru
Also, get a mentor, and some like minded people to share code reviews with.

And not only write code, but also read code.

And debugging is actually a more useful skill than writing new code, and comes
in handy far more often. It also tends to be more painful. But where there's
mud, there's brass.

------
michaelfairley
<http://learnpythonthehardway.org/>

------
ThomPete
As someone who started out last summer I can tell you what I did.

I am quite a lot older than you and I have a child, a company and a girlfriend
to manage, so you can probably pick it up much faster than me. Basically I
have been forced to take an hour here and an hour there, sometimes more.

I have worked on it a while now but <http://www.blueskycouncil.com> is my idea
of a idea generation website. still lot's of little mistakes but again it was
actually having a goal in mind that helped me know how far in the process I
was.

So here is what I have done.

1\. Sign up for Lynda.com

2\. Watch php/mysql for beginners twice, just to get an understanding of the
scope that I am about to venture into.

3\. Start programming with an idea in mind.

4\. Use IRC, StackOverflow and friends

That should take you plenty of the way.

I can also recommend reading books like Code Complete to get a sense of some
of the programming issues and paradigms to think of.

------
SkyMarshal
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/>

~~~
grantlmiller
This is the route that I went... it starts at the beginning a teaches a lot of
simple principles of programming. David Malan is engaging & fun to learn from,
you can even follow along in real time (during fall & spring & interact with
other people taking the classes remotely). I followed up with www.cs75.tv to
learn some additional PHP, SQL, XML, CSS. I've been a marketing/product/seo/pr
guy for 8 years and taking these courses have provided me with a much deeper
understanding and appreciation of what the limitations and capabilities are.
This has been invaluable when working with talented programmers who at least
appreciate that I'm interested enough in what they're doing to learn the
basics myself... sort of a mutual respect thing.

------
chromejs10
Following what other people said.. Python is a great (and powerful) language
to get started with. It is what we teach our CS110 class at my University.
Honestly, get a Mac or, like espeed said, install linux. Learning bash is
invaluable. Also, learn HTML5/CSS. Every business needs a website, and with as
powerful as HTM5 is, you could get up a decent one with just those two things
(though javascript would be handy).

There are a ton of good resources online. Hacker News is awesome, Stack
Overflow, etc. Python has a nice and free online book to get you started.

Best of luck!

Oh, I agree with the need for a good editor. Emacs is great (of course others
will argue for VIM of course ;). Unless things have changed in the last
release, you'll have to install it yourself which is one of the reasons people
choose the lighter weight editor of VIM.

If you have a mac, I would suggest TextMate. I recently came across
SublimeText 2 which is currently in alpha stages but is really cool too! It is
cross platform so it will also work on Linux.

------
16s
Solve a specific real-world problem you have by writing a program to do it.
Start with Python or Ruby. Start on one platform (Windows, Mac, Linux). Start
small and get bigger by solving bigger problems as you progress.

Then, write a program that works on all major platforms with little or no
modifications. Learn C++ or C. Learn how to use a debugger, how to distribute
code to end-users, etc. While doing this, learn data structures, big O
notation and why they are important when you need to scale. Learn how to
handle threaded data safely and Unicode input too.

Just start coding ASAP to solve "real-world" problems (not book exercises),
the rest will come as you progress.

Edit: Spelling

~~~
steven_noble
+1 for actually answering the "how to learn" question rather than the "what
should I learn question".

To your comment "Solve a specific real-world problem" I would say +1, but add
that you should start by trying to solve the smallest possible specific real-
world problem that will create some sort of value for your customers.

And before you start, describe that problem using a testing tool like Cucumber
(cukes.info). This will ensure that all your early coding and learning is
completely focused on solving that one small problem.

Keeping reading, Googling and experimenting until you find you can write
enough code to solve that small customer problem. Then set your sights on a
slightly larger customer problem.

As for tools, I like and recommend Ruby on the Mac but there are a number of
options that seem to have lots of community support and free tutorials,
including Python and Perl, whether on the Mac or Linux.

------
a_bad_dream
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!

~~~
telemachos
>> 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/>

~~~
a_bad_dream
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?

------
will_lam
If you're interested in taking the Ruby on Rails route, you can check out
Chris Pine's book "Learn to Program" in Ruby.

Also there's HacketyHack, Rails for Zombies, CodeSchool.com.

Also there was an old HN thread that is very similar to your situation.
<http://news.ycombinator.com/item?id=2280070>

------
Stormbringer
On the one hand, I would say don't bother. Just chop up the task into small
bits and outsource them. There are programming equivalents of the logo design
contests, you can get the programming done very cheaply, and there are
business oriented non-programming guys having a lot of success doing this in
the mobile app space at the moment.

On the other hand, I imagine you building the next big thing as a social
webservice. You won't understand security, you won't know why it is important,
you won't know why it is hard... this worries me. Even big supposedly tech
savvy companies (Google being a prime example) get this wrong (when it comes
to _my_ data PRIVATE IS THE DEFAULT dammit, _not_ public!!!)

On the gripping hand, you can treat programming like any other kind of
artistic talent. You say you need to understand every aspect of the company...
well, will you have art? Will you have splash screens and icons? Does that
mean you will go to art school as well as learning to be a programmer? Maybe
you need some sound, will you spend 10 years trying to become a concert
pianist?

------
dlo
The below three essays are absolutely invaluable.

Peter Norvig: <http://norvig.com/21-days.html>

Eric Raymond: <http://www.catb.org/~esr/faqs/hacker-howto.html>

Paul Graham: <http://www.paulgraham.com/pfaq.html>

~~~
dlo
And here's another resource.

<http://see.stanford.edu/see/courses.aspx>

In particular, check out CS 106A.

------
ksmith
If you'd like to learn basic programming concepts right away, check out Pine's
'Learn to Program' (<http://pine.fm/LearnToProgram/>)

If you'd like to learn best practices, check out Hunt & Thomas' 'The Pragmatic
Programmer' (<http://www.pragprog.com/the-pragmatic-programmer>).

To get up to speed fairly quickly on what's going on under the hood, check out
Petzold's 'Code' (<http://www.charlespetzold.com/code/>) and Nisan &
Schocken's 'The Elements of Computing Systems'
(<http://www1.idc.ac.il/tecs/>).

------
pnathan
> One of our business coaches, a successful entrepreneur himself, suggested
> that the programming can be done with little problems

He's sort of a maroon. You can figure it out and be 'functionally illiterate'
fairly quickly with some ingenuity and hard work. You'll produce some hardcore
drek that will need to be cleaned up by a professional at some point though
(maybe you after a few years of programming :)).

Python is the current fad language for introductory programming. I am not a
huge fan, but there's lots of gentle reference material, which is probably
more important.

------
dr_
There are numerous online resources most of them have been mentioned here. I
agree Python seems like a great way to start, its what I've been working
through as well. I'd also suggest to see if there are local classes available
in addition to the online stuff. Sometimes paying for a course at a college
can get expensive but if you are in a area which is start up friendly and has
incubators etc., you can get some cheaper courses there, to supplement your
other learning. For example, in my area (NYC) there is General Assembly.

Remember though - entrepreneurship is not a career. You have to have a solid
idea that you can develop into a product - developing and then taking that
product mainstream and running that particular business (or working on selling
it)is then your career.

Just like non-profit work is not a career - usually people who go into a non-
profit work environment have a passion for something in particular, that then
becomes their career, which so happens to be for a non-profit entity.

------
xiaoma
The best resource I've seen is the Pragmatic Bookshelf _Learn to Program_ , by
Chris Pine. A good friend of mine who had no programming background whatsoever
went through that book this August, enjoyed it and made great progress. It was
enough that he found himself writing small scripts to help organize research
at his pysch research job. The fact that he could occasionally save 15 minutes
of work by spending 5 minutes to write a small chunk of code, kept it useful
and kept him at it. The book uses Ruby, but what it really teaches is
programming. My friend has since picked up quite a bit of Python and even a
bit of JS with very little difficulty now that he understands functions,
classes, iterators, blocks, etc...

In fact, what I saw impressed me so much that I've bought a copy to work
through, even though I'm already writing basic flash games in AS3.

<http://pragprog.com/titles/ltp2/learn-to-program>

------
Kaizyn
Hello Rocamboleh, what route you need to take to learn programming skills
depends entirely on what kind of business you intend to start. Programming is
a big field and has a lot of different technologies in it to pick from.

While espeed gave you good advice for how to setup your own server and all the
tools needed for a Linux-based web application, this isn't necessarily the
best route for you to go. If your software is intended to run in a big
corporation, for example, then you should probably consider learning either
the Microsoft technologies or the Java Enterprise technologies. If instead
you're going to be working on iPhone/iPad or Android devices, then you will
need a different tool set. There are a number of other alternatives you could
pursue, as well. The answer really depends on what kind of startup software
you need/want.

If I can help you further, please send me an email (address is in my profile)
and I will be happy to try. Good luck with your endeavors.

------
buckwild
I've found that I've learned the most about "programming" from working on
projects. Imagine something you want to build, design it, and then code it.
You'll learn tons, I promise. Plus, you'll have something to show for your
trouble at the end of it (which is a great motivator to get you going on your
next project). Rinse and repeat.

------
markkat
Here's how I am doing it: Grab an open-source program (in a space that
interests you), figure out how to get it running, then mess with it. Keep
changing it and messing with it.

After time, you will begin to understand more, and gain confidence. Just keep
at it. Don't stop pursuing your business interests, etc, but just code code
code. Best of luck!

------
ef4
Learning the basics would be a smart move. Just don't get a big head once
you've learned a little, because the gap between "knows enough to be
dangerous" and "truly competent" is vast.

The strategy is simple. _Stay focused on practical problems at all times_.
Pick some real thing you would like to achieve, and bang away at it, learning
as you go. When you get stuck, look for help on places like Stack Overflow.

Expect to suck at it, and expect to spend countless hours baffled by things
you can't figure out. There's no skipping this process. Most people find it
too painful, which is why most people never learn to program.

It doesn't really matter what projects you pick, so long as they're relevant
to you. If they turn out to be "too difficult" you'll learn just as much, and
be able to pick a smarter project next time.

------
ekanna
Start Learning JavaScript! In one shot you will learn 3 things 1\. Client Side
Programming (Browsers) 2\. Server Side Programming (NodeJS) 3\. Database
programming (Using JSON eg. MongoDB and CouchDB) How to start? 1\. Install
NodeJS 2\. Install Chrome Browser Start palying.....

------
tmachinecharmer
If you are using Windows: 1\. Download Visual Studio Express Edition 2\.
Google for C# tutorials for beginners 3\. Follow it.

If you are using Linux: 1\. Google for Python tutorial for beginners 2\.
Follow it.

Learn some web programming by following tutorials on w3schools. You should be
able to create simple static web page and host it on localhost.

Why C# and Python? Well both are widely used and are easy to grasp.

Once you grasp basic concepts like 1\. if...else.. 2\. for 3\. while 4\. case
5\. What are libraries? 7\. What is difference between compilation and
interpretation? 8\. What is the difference between editor, IDE and compiler?

the force will guide you.

And if at any point you get stuck you can always ask question at
StackOverflow.com

Then, you can come back and "Ask HN" how do I become better programmer?

Best of luck!

------
gcv
The best way to learn programming conceptually is to read Structure and
Interpretation of Computer Programs, by Abelson and Sussman. The book is
available free on-line, along with video lectures.

\- <http://mitpress.mit.edu/sicp/> \-
[http://groups.csail.mit.edu/mac/classes/6.001/abelson-
sussma...](http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-
lectures/)

Once you have mastered this material, learning the specialization of web
development shouldn't take more than a week or two of intense study.

Plus, as a bizdev person, you will earn incredible street cred with
programmers. MBAs with backgrounds in Lisp hacking don't come along every day.

~~~
spacemanaki
It's such a great book and I basically agree with everything you said, but I
feel I should add a little caveat.

SICP is truly a masterpiece, but it might not be the best book for someone
just starting out who wants to do productive stuff like prototype web apps.
Peter Norvig wrote in his review, "I agree that the book's odds of success are
better if you read it after having some experience" and I think I agree too,
although I'm biased since I only read it after getting a degree in CS. I don't
know how I would have felt if I'd read it as a freshman.

Felleisen et al argue that SICP isn't the best intro in their "The Structure
and Interpretation of the Computer Science Curriculum" and although I haven't
read the whole thing, I think I agree that How to Design Programs might be a
better first book. It's certainly easier going, and you couldn't ask for a
better environment than DrRacket to get started. And it's also freely
available online.

1st ed: <http://www.htdp.org/>

draft of 2nd: <http://www.ccs.neu.edu/home/matthias/HtDP2e/>

~~~
gcv
The original post asked for advice on learning "the ins and outs of
programming" — and prototyping web apps most certainly does not qualify.

No comment on HtDP, as I haven't read it. Heard good things about it, though.

------
tuhin
Does a Python version of core programming concepts like Algorithms,
Abstractions, OS, etc exist? Basically all the major course of Computer
Science which need a programming language to grasp the concepts.

Every University site I have seen has them in C++ or Java. I was so excited to
do MIT 6.0 Intro course for Python and throughly dissapointed that other
courses are in C or Java. Do I HAVE to learn 3 languages (even if it just skim
through) to just get the basic concepts?

I know of books like Learn Python the hard way, Think like a Computer
Scientist and like but I guess they do not cover the above topics. Please
correct me if I am being ignorant here.

------
wccrawford
Either take a class, or do it like most self-taught programmers: Find a need
and start looking up how to make it happen. It's going to be VERY painful at
first if you teach yourself, but if you stick with it, you'll get there.

~~~
michaelochurch
_It's going to be VERY painful at first if you teach yourself, but if you
stick with it, you'll get there._

Painful? It's fun.

Sure, it's difficult, but if he doesn't find difficult things to be fun, he's
neither going to be an entrepreneur nor a programmer.

------
kodisha
When i think about it - one language wont do it. When you learn html/CSS - you
will know how browser renders elements on the page, nothing else. If you learn
javascript - you wont know anything about server side. If you learn PHP - it
will complement your knowledge of html/css nicely, but you still need to know
some javascript.

So my vote goes to PHP + javascript (+node.js) + HTML + CSS

edit: i recommend Ubuntu for development, or if you own a Mac, just install
xampp and enjoy.

------
pepsi_can
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>

------
eru
Python, as mentioned, is an excellent choice for a first language.

However, if you are either mathematically minded or somewhat into chain-and-
bondage, then Haskell might also be worth looking into. I'd suggest reading
Raymond Smullyan's "To Mock a Mockingbird" if you want to go down that road.

It's a popular book about combinatory logic. The kind of logic you need for
functional programming.

------
rblion
Here is an MIT Course: Introduction To CS and Programming

[http://www.youtube.com/watch?v=k6U-i4gXkLM&feature=relat...](http://www.youtube.com/watch?v=k6U-i4gXkLM&feature=related)

Professor keeps everything simple and direct because this class is designed
for beginners with no or little programming experience.

------
NEPatriot
I'm going through this myself right now and am using a multi pronged approach.

1\. Trying to recruit friends who have also said they would be interested

2\. Watching videos from lynda, killerphp, etc.

3\. I have an idea of something I want to build and so am learning with a goal
in mind

4\. Hiring a tutor via e-lance to answer quick questions on an hourly basis

------
MichaelL
Do you want to be an entrepreneur or a coder?

[http://www.jamesaltucher.com/2011/04/the-easiest-way-to-
succ...](http://www.jamesaltucher.com/2011/04/the-easiest-way-to-succeed-as-
an-entrepreneur/)

This does not fit everybody, so if it's not for you, what could you take from
this?

------
simon_kun
<http://pine.fm/LearnToProgram/>

~~~
allanscu
This one is pretty good

------
SoftwarePatent
I posted a similar question a few months ago, there are a lot of great answers
in that thread

<http://news.ycombinator.com/item?id=2069477>

------
systems
The best advice I can give you (by which I will also be echoing others), try
to apply your knowledge as soon as you can.

Don't just learn to learn, because you will forget more than you remember.

------
thangalin
1\. Google.

2\. Search for: "start programming"|"learn to program" site:stackoverflow.com

3\. Read:

\- [http://stackoverflow.com/questions/4769/what-is-the-
easiest-...](http://stackoverflow.com/questions/4769/what-is-the-easiest-
language-to-start-with)

\- [http://stackoverflow.com/questions/1858064/so-my-
girlfriend-...](http://stackoverflow.com/questions/1858064/so-my-girlfriend-
wants-to-learn-to-program)

\- [http://stackoverflow.com/questions/335063/whats-the-
easiest-...](http://stackoverflow.com/questions/335063/whats-the-easiest-way-
to-learn-programming)

------
jdefr89
Don't start programming at all. I am going to be brutally honest, programming
is not for everyone. The fact you stated you want to start programming and
you're entrepreneur is a flag for 'someone who wants to learn to program in
order to become some millionaire'. These sorts of people are not successful in
the field. Worse, we have bad enough people in CS already don't poison the
pool with even more people who bring nothing to the software table.

~~~
forkandwait
Reason for my downvote: that was nothing but obnoxious and uncalled for and
fraught with untenable assumptions about the OP. you could have said "you may
find you dont like programming after you give it an honest effort, in which
case you might want to try something else".

------
ohashi
<http://www.reddit.com/r/carlhprogramming>

------
rocamboleh
Thanks for all the great responses. I'm really excited to get started!

------
vchien
MIT open courseware - ocw.mit.edu

------
jschlesser
The same way you learn to write a novel in a foreign language.

