I'm reading Hackers and Painters , and as much as I enjoy the general idea of most of the essays, Paul Graham seems to pull certain things out of the ether for no apparent reason.
In the essay "Hackers and Painters" (online version, slightly different), he says:
Many a hacker has written a program only to find on returning to it six months later that he has no idea how it works. I know several people who've sworn off Perl after such experiences.
Fair enough. The statement is reasonable even if the people it references aren't. Name a language and I'll tell you I know several people who've abandoned it. I know plenty of people who can't read their own handwriting. So what. Why pick on any one in particular he doesn't mention any other language in the essay?
There is a little end-note attached to it though. I only quote the first sentence:
The way to make programs easy to read is not to stuff them with comments.
Okay, now I have no idea what he's talking about. At first I figured someone wrote a bunch of code and that was that. Why is he talking about comments? If there were comments, and the authors wrote their own comments, what's the problem?
Still, this remark seems totally out of whack. I don't think that Perl code needs comments more than any other code. I can do wacky things in any language. Indeed, the most heinous code I've seen recently was a bit of Python. So what. Next week it will be Java and the week after that Perl. Tomorrow it might be some C code. All of them can comment code.
I thought that the end note might actually belong to some other comment, but the online version and the dead-tree version both have it, although with different note numbers in each. Nope, that's what he meant to say.
I have a different view though: programs are easy to read by judicious use of whitespace. I don't care which language you use: whitespace is the first thing that affects readability.
Comments aren't there to explain the mechanics, but to document the state of mind. So why is he elevating them to the top of the list of things to demonize in source code? And how does Perl get to be the whipping boy?