Hacker News new | ask | show | jobs
by DanielBMarkham 6195 days ago
I'm a braces-stand-alone person.

I've seen code that got confusing with K&R, especially when the programmer forgot to indent the next lines. And I really like the ability to adjust control flow with block commenting you have with braces-stand-alone.

I'm not looking to compress code. My goal is to make code as readable as possible. Anything I can do to make it explicitly clear what's going on I'm going to do. Code should not read like a mystery novel.

1 comments

Well I feel the block kind of belongs to the function definition/for loop/whatever, so it seems illogical to me to artificially separate them. I'd like to see what belongs together at a glance.

A single bracket on an otherwise empty line carries very little information, so why not reduce the strain on the eyes.

Because there's two types of information: control information and process information.

When I'm scanning code, lots of time I don't care about the control, I'm looking for what process takes place. Likewise, sometimes I'm just interested in control and could care less about process.

Braces-stand-alone lets me focus on each of these at a time. Especially if you get into an unusual control situation, perhaps with nested conditions, braces-stand-alone lets you isolate various control paths and change and test them.

It's not the end of the world or anything. As long as you understand the superiority of my position, of course (grin)

I must admit I don't understand how the "isolate various control paths" thing works. The other stuff I guess really depends on what you are used to. Probably I look more for indentation than for braces.