Kristian Glass - Do I Smell Burning?

Semantic Linebreaks

When I write reStructuredText or Markdown or similar, I add linebreaks after commas and full stops, rather than at some sort of pre-determined / arbitrary line wrap point.

Why? Because it’s awesome.

Brandon Rhodes does this too and calls it “Semantic Linebreaks”. He also explains the benefits significantly more eloquently than I’ve managed to:

By starting a new line at the end of each sentence, and splitting sentences themselves at natural breaks between clauses, a text file becomes far easier to edit and version control. Text editors are very good at manipulating lines — so when each sentence is a contiguous block of lines, your editor suddenly becomes a very powerful mechanism for quickly rearranging clauses and ideas.

And your version-control system will love semantic linefeeds. Have you ever changed a few words at the beginning of a paragraph, only to discover that version control now thinks the whole text has changed?

The only minor “complaint” I have is that a small minority of renderers don’t re-flow the text - you’ll see this in my GitHub issue comments from time to time!

Comments