|
|
|
|
|
by schleyfox
4566 days ago
|
|
Reading code is the best way to get better at programming. It's good to start with really smart, really good code, but you should also read bad and mediocre code (and more importantly, be able to figure out from reading why it is bad or whether it only seems bad at first glance.) Reading code starts out being really hard, but with practice it can become almost as easy as reading prose. It's a winning proposition on all levels as you can pick up new techniques, understand how things are done (rather than just what they do), and see the trade offs and decisions that are actually made. Practicing code reading also improves debugging skills as you have to use the same skills to understand the what and the why of perfectly working but unfamiliar code. Whenever anyone asks me what they should do to improve their programming, I usually suggest reading more source code. Another benefit is that code can't lie as easily or as convincingly as the documentation can. |
|
Are there books or websites that have snippets of bad code for readers to test their skills with? I know I've seen something like that for C (maybe as part of a larger book) but what about all the other languages?