Indent Styles

By Deane Barker on August 31, 2004

indent style: Excellent entry from The Jargon File that describes all the common indent styles in use today. If you program, read this. I use Allman style. You?

(What, no VB-style indents? I’m shocked…)

Gadgetopia

Comments

  1. Allman is my fave. I guess I agree with you both, since I use 1-tab indents, but I insist that a tab equals 4 spaces. I know a lot of people hate tabs in code, but I’ve never understood why. Sure, it may look off if it loads into an editor that uses 8-space tabs, but this is configurable on nearly all modern editors. Set a standard for your project and get on with it.

  2. So that’s what they are called. Visual Studio .Net just has a check box with the label “Leave open braces on same line as construct”. This holy war comes right after the holy war where C# is chosen as the language of choice over VB.Net.

  3. Yes, Deane and I are still having that war. He’ll soon realize, though, that VB.Net has been slowly killing him, while C# has been increasing my lifespan and making me inexplicably more attractive to the opposite sex. Had any weird rashes lately Deane? That’s the VB working on you.

  4. Normally, I think you’re a pretty smart guy, Joe. But given that all .Net languages compile to the same IL before execution, I maintain that it doesn’t matter which language you write the source in. Write in whatever you’re more comfortable and let the compiler do its job.

  5. Did you notice that PEAR coding style prefers K&R over Allman?

    My wife is an Allman devotee, whereas I learned K&R back in the DOS years. We don’t discuss it, nor do we watch each other code.

    Either way, 1-tab-indents are the way to go.

Comments are closed. If you have something you really want to say, email editors@gadgetopia.com and we‘ll get it added for you.