iamelgringo

Thursday, May 15, 2008

Teach yourself you to Hack in 6-9 months

A.K.A. iamelgringo's opinionated and subjective syllabus for learning web programming/hacking

Every month or two, someone on Hacker News asks "How do I become a Hacker?" And, I'm happy to take a stab at the question. I had those questions myself at some point in time. Since it's Paul Graham's sandbox they're playing in, I'll assume that what they are really asking is how to make web applications. And, this post is my answer.

First off, much of the below, can be learned from web tutorials. But, a lot of times, a book is the only thing that will scratch the itch. So, before you bankrupt yourself at Barnes and Ignoble, I'd highly recommend getting a Safari subscription. There's a lot of great books out there on the below topics, and a Safari subscription is a cheap way to access a lot of them at once.

Learn what a text editor is, and why you need one You'll be using one for the rest of your hacking career. Word or Wordpad will not do. Try E or textpad on Windows, Textmate on Mac and Gedit or Kate on *nix to start. (time 1-2 days)

HTML. This will get you familiar with the concept of looking at code and HTML is the lego brick of the interweb, so learn it well, grasshopper. I'd suggest putting off CSS and javascript until later. (Time 2-4 weeks)

Learn some flavor of Unix command line. You're not going to get very far without being at least familiar with a command line and some basic Unix commands. Learning how to program can be discouraging at first because you don't realize how much work it is. You probably expect to be able to write a Word or Counterstrike clone in weeks. I did. Weaning yourself from a GUI and learning a command line is where the blue pill takes you. If you're married to a Windows box, your best bet is to download VMware player and a preconfigured virtual appliance with Ubutu on it. Bonus points for installing Linux from scratch on a spare computer. The more comfortable you are with a command line the better. Hacker:Unix == Capenter:hammer and saw. Nuff said.(Time 1-4 months)

Learn how to ssh into a remote Unix computer and run commands on it. You'll need this a lot later. Learn how to FTP files from one computer to another. (Time 1-2 weeks)

Python. Everybody has an opinion on what the best first language is, and they'll tell you all their arguments for them. Not being familiar with programming, none of that will make any sense to you. Save yourself a lot of worry and effort and just pick Python and run with it. Learning Python from the command line is a very nice introduction to an actual programming language. It's fairly easy to read, and there's a lot of good tutorials out there.

Focus on learning how to open, change and interact with text documents. HTML and web pages are all text. You'll need it. Bonus points for learning what Regular Expressions are. They are very painful, but occasionally they're the only thing that will do the job. (Time 2-4 months)

Client Server basics, Networking basics and the HTTP protocol. Read a couple of tutorials on each. (Time 1-2 weeks)

Apache -- learn what a web server is. Learn how to set one up, edit config files and serve web pages. You need this if you're going to write web apps. (Time 1 -2 weeks)

SQL and databases. Install MySQL and build basic databases from re-runnable SQL scripts. Learn database basics, what tables are, primary keys, foreign keys, data types, constraints. Again, it's painful, but this is what web frameworks are trying to save you from. It makes a lot more sense knowing what you're being saved from. (Time 1 month)

CGI programming with Python. This is the great grand-daddy of all web programming. It's painful, but it's what all the web frameworks are trying to save you from doing. You'll need to know what they're reacting against before the tutorials start to make sense. (Time 1-2 weeks)

Now, you can pick up Django and start messing around with it. All of the above will make Django much easier to learn. (Time 2-4 months)

CSS and Javascript to make your web sites pretty and fun. (Time 1-2 months)

Lather, Rinse, Repeat. (Time The rest of your life)

Did I miss anything? If so, let me know.

edit: There were some concerns on Hacker News about my devaluing the meaning of the word "hacker" which have some merit. If you want to learn how to be a hacker in the classic sense, start with Eric Raymond's guide. This post is primarily geared towards beginners who want to learn how to hack together web applications.

Labels: , ,

9 Comments:

At 1:34 PM , Anonymous Anonymous said...

As someone who has learnt html/css I'm going to take the plunge - thanks for the post, I'd better get started :)

 
At 2:35 PM , Anonymous Anonymous said...

'Would add: "learn to use a scanner and a sniffer..."
Might be also useful to get familiar with TCP/IP.

 
At 4:36 PM , Anonymous Anonymous said...

I would say that in addition to your list - at the very least - an aspiring hacker should study algorithms . . .

 
At 5:06 PM , Anonymous Anonymous said...

I think you missed version control and testing. OK, some people leave the testing to their users, but as a minimum developers need to know how to run some basic tests, and these days should really be using some sort of xUnit style tests.

Version Control is also essential for those days when you discover that the beautify feature you have just developed breaks everything else in the application;-)

 
At 6:29 PM , Blogger iamelgringo said...

Good points about Version Control, Unit Testing and Algorithms. Thanks.

 
At 2:22 AM , Blogger Listic said...

Do you think Safari Bookshelf will be worth that $252.99 per year? I haven't used services like that before. How long are you using it? Could you please describe what do you get from this service?

Though I think it's just logical for the information (i.e. books) to be available electronically, I'm not sure that I won't miss the good ol' paper books. If I was able to access electronic version of the book when I buy paper one, I would be happy even if I would have to pay a little extra.

 
At 2:25 AM , Blogger Listic said...

Re: Safari Books Online
They ask me to select subscription type, but there's only one shown to me:
10-Slot Bookshelf, Limited Access, USD $22.99 per month, USD $252.99 per year.
Is it the same with you?

 
At 4:14 AM , Blogger iamelgringo said...

They have several different levels of access. I actually pay for the Library subscription, which is around $45 a month. I'd buy at least 1-2 programming books a month, so it's worth it for me. I've been using them for over a year, I think.

I have also used the less expensive subscription on a month by month basis.

 
At 6:18 AM , Anonymous Anonymous said...

Great blog. I got PHP enabled on Windows 2008 server yesterday in only 5.5 hours. I have been hacking for over 7 years. (sarcasm off)

I would also mention crons and shells with bash. Automation is so beautiful.

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home