News for hackers. Stuff that matters.
Re:Why Swift Guard Should Be Avoided by SuddsMcDuff on Saturday January 02, 2016 @06:52AM (#10825926)
My general rule of thumb is that a function should be small enough to be entirely visible on screen without having to scroll. It's dependent on screen resolution & font size of course, but I find that having to scroll down adds some cognitive overhead to understanding the whole of a function.

Following this line of thought I've become a lot more precious about vertical whitespace & I've adopted BSD style curly braces.

Re:Why Swift Guard Should Be Avoided by moonshinefe on Saturday January 02, 2016 @07:29AM (#10825997)
Fair enough. I always found horizontal scrolling more difficult than vertical though.

But, for instance, the Python PEP8 spec saying 80 characters max, I think is kind of ridiculous these days. Who is programming on their phone, tablet, or 90s computer that can't handle 120 characters these days?

Edit: I just mention 120 as PyCharm's PEP8 linter 'erroneously' checks that max rather than 80

Re:Why Swift Guard Should Be Avoided by SuddsMcDuff on Saturday January 02, 2016 @08:21AM (#10826107)
Agreed horizontal scrolling is equally disturbing. We do live in an age of wide-screen monitors though so I find vertical whitespace more precious. I would go as far as saying that 160 horizontal chars is a more sensible guide these days.