Hacker News new | ask | show | jobs
by Valodim 95 days ago
Good article, enjoyed it. I might give this idea a shot!

> Comments: these contain high level descriptions (faster than reading the code) and external context (the “why” that reading code can’t answer). This is the most scannable thing in any big code file.

Not sure about that one, depending on comment culture. Comments are prose and not structured, so to understand their meaning is a lot more cognitive load for me than (most) code. I certainly wouldn't have thought to call them "scannable".

3 comments

I totally agree with you about the comments. Code is so much easier to grok. The comments are there as a reference that you can concentrate on if the code doesn't make sense to you.
I switch if the code is very ugly and unreadable. Often overly optimized things. One jumps to mind when I rewrote something to generate regexes.
If they're not scannable, there's a good chance they're too dense and should be rewritten.