Ctrl-I makes it easier to understand generated source

I really really really like code formatting support in the Clarion IDE, mostly because I have my own fanatical views on indenting, to wit, four space indents are clearly the only sensible way to go. I suppose I've been conditioned by years of Java and C# coding, but two space indents just feel cramped to me. I mean, it's not like my monitor's all tiny or something.

So I use Ctrl-I  (I for Indent) all over the place. Sometimes on other peoples' code (hey, they can always format it back to their teeny tiny two space indents if they want).

And one of the places I really like to use it is on generated code. Which makes no sense, right? It's just going to get overwritten on the next generation cycle.

But sometimes I find myself needing to make sense of generated code, either because I need to know where my code fits in or, increasingly, because I'm writing a class to encapsulate something that is done by a template, only not nearly as well as it could be done by a class.

Actually the shipping templates are usually pretty consistent for readability - it's the third party stuff that often has bad indenting, and sloppy embed code just makes things worse. But to avoid slagging off any third party folks, here's a snippet from the shipping templates where I've messed up some of the formatting. Not so easy to read, is it?

And here's the same snippet after I select everything and hit Ctrl-I:

Ah, so much better. Even if you haven't seen the light yet and you're stuck on two space indents, you're going to find the code much more readable after Ctrl-I.

 

Â