The Rebellion Against Style Guides

While driving from Huntsville to Florida, I listened to a talk given by a guy who oversees the general style guide for all of Google's multi-millions of lines of C++.

He spoke very positively about a formatting tool called clang-format, and how if he had his way at Google...there would be no arguing over code formatting. He felt the robot did a better job on average than even the best developers...and being willing to delegate formatting to the tool gave them time to work on more important things.

My well-known opinion for code like C++ or Rust or Java is that it is best represented as a graph data structure that captures the relationships and identities. How you render that is up to the program you use to view and edit the projection of that essential code. It doesn't matter if code is in braces or has a box drawn around it. You could make expressions feed into an actual logical circuit AND gate instead of using && or the word and or what-have-you.

But Rebol is different (and almost absurdist) in the software world. If anything, it has an anti-style guide, in The Deep Lake / (Swamp), where Carl says:

Suppose I write:

if time > 10:00 [
    wakeup user
]

which some users may choose to rewrite it this way:

if time > 10:00
[
    wakeup user
    alert "Time to work"
 ]

But, what if the "then block" is a variable itself, defined as:

 action: [
     wakeup user
     alert "Time to work"
  ]

Would you write this:

  if time > 10:00
      action

or this:

   if time > 10:00 action

The conclusion is:

...how you write code is ultimately your choice alone. REBOL, as a context dependent language, is perhaps the most freeform computing language ever invented.

I'm bringing this up because I'm mothballing an old Trello and looking for any links or information worth preserving. It had a card requesting a style guide, pointing out a limited bit that had been written in the Rebol2 manual:

http://www.rebol.com/docs/core23/rebolcore-5.html#section-5

I'm really only interested in the bits that reduce complexity (like just-say-no-to-CRLF files, or tabs, etc.) As for the code itself, this is kind of an ASCII-art medium.

So a good "style guide" for Rebol would be one that showed examples of how to take advantage of the degrees of freedom to be bent to your purposes. I think a good one was the tuple and path test dialect. But there are certainly more!

1 Like