Hacker News new | past | comments | ask | show | jobs | submit login
ASK HN: How to be a better programmer?
30 points by sid6376 on Aug 7, 2010 | hide | past | web | favorite | 25 comments
I am a 24 year old guy who recently had an epiphany that the field i accidentally landed up in(programming) might just be what's my calling. But i want to get better at it than i already am today which frankly is not much. and i need your help. I read this article by Peter Norvig in college http://norvig.com/21-days.html and have tried to follow it as a manifesto. Specifically i want to ask these particular questions? 1. What blogs/books i can read on a daily basis to get a little better every day? 2. As i have a fulltime job which occassionally stretches into 12-16 hour workdays can i contribute to open source in a meaningful way? Or will working on a problem which i face is the better solution. 3. Any other tip that you might have, which you follow yourself or have seen someone doing that helps me towards this goal.

Any help would be greatly appreciated.

My 2c:

#1 Try cutting down on blogs. There is really no need to read them daily.

#2 Try to include open-source patching into your actual fulltime job (of course, management has to agree with this, etc). If you already work 12-16 hours per day, don't burn yourself by trying to do open-source on the side.

#3 Follow the good programmers nearby. This means move the the team that has the best coders and best practices. Externally, go to user meetings and occasionally have your company pay for big conventions.

Ways to become a better programmer:

- Practive! The more you program, the better you become. The harder the thing you program, the better you become. This is the single most important thing you could do. All the great programmers I know program outside of work, in their own time. That is, they take an interest in programming and practice even when they don't _have_ to.

- Read code wrtten by people better than you. This will inspire you and give you ideas on how to improve your own code.

- Go to local user groups or meetups. Meeting other programmers outside of work will give plenty of opportunities to improve, by talking about ideas, showing each other projects or code or by working on projects together. If the group also does talks/presentations/tutorials, then you have even more opportunity to learn new things and improve.

- Learn new programming langauges is a good way of improving your programming skill, as long as the programming languages you learn are all different. For example, if you know Java, you won't get a lot out of learning Java and if you know Ruby, you won't get much out of learning Python etc (unless you want to use a specific library for those languages). However, learning something completely different, like Haskell or prolog or Common Lisp would help make you a better programmer. Basically, learn a language that is of a different paradigm than the ones you already know. The language itself might not be useful to you, but the concepts, techniques and ideas of those lnaguages will improve your programming skill.

- As far as books go, people have different tastes. Most people will recommend the classics (Structure and Interpretation of Computer Programs; The Art of Programming, Code Complete, The Pragmatic Programmer and so on). They're good books, but may or may not be what you want.

- You can contribute as much or as little to open source projects as you want or have time for. Even just fixing a bug here and there is beneficial to the project, so find yourself a project that interests you and contibute what you can - but don't worry too much it if you find you don't have enough time. Understanding other peoples code and fixing their bugs is a great way to improve your own skill.

- Blogs.. I don't know. Its definitely a matter of taste. Keep reading articles linked by Gacker News and other such sites and bookmark blogs whos articles you like. Or go on stackoverflow.com and find people who post great answers - they may have blogs that would interest you. Bascially, try and find intelligent people who post about things that interest you.

Anyway, good luck!

Just to throw in more opinion - I have rarely heard The Art of Programming referred to as a book that should be read. It's a book to have around when you need to solve a problem, but for your sanity, don't sit down and try to read any of them. You would be doing marginally better for yourself than reading the dictionary.

That said, I have enjoyed reading swaths of dictionaries :P

Sure, its more of a reference manual. A lot of people still recommend it, though. For example, the stackoverflow question about recommended books.

(I've read dictionaries too. And reference manuals for various libraries and languages. The Intel instruction set reference probably being my most read reference manuals)

I fully recommend The Pragmatic Programmer. Its a book that I feel will ease transition from spoon fed grad to experienced coder such that you can pick up new languages and technologies as and when they fit the problem faced.

I actually paused for a few minutes when I wrote that and wondered if I should leave it out of the list and actually recommend it. I definitely agree that its a book worth reading. What I really meant by that section was that some people will recommend books A, B and C, but others will say that those books are worthless and instead you should read books D, E and F. You need to pick books that are right for you, though admitedly finding out which these are may be tough, without reading them all..

>For example, if you know Java, you won't get a lot out of learning Java

Sound advice.

Opps.. I meant <insert other similar language here, eg C#>

Thanks. I think this answers a lot of my questions.

Practice makes perfect. The more you code, the better you become.

From my experience, reading books is one thing but if you didn't make your hands dirty, it's nothing. My advice would be, if you are really new to programming go learn the basics and get your hands dirty ASAP.

Unless you code the same thing over and over again until you retire, that is.

If its sufficiently large to allow you to refine and improve on each iteration, then you will still improve and learn from it. For a while, anyway.

This was posted a few weeks ago: http://samizdat.mines.edu/howto/HowToBeAProgrammer.html

Lot's of good stuff in there.

I read the first couple of pages, really good. Thanks for suggesting this.

Program tiny, but real, things in technologies you're not familiar with. They have to be tiny (to avoid a long list of unfinished projects, and because you learn more from finishing things), and they have to be real (ie. something that at least 1 person can actually use).

Sometimes is even good if you write the same tiny project taking a different approach. I.e. You wrote an algorithm using a greedy technique, them repeat it using a dynamic approach.

I have trouble finishing things and this would be a great way to get rid of this bad habit. Can you give examples of small things which you built this way?

- Practice. Yeah, other people said it. It's that important.

- Find a mentor. You'll improve slowly just from practice, but finding a mentor will force you to get up to their level at a much quicker pace.

- Read things. Books, blogs, whatever. If you have an active interest in it, read it.

- Use new technologies. Never heard of Node.js before? Stop and figure out what it is. Try it. Even if you hate it, you will have been better for learning about it. (Node.js is just an example I pulled out of thin air. This applies to ANY new programming thing you read about and is new.)

- Get a job. Even if it's a crappy programming job, nothing makes you learn faster than having a boss telling you to do things faster and better.

Man cannot understand the perfection and imperfections of his chosen art if he cannot see the value in other arts. Following rules only permits development up to a point in technique and then the student and artist has to learn more and seek further. It makes sense to study other arts as well as those of strategy.

Who has not learned something more about themselves by watching the activities of others? To learn the sword study the guitar. To learn the fist study commerce. To just study the sword will make you narrow-minded and will not permit you to grow outward.

-- Miyamoto Musashi, "A Book of Five Rings"

You know it's funny, A really close friend whose programming prowess i admire told me that great programmers always have another passion. I will tell him, he's not alone in thinking so.

Read this books and watch this video lectures.

* Introduction to Algorithms (SMA 5503) http://ocw.mit.edu/courses/electrical-engineering-and-comput...

* Structure and Interpretation of Computer Programs (aka SICP) http://www.youtube.com/watch?v=2Op3QLzMgSY

http://projecteuler.net/ is a good way to go through and learn a new language. Focus is on programming, algorithms and the mathematical tricks associated with paring down the number of things you should be searching through.

Two books I recommend

1) Head First Design Pattern

2) Effective Java (Joshua Bloch). The principles in this book can be applied to almost any programming language not just Java

I recommend A. K. Dewdney's "The New Turing Omnibus". It is a series of articles and is very easy to dip into.

practice (keep coding, work on your own projects, work on projects with others), and go find someone who you know to be "good" and read their code.

it really is about that simple.

Applications are open for YC Winter 2020

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact