Learn to Code

A lot of people have asked me for advice on learning to code. What should I learn first? How long will it take? How can I get a job as a programmer? The answer to most of these questions is “it depends.” But there is one question that I can answer definitively. Should I learn to code? The answer is yes.

No matter what your day job is, how old (or young) you are, or what your level of commitment might be, any exposure to programming will have a notable impact on your life. Learning to code is like learning to speak a new language. With a relatively small amount of effort — just learning a few phrases really — you’ll find that a whole new world has opened up to you.

In the next few paragraphs I’ll try to say some stuff that’s relevant to as many people as possible.

My first recommendation for learning to program is to learn HTML. HTML is the language of the web. It’s relatively simple, and very forgiving of mistakes. It’s a great way to ease yourself into a very fundamental aspect of programming: syntax. Before you can make any headway, you have to learn to read and write syntactically correct code. htmldog.com has some great introductory tutorials on the subject that walk you through creating a simple web page. After a few hours you will have an understanding of a core piece of technology that billions of people use every day and which has completely transformed the world in the last two decades.

Once you have a bit of HTML under your belt, you can move on to a simple procedural programming language like python. Python is a great programming language to start with because it lets you focus on the more conceptual side of programming without having to worry about the nitty gritty details of how computers really work on the inside. What makes python especially great is that it’s not just for beginners. Some of the biggest sites on the internet were programmed in python. The most popular example is YouTube. The Beginner’s Guide on the python website has a very thorough list of resources for learning python. Ten years after reading it, I still recommend the book I used to learn python, which is available online for free: How to Think Like a Computer Scientist, co-authored by my first computer science teacher: Jeff Elkner.

If you’ve managed to navigate your way through HTML and python, then you are well on your way to accomplishing any goal you are willing to pursue.

Now a word about motivation. Programming can be hard. Programming can be frustrating. At some point you will find yourself staring at your computer screen for an hour, not being able to figure out why your code isn’t working the way you expect. This is par for the course and a normal part of the learning process. I’ll leave you with a few tricks to getting through these rough spots.

  1. Try not to program alone. Two heads are better than one and 99.999% of software is written collaboratively. Working together makes problem solving a lot easier and you’ll learn more in the process. There is an entire programming methodology that is premised on two people working together. It’s called Pair Programming and you should do it.
  2. Have a project. It’s incredibly boring to spend all your time doing tutorials and reading books. It doesn’t matter how big or small the project is, it’s just there to act as a test bed for all the new things you are learning. A great first project is making a personal web page about something you are interested in, or even just coding up your resumé in HTML.
  3. Get involved in an open source project. There are tons of projects out on the internet that other people have started and which desperately need your help to fix bugs, build new features, or even just write documentation. Working on an open source project is a great way to improve your coding skills because you can learn from the code that’s already been written. If you are reading this and already have an open source project that you are working on, add a link to it in the comments.
Advertisement
44 comments
  1. satendra said:

    nicely written…good to read you. :)

  2. Thank you this, I will check out the book as soon as I can, but this motivated me to start trying to learn some coding so i can really make my own wordpress themes.

  3. tjv16 said:

    Thank you so much Paul i will go and learn this. I really wanna work for the computer gaming industry and this will help me out a lot. Thanks again- Tj

  4. Do you think someone has too much computer skills to become a software engineer and system?! please inbox me

  5. Thanks for the post Paul. I am not really computer savvy however after deciding to have my blog, gradually I learned some things which I would never have the interest to learn have I opted otherwise. Learning to code could be one thing I might get myself to learn. :)

    Looking forward to learn more ideas from you!

    -Maricel

  6. Egbert O'Foo said:

    Hmm. It can definitely work. Took me about a decade. Probably more, truthfully.

    I started by learning how to build computer systems at a friend’s shop, then HTML
    for his website. A few sysadmin tasks on his mailserver. When the bubble burst
    he exited the business. Not much longer I started ‘consulting’ — hosting, building
    sites and doing onsite troubleshooting and repair.

    Ten years later, I’m web development lead for a publishing company. Not a bad
    thing; but I never saw that in the cards when I was a “young pup”.

  7. Thanks for the suggestions! BTW: I just discovered this blog and it’s great that experienced people spread recommendations for those who are beginning in this new world (including me).

  8. firestorm666 said:

    nice topic I like

  9. Wow its nice to have such an advice from someone who has established himself in the same field. Please keep on updating.

  10. a very good advice :)

  11. ravi said:

    A nice one

  12. Mena E said:

    thanks a lot , i still study at last year of computer science and i want to begin working and earn money ,can you help me
    and again thanks.

  13. Mark Bane said:

    Try this website: http://www.w3schools.com/ . I’ve learnt every web-related languages from here like HTML, XML, Javascript, CSS, PHP, MySQL, and AJAX. I’m currently learning Adobe Dream Weaver.

  14. Hey Paul,

    I think #1 is what I’ve been missing (well #3 kind of goes along with #1) For years I’ve been working alone, slowly learning a bit here and there. But the last few years I’ve immersed myself in as much programming as I can possibly handle on a day to day basis in an attempt to “catch up” with the crowd.

    Where do you recommend a 33 year old ex-architect turned code-junkie go to find a mentor? Or even a partner to work and learn from/with?

    Cheers,
    Frankie

  15. Arpit said:

    Is it necessary for beginners to learn C before learning any other programming language..??

  16. Hey Paul, thanks a lot for this post. I started to code when I was 9, also with html. Now I try it with ruby ect..

  17. greate joke sir!! lovely way you explained :) the questions which people ask u that all are still I get even I’m in final year of computer application course and working on a project in php and asp.net . its typically requires alot of time– whole day I can say . . boring ! bt its fin now as I can understand well its core purspose and its implementation. hoping to get more articles on this blog. interesting ! keep blogging sir!

  18. Hey Paul , Thank you very much

  19. Swapnil Jadhav said:

    nicely written & thanks for the tips.

  20. I know to code only PAWN – HALF LIFE SCRIPTING… Everyone told me i should learn C++ First, because C++ is very similar to PAWN, but i didn’t listened to them :)

    Also, they told me i have to be good in maths, but I’m not very well with maths…

    Now i want to learn PHP. i know its similar to C++/PAWN, too, so i shouldn’t have problems…

    And this should help me now, thanks :)

  21. Thans for the post…its informative and good for begginers.

  22. sagivo said:

    HTML is not program language, it’s a markup one.
    whoever write markup in HTML doesn’t program.

    my recommendations: go learn C#. use it to build website (with .Net technology) and cool games (using XNA)

  23. i learned C++ and HTML. Now is it wise to go for python or i should go for c# ?

  24. Siddharth Srivastava said:

    can you recommend me the best book or website for learning JAVA and Java Script???

  25. The article is a heterogenous mixture of knowledge and literatute.

    #article {ratings : great;
    marks : out_of_10(25:-D);
    feeling : like a high level language;}

    //*** Ha ha !! ***//

  26. thanks for the motivation .

  27. Frank said:

    there are already a lot of spaghetti programmers around, your article may “inspire” some more. Writing code like a monkey is one thing and understanding the concepts of computer science to solve challenging problems in an efficient way is totally another.There is a reason why computer science is a discipline and its not just about programming, its about problem solving. If you don’t have that bent of mind, you can learn all the programming languages you want but what you will create would basically be crap anyway….

  28. nicely written! INSPIRING!

  29. I know of an open source game called Assaultcube. It is written in C++ and the source is absolutely free.
    assault.cubers.net

  30. Good post and I agree on everything, except that HTML is not a programming language, but a markup language. There’s a big difference. You can’t write loops or anything like that with HTML, you just describe the content to a browser.

    Just sayin’. :-)

  31. Thanks a lot ! I used to ask this question many people….and every one said…you can’t do it………But learned java by my self…….again thanks a lot !!

  32. This was great, I look forward to reading lots more from you and from the info you post. I am passionate about learning to program, I love the mental challenge and the feeling of success when it does finally work. I know my html and css, know a little of js and php, I will be reading the info posted here. Thanks keep doing what you do bro

  33. very nice article paul….i liked !!!!

  34. Great paul.. I am working on QTP automation testing tool from HP. In office i feel pretty bored while doing the same kind of coding and execution.. Could you please suggest any website from where i can get small projects for my knowledge gaining perspective.. ??

  35. I am motivated….. thanks a ton :)

  36. Aimal Alkozai said:

    very, very, very nice. Mr: Paul

  37. I am feeling inspired to learn HTML and such stuff related to web development…
    I’m at the 2nd semester of Systems Engineering (though its very oriented to Computer Sciences)
    But so far I haven’t done anything outside of the regular curriculum, something I’d like to do!
    I stumbled upon your profile on facebook for reasons unknown, and now ended up here.
    Thanks for this blog post!

  38. I’m in an Intro To Programming class and we’re learning Java. I have a strong background in XHTML and CSS and a tiny bit in PHP therefor this stuff comes much easier to me than my classmates. Like you mentioned, I think HTML is a great starting point for anyone who wants to learn to code.

  39. great 1 Mr paul, lets code ~

  40. Akshay Mohite said:

    It’s pretty motivating..:-)
    Thanks for such a post..& I do expect such more posts in future.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 65 other followers