3 ms·
"There are a lot of bad code out there and the only thing you can learn from it is how to write bad code." Oh, I dunno. I've done it a bit and found value in i
by scarecrowbob 10y ago
"There are a lot of bad code out there and the only thing you can learn from it is how to write bad code."
Oh, I dunno. I've done it a bit and found value in it.
I spend big chunks of time writing customizations or extensions for WordPress plugins. It's not exactly a fun way to make a buck but it is easy to be better than most folks writing for WP and I work remote from a tourist town... but my point is that I have read a shit ton of really bad code. If you think that all it's done has made me able to write bad code, fair enough... I'm not exactly solving difficult problems.
But I still feel that it's good advice to read other peoples' code.
The benefits of knowing that you can do better than some folks aside, being frustrated by some poorly documented code that is difficult to reason about is a really great way to understand why you shouldn't write stuff like that, and the various ways in which things can get messy.
It's not the best thing in the world, and I suppose that on some level its struggling against rather than reading this code which is the real benefit.
But I agree with Stephen King when he writes in _on Writing_ that there is value to writers in reading some bad novels.
If you've been working for a while and want an easy way to improve your practice, and your general impulse when working with other folks code isn't to follow down to that code from your IDE, there is a lot of worse advice than to just go ahead and look at underlying code other folks have written.
- Nekorosu 10y agoI get your point. One of my points is reading somebody else's code isn't for beginners. This looks aligned with your last sentence.