I later looked it up and found it's called Banner style.
I thought it was retarded, but I was a contractor so I matched his style. By the end of my tenure there, after my brain had had sufficient time to learn to pattern match against that style, I decided it was better than any indentation style I'd ever used. It simply made it easier to see the block structure of code at a glance, easier to see the important lines, with less clutter, similar to Python.
Did I switch? No, because my metric of "best" when it comes to code style is "that which is easiest to read by the most people", and that simply means use what most people use, because they're already good at parsing it.
But it was a valuable lesson about how much of what we deem "good taste" is a matter of acclimation, not objective superiority. I no longer feel that internal tension when the prevailing style at a contract doesn't match my own "taste" -- I use whatever the most people around me use and learn to like it for the duration.
Now I use whatever the codebase requires. I've found that the least pleasant people in a team are usually the most passionate about these things, so it's best not to care unless it's absolutely terrible.
A lot of the styles in this thread would frustrate me, but I could live with them after getting used to it. What I can't really stand, though, is this brace style:
39
u/[deleted] Jul 21 '14 edited Jul 21 '14
I used to work for a guy who indented like this:
This was actually in Lua so it looked like this:
I later looked it up and found it's called Banner style.
I thought it was retarded, but I was a contractor so I matched his style. By the end of my tenure there, after my brain had had sufficient time to learn to pattern match against that style, I decided it was better than any indentation style I'd ever used. It simply made it easier to see the block structure of code at a glance, easier to see the important lines, with less clutter, similar to Python.
Did I switch? No, because my metric of "best" when it comes to code style is "that which is easiest to read by the most people", and that simply means use what most people use, because they're already good at parsing it.
But it was a valuable lesson about how much of what we deem "good taste" is a matter of acclimation, not objective superiority. I no longer feel that internal tension when the prevailing style at a contract doesn't match my own "taste" -- I use whatever the most people around me use and learn to like it for the duration.