4 ms·
The only evidence that the author gives for the proposition that reading code is key to writing good code, is indirectly, by analogy to the arts. But music, pai
by mdemare 17y ago
The only evidence that the author gives for the proposition that reading code is key to writing good code, is indirectly, by analogy to the arts. But music, painting and poetry are completely different subjects. There may be similarities between (say) poetry and code, but it is absurd to say that, since reading poetry is important for poets, reading code must be important to coders.
And there are plenty of reasons to believe otherwise. For one, extensively reading code is rare among coders. All good poets are very well-read in poetry, but there are many good programmers who rarely read code other than what they intend to modify, or as documentation.
Also, unlike a poem, a unit of code (say, a function) has a very well-defined goal. Coders don't need to develop an elaborate aesthetic sensitivity to judge whether their work passes their goals - unit tests and benchmarks will do just fine.
Nor do coders need to read code in order to learn about clever coding techniques. Partly, this is because code, unlike poetry, contains very few clever things per line. Partly, because there are simply better ways to get such information: books, blogs, articles, HN, proggit, stackoverflow, and so on.
It may well be that reading code is very helpful in becoming a better programmer. But I'd like to see some evidence first.
- bumblebird 17y agoYou should at the very least be reading your own code. It's the feedback loop to improvement. >> " Coders don't need to develop an elaborate aesthetic sensitivity to judge whether their work passes their goals - unit tests and benchmarks will do just fine." If your goal is "It works", then sure. But some of us aspire to something more than that.
- mdemare 17y agoOf course you should read your own code. How can you not read your own code? This is about whether it makes sense to pick an open source project and start reading.
- bumblebird 17y agoYou'd be surprised. People using IDEs for a start, code folding, hiding from the cruft.
- biz2hack 17y agoHow are you supposed to know though, when your code is doing better then 'it works'?
- mbrubeck 17y agoIt's efficient. It's concise. It's easy for you to understand and modify. It's easy for others to understand and modify. Over the long term, it proves to have a low defect rate. It's declarative, and lends itself to automatic optimization.