Live data from Hacker News

How to become a programmer

news.ycombinator.com

1–10 of 37 posts

How to become a programmer

#1
Hello, I have been doing some web programming during the last few months and I'd like to become much better at it. I am trying to learn by reading programming (php) books and doing the practice exercises. I have also tried to write my own code for fun. The problem is that the stuff I do from books are really, really boring! The stuff I do on my own is more fun, but I get stuck quite a bit. Last week I spent an entire day trying to debug why php was not connecting to the mysql db. Once I figured it out, it was great, but I was beat. Is there a better way to learn programming?

Re: How to become a programmer

#2
The way I learned PHP is by developing two apps that I really wanted to build. I set aside three weeks for each app and coded PHP day and night.

One thing I realized was the importance of rhythm. If I code for a day and then come back to it after a week, it was almost like I was starting from zero.

Coding for sometime continuously is a good way to pickup a new language.

Re: How to become a programmer

#6
When I started coding I found a book that spoke to me -- This is very important because if you get a book you don't like or understand you will not want to learn from it.

And I tend to agree you should probably not start with PHP as your first language. I did, and now all I do is Python and Ruby which are significantly better, imho.

Re: How to become a programmer

#7

When I started coding I found a book that spoke to me -- This is very important because if you get a book you don't like or understand you will not want to learn from it. And I tend to agree you should probably not start with PHP as your first language. I did, and now all I do is Python and Ruby which are significantly better, imho.

The reason I picked PHP, is that so many open source web stuff seems to be written in PHP and I want to be able to customize these apps (ex: joomla, wordpress, etc). But ultimately I just want to code without thinking and if python or ruby takes me there faster, so be it.

Re: How to become a programmer

#8
post #2

The way I learned PHP is by developing two apps that I really wanted to build. I set aside three weeks for each app and coded PHP day and night. One thing I realized was the importance of rhythm. If I code for a day and then come back to it after a week, it was almost like I was starting from zero. Coding for sometime continuously is a good way to pickup a new language.

This makes sense! Think I will take the 3 days off between the Christmas and NYE holidays and do this! Thanks.

Re: How to become a programmer

#9
post #5

Don't be turned off by the fact that this is geared towards kids more than adults: http://hacketyhack.net/ It's a pretty decent introduction to Ruby.

There is also "Learn to Program" by Chris Pine [http://pine.fm/LearnToProgram/]. The book is an easy read, moves along well, and best of all, the entire book in one huge Ruby script, so you can dig in there after you are done reading the book for some real work examples...:D

Re: How to become a programmer

#10
First, ignore the language wars. They are all BS. You want to use PHP, use PHP. Just keep in mind that every language was written for a fairly specific task and it's very good at that task. Don't try to use C to write a server-side script. Likewise, it doesn't make sense to use PHP to write an OS. Try to understand what problem you want to solve and then pick the right tool for the job based on performance, libraries available, community support and past projects that are similar to yours.

Now on to becoming a better programmer:

Find a good project and read some theory books on debugging and how to write code in general (check amazon.com and read the reviews). Books like Code Complete 2nd edition and Beautiful Code. If you want to be more serious about it, the Computer Science series by Knuth will give you all you need to know to get a CS degree, but they are boring so you have to be willing to stick with them. Those books, 3 volumes, are the bibles of Computer Science ( yes, someone will disagree) and as such they are theory. However, you need to know a good deal of that theory to write good software. Specifically, you can concentrate on searching/sorting algorithms, algorithm analyses and machine architecture.

In general, you will find that there is a HUGE learning curve to understand what the computer is doing with your program and how to write code that makes sense, which makes you a good developer. However, the time you invest in learning what happens behind the scenes is worth it's weight in gold, independent of the language you use.

Always try to figure out what the tool/language you are using is trying to do and don't blindly trust it.

Never, ever skimp on comments. You don't have to write a novel and explain that you are adding 2 to variable i, but do explain what the function is doing or what a complex bit of code is doing, this will save you hours when trying to find that bug.

Use a version control tool. The simplest one to use would be Subversion and the book for it is free online. There are also free Subversion hosting services such as http://beanstalkapp.com/.

Depending on how serious you are, you might want to look at the coursework from colleges like Stanford. Many top schools post their coursework with lectures online.

Google is your best friend. Just paste the compiler error and remove any variable names and you will often find people who had the same exact problem with possible solutions. You might have to play with the search string, but you will often arrive at an answer quite fast in this manner.

Try to find mentors on forums and newsgroups. This will take time as you develop relationships with people, but it's the best way to learn as the software development industry is still, very much, based on the notion of apprenticeship.

Try to study some open source projects. Little ones are best, as they are least complicated usually. Trying to figure out what someone else wrote will make you a better programmer in a hurry, because you will notice mistakes people make and how you would like to do things differently.

Lastly, think about which tool/program/etc. that you would love to have or rewrite an existing project in your own style and do it. The first one will be horrible, full of bugs and many many problems, but it will teach you more than most classes you take in school.

Post reply on HN