Learning to code by reading code (was: The way to read STL source code)
Newsgroups: comp.lang.c++,comp.lang.misc
Followup-To: comp.lang.misc
Stanley Rice <heconghui@gmail.com> writes:
But if you said that reading others' code is not the way to improve your
programming skills, I have no ideas how to improve it. Reading the
Reading others' code /is/ the way to improve the skills:
- Of course, one should select code written by masters,
not code written by arbitrary authors. For example,
in the realm of C++, one might read boost source code.
In the realm of C, source code for GNU commands.
For Java, read the source code of the standard library.
In the realm of Pascal, "TeX - the program". And so on.
- A good way to enforce active reading is a goal, like
porting the code or modifying it.
- Reading masters' code must, of course, not be all that
one does. One also has to read books and do other
programming exercises. Reading masters' code might
comprise, for example, 20 % of all programming activities.
Newsgroups: comp.lang.c++,comp.lang.misc
Followup-To: comp.lang.misc