Live data from Hacker News

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

news.ycombinator.com

51–60 of 97 posts

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

#51
Programming is a skill that one constantly improves at. The first step seems just to implement good practice into your code. Then it is learning a common way to problem solve.

The most important thing, something that I learned from a comment on this site(I can't find it at the moment), is to "just keep coding". Jump on an open source project. Take something small, find another programmer which you admire, and try to learn from their style.

Work with others. Pair programming is a great way to learn from someone else, it lets two people pick each others brains.

Remember becoming a good programmer is a journey. It is not something that achieved instantly.

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

#52
post #30

Assuming you mean programming professionally (i.e. most of every day), then five years is around the point where you become self-aware and realize your code isn't as awesome as you thought. Also, remember that if you see code published on the Internet, it was probably extremely polished, and likely written by someone who has had quite a lot of experience in a particular area. By having to maintain my code, I learned…

+1 for the having to maintain your own code. I remember looking back at my own code and swearing "what the *$$# was i thinking.."

This is what my boss looks for on résumés. Not loyalty so much as whether you've worked anywhere long enough to have to clean up and rearchitect after your own mistakes, rather than leave an ever-growing trail of (presumably) smoking craters.

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

#53
post #22

I know my code isn't good enough, and I've been programming for about 30 years! Not only that, my code isn't good enough, but I'm a great programmer. I might be making some wrong assumptions, but I think the people whose code is really bad are the ones who think their code is good enough, or the ones who just code quickly without thinking. (I tend to think quite a bit and then code. In fact for the particular project…

"The unskilled therefore suffer from illusory superiority, rating their ability as above average, much higher than it actually is, while the highly skilled underrate their own abilities, suffering from illusory inferiority."

Dunning-Kruger effect, and it is the same in most professions where 'performance' can be a subjective judgement. Teaching, definitely!

http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect

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

#54

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…

> Best thing to do is look at some really old code you wrote and realize how far you've come.

When I do that, I tend to get surprised how good it looks contrary to my expectations of coming far since then.

And sometimes when I look at the code of some famous project I like, I may get surprised how bad it looks.

Maybe this is the difference between "rock star" programmers and your average perfectionists out there - the former just get the job done, while the latter spend too much time making their code look beautiful.

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

#56

I felt like this with my code for the first 5 years that I was coding as well. My code now isn't pristine or perfect, but I'm consistently satisfied with the quality of my final products. Here's what I did to get to the point where I'm happy with my code: 1. Debug and refactor. Early on, I'd stumble through creating a script. It was usually write three lines, see if that worked, repeat. I didn't plan ahead enough, an…

Really nice summary, because it applicable to almost everything, if you one paraphrases the first item as 'look around what others do, and why, learn, and then change the way you do the same things' . ^_^

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

#57

I felt like this with my code for the first 5 years that I was coding as well. My code now isn't pristine or perfect, but I'm consistently satisfied with the quality of my final products. Here's what I did to get to the point where I'm happy with my code: 1. Debug and refactor. Early on, I'd stumble through creating a script. It was usually write three lines, see if that worked, repeat. I didn't plan ahead enough, an…

I really like your "clarity over cleverness" rule. It seems to incorporate so many good practices: premature optimization, over-design/second system syndrome, and doing the most obvious thing.

cf. "2. Rule of Clarity" - Basics of the Unix Philosophy http://www.faqs.org/docs/artu/ch01s06.html

1. Rule of Modularity: Write simple parts connected by clean interfaces. 2. Rule of Clarity: Clarity is better than cleverness. 3. Rule of Composition: Design programs to be connected to other programs. 4. Rule of Separation: Separate policy from mechanism; separate interfaces from engines. 5. Rule of Simplicity: Design for simplicity; add complexity only where you must. 6. Rule of Parsimony: Write a big program only when it is clear by demonstration that nothing else will do. 7. Rule of Transparency: Design for visibility to make inspection and debugging easier. 8. Rule of Robustness: Robustness is the child of transparency and simplicity. 9. Rule of Representation: Fold knowledge into data so program logic can be stupid and robust. 10. Rule of Least Surprise: In interface design, always do the least surprising thing. 11. Rule of Silence: When a program has nothing surprising to say, it should say nothing. 12. Rule of Repair: When you must fail, fail noisily and as soon as possible. 13. Rule of Economy: Programmer time is expensive; conserve it in preference to machine time. 14. Rule of Generation: Avoid hand-hacking; write programs to write programs when you can. 15. Rule of Optimization: Prototype before polishing. Get it working before you optimize it. 16. Rule of Diversity: Distrust all claims for “one true way”. 17. Rule of Extensibility: Design for the future, because it will be here sooner than you think.

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

#59
post #22

I know my code isn't good enough, and I've been programming for about 30 years! Not only that, my code isn't good enough, but I'm a great programmer. I might be making some wrong assumptions, but I think the people whose code is really bad are the ones who think their code is good enough, or the ones who just code quickly without thinking. (I tend to think quite a bit and then code. In fact for the particular project…

"The unskilled therefore suffer from illusory superiority, rating their ability as above average, much higher than it actually is, while the highly skilled underrate their own abilities, suffering from illusory inferiority." Dunning-Kruger effect, and it is the same in most professions where 'performance' can be a subjective judgement. Teaching, definitely! http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect

And Impostor Syndrome http://en.wikipedia.org/wiki/Impostor_syndrome

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

#60
I'm probably going to get down-voted for this, but it doesn't really matter if YOU think its good enough: it is a combination of "your competitor's code (ie, everybody on the Internet, not just in the realm of your business model) ISN'T good enough" and "does anyone else think its good enough".

Being highly self-critical of code is good, but don't let it stop you from writing absolute crap. Several people (of which includes Bill Gates) have sold/shipped absolute crap code and are now amazingly rich.

Whoever codes it wins, it usually doesn't end up who codes it better unless the original has serious flaws that were not corrected.

Post reply on HN