Re:Can we become better programmers through studying code?
by jakubholynet on Wednesday May 22, 2013 @05:19AM
(#5749640)
You are right, we all do this. What is missing from this is feedback: how do I know if my design is good enough or what are its pros & cons? (Since often there is no absolute "good".) That is something I am trying to provide: showing two implementations of the same thing, discussing the advantages and disadvantages of each in relation to general coding and design principles. Thus it helps to learn not only how to do a particular task and how somebody else has solved it but also to think critically about design and the ability to relate to design principles. At least that is what I hope :)
[ Parent
| on HN ]
Re:Can we become better programmers through studying code?
by Sealy on Wednesday May 22, 2013 @10:25PM
(#5754994)
That's so true, we hackers operate in a world where many different answers can be correct. However we can generally gauge if a solution is better or worse.
I guess you would need to come up with some sort of metric to measure how much 'better' one solution is over another. A crude example which I've seen is the number of lines. To me that just shows how elegant the code is, but as you know it does not necessarily mean it will execute faster.