« BackLessons from Plain Textrugu.devSubmitted by kugurerdem 2 days ago
  • bediger4000 7 hours ago

    Greppability is an interesting idea, and a good one, but I'm going to disagree with the recommendation

    > Stop hard-wrapping and just use soft-wrapping,

    Grep for some pattern in soft-wrapped text and you get a lot of extraneous material.

    You also can't grep for things "at the beginning of the line", which is often an important indicator. When I did a lot of plain C programming, I would put function names at the start of a line, below their return type to make it easy to grep for a function definition, rather than just uses.

    Soft-wrapping also limits the use of diffability, a complement to grepability. You might correct a single letter in a misspelled word in a soft-wrapped paragraph. Do a "git diff" or equivalent and you'll get back a huge block of "changed" text. Useless. Short, hard wrapped lines make it easy to see diffs.