Hacker News new | ask | show | jobs
by iamthad 1601 days ago
I find the Horstmann indentation style [1], in which code is placed on the same line as the opening bracket, simultaneously disturbing and compelling. If it ever ends up added to clang-format as has been requested [2], it might become more popular.

[1] https://en.wikipedia.org/wiki/Indentation_style#Horstmann_st... [2] https://bugs.llvm.org/show_bug.cgi?id=27263

4 comments

It is fascinating that we've developed a sense of aesthetics around this, though I suppose it is to be expected with how much we are oriented around language.

I personally use 1TBS wherever possible. It just looks the cleanest to me.

Oh my God, I think I like it.
This is actually very sensible. I don't like the top bracket being its own line, but there's good reason for it to align with the bottom bracket.
Java style formatting removes the "bracket on its own line" problem, so I'm not sure how this new indentation style adds anything of value really.
I like it too. It makes C code actually look readable. It would be interesting to see it applied to Lisp code.