Live data from Hacker News

Ask HN: I think My code isn't Good enough

news.ycombinator.com

1–10 of 97 posts

Ask HN: I think My code isn't Good enough

#1
I have been programming for the last 4-5 years but whenever I look at some good code written by some one else I always have this feeling that my code isnt good enough. By "good enough" I mean that my code isn't as beautiful(readable) and reusable. I always try to change the way i do things the next time but i keep getting this feeling. Do you guys ever fell like this and what you think I should do to improve on that ?

Re: Ask HN: I think My code isn't Good enough

#2
It's constant, almost everyone experiences it. Best thing to do is look at some really old code you wrote and realize how far you've come. After that, write more code, read more code, write more code. Programmers all want to be better, this drive helps us become so, but it also drastically diminishes our ability to be content with our current situation. If you really want to see how far you've come. Find someone who reminds you of yourself and mentor them. It's much easier to perceive change in others than change in ourselves. Watching mentees progress reminds you of when you underwent the very same realization and helps you become more aware of liminal points in your programming journey.

Re: Ask HN: I think My code isn't Good enough

#3
Here's Jeff Atwood's take on it: http://www.codinghorror.com/blog/2009/07/nobody-hates-softwa...

"I think you can tell a competent software developer from an incompetent one with a single interview question: 'What's the worst code you've seen recently?' If their answer isn't immediately and without any hesitation [the] two words 'My own.' then you should end the interview immediately."

Re: Ask HN: I think My code isn't Good enough

#4
You say you have been programming, but not if you are solely a programmer or building a product as well. Perhaps it would be easier to think of code as a medium to achieve a higher goal, which is functional software. I'm inclined to believe that this is more important than "code beauty" which is something highly subjective and tends to be constantly evolving with your experience.

Note I am not promoting spaghetti code. If it's not blatantly incomprehensible (i.e. you abide to some common sense) and works, you are set.

Of course this is my view after having spent non-trivial amounts of time making code beautiful, modular and reusable instead of trying to solve the problem at hand. YMMV.

Re: Ask HN: I think My code isn't Good enough

#6
You do want to improve, but just relax and do your best work. Continue to learn and read other people's code that you respect. But don't let your desire to improve and impress others stress you out. Also, consider the rule of threes on reusability: http://www.rimmkaufman.com/rkgblog/2007/10/16/rule-of-three/

It seems possible you are being exposed to mentors that are being too harsh on you. Certainly you're being too harsh on yourself. Go forth boldly and code.

Take some time to read about _why's philosophy on coding and making mistakes. I think it would do you a world of good.

Re: Ask HN: I think My code isn't Good enough

#8
I wouldn't really think too much into it. I've had the "not good enough" feeling for years, in fact, ever since I started programming!

A few years ago I started working on a game, the best ever I thought. I was so clever with everything I thought and oh I wouldn't need to refactor because I would do it right from the start!

Of course I moved on and started to work on other things for a while and when I came back I thought it was horrible, almost unusable!

This happens all the time, though at a lesser extent, for me. When I notice something new, fresh, nice or beautiful way of doing things the old way is simple not good enough. Why did you ever do it that way?

Don't bother too much - it's normal and it shows that you're always evolving and getting better. And after all, you learn by doing mistakes not by doing everything beautiful and perfect from the start.

Re: Ask HN: I think My code isn't Good enough

#9
Thinking you aren't good enough is the first step to getting better. At the risk of sounding cliched, it's the journey not the destination that's important. You never arrive at perfection anyway, so I wouldn't worry!

The best thing I can suggest is expanding your horizon as far as possible. Your profile says you're a RoR/JS programmer. Go learn some Haskell (or any other functional language; I started with Racket) and you'll find a truly different way of looking at programming, one which will change your style forever.

Post reply on HN