Ask HN - what is the best method to learn how to code?
I'm a business guy but I want to learn how to code as a frontend developer.
Which method is more effective?
1. Should I learn by doing? I have a website and want to improve it. Will I be able to teach myself by trying to fix features?
or
2. I pick up books and start from scratch? And only then, after reading the material I will be ready to make something happen?
Please advise. Thanks!
9 comments
[ 6.3 ms ] story [ 27.2 ms ] threadAnd really, the most effective route is to do both. Focusing too much on doing without the book knowledge results in creating terribly awkward solutions to problems that have been already been solved. On the other hand It's easy to follow along with a book and fool yourself into thinking that everything makes sense while lacking the experience needed to figure out how to put all the little pieces together to create something useful. As is usual in life, balance is key.
What you want to avoid, whether you choose method 1 or 2, is the idea that you can write your first lines of code as a useful part of a real project. To learn effectively, you have to be willing to implement some examples, experiment, and throw some code away.
Start with some lightweight tutorials about creating web pages (static content): http://www.w3schools.com/html/default.asp http://www.w3schools.com/css/default.asp
Creating dynamic content (programming) is a whole different issue ( http://norvig.com/21-days.html ).
Start with learning procedural programming: http://ocw.mit.edu/courses/electrical-engineering-and-comput...
http://www.greenteapress.com/thinkpython/thinkCSpy/html/
And then experiment with a simple web framework: http://webpy.org/tutorial3.en
The learn workflow shold be a combineation of: read some -> do some -> try some -> read some more -> experiment some -> read some -> continue
This is just a startingpoint, there are many topics to web development, from javascript for interface interactivity to distributed systems, message queues, scaling ( I'll write this link again just for kiks http://norvig.com/21-days.html ) etc.,
The resources are for the Python language, personally I prefer Ruby, but the resources for "learn programming" are more evolved in Python as it has bean adopted as a teaching language by many schools/universities.
PS. Exercise oriented: http://learnpythonthehardway.org/
When you try to do something, you'll always find yourself stuck in the middle, and that's when you'll google stuff.
And then you'll find tutorials, or blog posts, or what have you. And as you read more of those, you'll see references to books and other tutorials/posts/essays.
Start by just doing, and you'll eventually end up reading a lot.