logoalt Hacker News

Valodimtoday at 8:51 AM3 repliesview on HN

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".


Replies

Lindbytoday at 10:10 AM

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.

adamtaylor_13today at 12:01 PM

If they're not scannable, there's a good chance they're too dense and should be rewritten.

econtoday at 10:43 AM

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.