3 ms·
Where a Curly Bracket Belongs
- sixothree 7y agoThere 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 7y agoCool! Can you suggest any of your favorites for popular IDE's?
- rkagerer 7y agoScreens 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 7y agoBTW, 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; ... }
- zzo38computer 7y agoI agree with you. Also some web pages use too big font size (rather than just using the user setting instead), or too narrow text (rather than using the full available width), and that also wastes space on the screen.
- perl4ever 7y agoThere was a time when a big screen was either one vertically oriented page, or two... https://fudzilla.com/images/1988_RadiusFPD.png https://fudzilla.com/images/1988_RadiusFPD.png Also, it wasn't that long ago when I had two cheapo Dell 4:3 monitors at work that both rotated much like the early pivot screens. I used to have one rotated and one not, so I could have a letter-size page, maybe source code, on one and maybe my email or something on the other horizontally.
- deleted 7y ago[deleted]
- perl4ever 7y agoI 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