Hacker News new | ask | show | jobs
by ianwalter 1828 days ago
> If I need to read your comment in order to understand your code, there is something wrong with your code.

This whole post is based on a bad premise. Whether the reader can understand the code is dependent on the reader and not just the code.

1 comments

I would disagree, it's all about time spent (one can argue wasted) It's a lot faster to "get", to understand well written code that uses natural language semantics regardless of the reader competency
"To understand this code, first understand the entire Intel SDM, volumes 1 and 3, using 2 and 4 as needed to clarify MSRs, with chipset documentation added as needed for hardware specific MSRs" is far, far harder than some comments in each section briefly describing the hardware section being interacted with, and what particular bits do.

If you're so far abstracted from hardware that none of this matters, well, OK, write what you want. But there is an awful lot of code that interacts with the hardware more directly than one might think, and even in higher level code there are often some significant gains to be had in terms of tweaking things for the branch predictors and such.

Though I guess if you're in an abstracted enough language, you can't even really influence that stuff. It's been years since I've written anything much beyond C (C++ with STL classes is a nice treat, but it mostly talks to something written in C over some data link or another).