Live data from Hacker News

Ask HN: How do you get better at coding?

news.ycombinator.com

11–20 of 73 posts

Re: Ask HN: How do you get better at coding?

#11

I get better at coding by coding. No, really. You can read all the books, blog posts, open source code samples you want, but nothing will substitute writing code. I maintain a handful of side projects as well as write code daily for my job. Plus, I love it. Also, my side projects usually encompass something I have no idea how to do, which quickly elevates my skill level. I love learning, so it works for me.

I think I "read" about programming for something like 15 years (books, blogs, HN, proggit, irc chat)

I started actually coding seriously and properly the past 1-2 years. Easily learned a hundred-fold more by doing it, literally.

I think too often I told myself I'm "not good enough to make something serious". And you know -- it was probably true. But that doesn't matter. Just start, things will fall into place, sometimes you'll fail, sometimes you won't. It's just the only way really.

Re: Ask HN: How do you get better at coding?

#12
Practice.

1. If I'm learning a new language, I pick a topic I know well and try to apply it in the language. Typically the first pass is nonidomatic, and I iterate as I learn more about the language. 2. If I'm learning a new algorithm, I use a language I know really well. 3. If I'm learning a new framework, I pick a smallish project and dive in.

Most of it is throw away, and I've found that takes a lot of pressure off.

Re: Ask HN: How do you get better at coding?

#15

I get better at coding by coding. No, really. You can read all the books, blog posts, open source code samples you want, but nothing will substitute writing code. I maintain a handful of side projects as well as write code daily for my job. Plus, I love it. Also, my side projects usually encompass something I have no idea how to do, which quickly elevates my skill level. I love learning, so it works for me.

Code reviews help a lot with that. At my current company we don't review so I've found myself getting complacent

Re: Ask HN: How do you get better at coding?

#16
I apply the 80/20 rule recursively. It’s something I caught myself doing at some point and now I tell junior devs to do the same thing.

If you spent most of a day on something, nobody is going to notice an extra twenty minutes to fix it up a bit more. Especially if it means fewer production issues with that code. On a sane project the interesting problems are given to the most reliable people, not the fastest. So look at th code one more time than you deem necessary.

Try to look at it the way someone else will or the way you will in six months when you touch it again. Do the commit comments match the code? Can you tweak the code a bit to make it mean what you said? Then do it.

Re: Ask HN: How do you get better at coding?

#19

I get better at coding by coding. No, really. You can read all the books, blog posts, open source code samples you want, but nothing will substitute writing code. I maintain a handful of side projects as well as write code daily for my job. Plus, I love it. Also, my side projects usually encompass something I have no idea how to do, which quickly elevates my skill level. I love learning, so it works for me.

This sounds right but in reality I think something is missing if you end up isolating what you know and just keep coding. I worked with a guy who programmed for 5 years and wrote the same crappy code he wrote 4 years ago. If you don't know you're doing something wrong because even though you are solving problems the hard way to you you're still solving problems. If you are always pushing yourself and reading you learn there is a better way.

Re: Ask HN: How do you get better at coding?

#20
Every Sunday, I go through the things I did that week (including work and social events) and ask "how could that have gone 10% better?" Then I see if I can apply those ideas to future projects.

Years of accumulating minor improvements based on real projects I actually worked on have compounded.

Post reply on HN