
Where a Curly Bracket Belongs - brendt_gd
https://stitcher.io/blog/where-a-curly-bracket-belongs
======
rkagerer
Screens are wider than they are tall. I hate this obnoxious trend of wasting
my limited vertical real estate with so many empty lines (in UI too, not just
code). It makes me have to scroll more, which wastes my time, mildly disrupts
my spatial orientation and aggravates my RSI. Maybe I'm just a cranky old
coder from back when pixels were precious.

~~~
rkagerer
BTW, people will probably hate this, but my last codebase differentiated line
continuations by simply double-indenting the next one. Not touting this as the
"right" way of doing it, just suggesting the author's conclusion there's no
other solution smells a bit insular.

    
    
      public function __construct(
              string $publicDirectory, string $configurationFile, 
              PageParser $pageParser, PageRenderer $pageRenderer) {
          $this->publicDirectory = rtrim($publicDirectory, '/');
          $this->configurationFile = $configurationFile;
          ...
      }

------
sixothree
There are plugins that reduce the height of "empty" lines such as those with a
single curly bracket. Combined with the suggestions in this article, code is
much easier to read.

~~~
rkagerer
Cool! Can you suggest any of your favorites for popular IDE's?

------
perl4ever
I always thought curly (open) braces should be on the left on their own line,
and in my mind, it's kind of like a corollary to Fitt's law applied to eye
tracking instead of mouse movement.

[https://en.wikipedia.org/wiki/Fitts%27s_law](https://en.wikipedia.org/wiki/Fitts%27s_law)

