Hacker News new | ask | show | jobs
by chatmasta 2812 days ago
The best habit that any developer can have is reading code. It’s shocking how few devs spend time reading code; whether the code is from library dependencies or entirely unrelated third party projects, I always learn something new just by reading it.

Not every developer is blogging their best practices. If you want to see them and learn from them, the best place to look is in the code.

Honestly I think we should be reading at least 10x the amount of code we write. For every novel an author writes, how many novels do you think they read? Certainly more than ten. Why shouldn’t we do the same? In a world awash with open source code, there is really no excuse not to be reading as much of it as possible.

1 comments

There are two interesting parts to reading code.

  - Working out what it actually does, and why

  - Working out why somebody *wrote it in that way*
The former is usually not too bad. Occasionally there will be a comment to help with the latter (although rarely ime). The latter is basically impossible. I can ask 3 other devs, they'll all disagree. Some like the style, some hate it. Each will complain about different aspects, and none of them would write it quite the same for ~reasons~

Maybe it's just me vOv