Ask HN: Does reading code actually make you a better developer?
11–20 of 30 posts
Re: Ask HN: Does reading code actually make you a better developer?
#12Re: Ask HN: Does reading code actually make you a better developer?
#13Re: Ask HN: Does reading code actually make you a better developer?
#14There is an analogy to writing in a human language. If all you do is read for 10 years, and then start writing, you'll almost certainly be a bad writer. You learned to read and extract information (and get enjoyment), but you almost certainly didn't understand how writers achieved those goals. This is even more sure for programming. Writing code over and over again helps teach you when and why to apply certain rules, because code has to work, not just look pretty.
But unlike writing human languages, there is far more to learn about computer programming - it's not just grammar and style, there's all levels of design, and architecture. So you read articles and books, but those are usually very hand-wavy. By reading the code for very large programs and then trying to copy what you see, you learn.
Also unlike writing human languages, you start by writing code. Reading code before you've written any is nearly pointless - you just won't understand what you are looking at.
It also matters what code you are looking at, just like it matters what you are reading - but again, only once you get good. So until you think you are at the median level for software engineering, don't worry too much about what you read.
The cool thing is that there's so much code available to read now, as compared to 40 years ago when programming first started becoming a real thing. And especially with Google and a few others not just employing hordes of great engineers but releasing a lot of their source as open-source. Read the Chrome source, for example. Or the Linux source.
Re: Ask HN: Does reading code actually make you a better developer?
#15So reading other code can surely help. I have seen some Github projects where I would have loved to have used the project for personal use, but I just couldn't understand the coding style, or have had to incorporate my own coding style because I could not adopt the code as it was in the program.
Re: Ask HN: Does reading code actually make you a better developer?
#16If you are inclined towards self-motivated improvement and if you have a good internal monologue where you are able to be real honest with yourself and your own failings and limitations then reading good code opens up the possibility that you can apply the things you take away from it to your own code and become better.
Good code isn't a gold ticket, it's always on you.
Re: Ask HN: Does reading code actually make you a better developer?
#17Re: Ask HN: Does reading code actually make you a better developer?
#18Re: Ask HN: Does reading code actually make you a better developer?
#19Re: Ask HN: Does reading code actually make you a better developer?
#20You don't read it like a book, you read it to modify it and therefore you just understand it.