Hacker News new | ask | show | jobs
by educating 4651 days ago
> Documentation is often not the best way to understand code.

I hope they teach that in college now. As much code as possible should be self-documenting. It can be short and/or efficient (one-liners ok), but it should be clear to someone with experience, so have good method names, variable names, decent formatting, organization, etc.

It took me about 8 years of professional coding experience before I truly appreciated this, so hammering it in in college is key.

2 comments

The line that has always stuck with me is that code should aptly explain how and comments should aptly explain why.
I guess the point that I was really trying to make was that reading the code and documentation can only get you so far, and doesn't help nearly as much with the bigger-picture "why" questions. (The code I worked on, in addition to being well documented, was also IMO pretty well organized and clear.)