Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sago
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
58 ms
·
601.
▲
by
sago
11y ago
Thanks, its a good point. I've only played with swift, but I've written a fair amount of objective C, and I didn't put 80 cols in coding standards for my company for that. We got away with that because the environment was fix
602.
▲
by
sago
11y ago
Thanks again. I agree, I've written a lot of code that would be clearer in 85 cols than 80, and some code that would have been clearer in 160 cols too. I think we're agreeing mostly. The problem with 'ish' is that I see
603.
▲
by
sago
11y ago
Right, but again, can you see you've just gone abstract and handwavey. I'd also hate to read code where every other line is broken midway through an expression. Can you give an example of code that 80cols would force that on, whic
604.
▲
by
sago
11y ago
Sorry, I know that putting code up is an invitation for people to pick at the wrong feature, so I realised I was being churlish. But I think these things do have to be addressed with examples. There are few people willing to put an actual e
605.
▲
by
sago
11y ago
Thank you. Why is 3 stupid? That would be my preference. It is clear, simple and gets compiled away (in many cases). I alias in variables frequently, to make things more explicit. For example, I might write iterations = 300 for _
606.
▲
by
sago
11y ago
Right, I can fit 2x100 cols, or 3x80 cols + a project view. So I can see my code, its tests, and either the shell (i.e. test results, ipython, debugger, tail -f logfile) or a web browser for documentation. Is that junk? How many of your lin
607.
▲
by
sago
11y ago
You mean this_is_my_very_long_variable_name = ( this_is_one_variable_that_goes_into_calculating_it + this_is_another_variable_that_needs_considering) The issue wasn't the fact that some expressions are longer
608.
▲
by
sago
11y ago
How impressive of you.
609.
▲
by
sago
11y ago
Can you give an actual example of some well-written Python code that you can't fit maxExchangeBufferLengthBytes in? It's a bit handwavey otherwise. I'm also a long-names fan, sometimes I go overboard, but in 20 years I'v
610.
▲
by
sago
11y ago
Right, and that means we can have more code on screen, and docs and tests, and shell. Where is the rule that you have to have one window open at a time? That's the real throwback to terminal interfaces. The number of programmers I se
611.
▲
by
sago
11y ago
Right, I have a pair of 1920s portrait so I can have more drops on my desktop, but on my 17inch MBP, more than 3 drops is too small for my middle-aged eyes. As the commenter above stated, he found considerably less than 1% of his lines requ
612.
▲
by
sago
11y ago
One thing I find that makes a big difference is using the PEP8 indentation rules for writing lines of the form variable = some_function((some nested expression that is very long and needs to wrap)) as
613.
▲
by
sago
11y ago
Why not follow pep 8's indentation rules: def this_is_a_function(*args, **kws): def this_is_a_helper_function( arg1, arg2='this line is indented 12 chars!'): this_long
614.
▲
by
sago
11y ago
In your average code, what proportion of lines of code are > 80 cols?
615.
▲
by
sago
11y ago
'Stuck with'? I don't think we're stuck with anything. I think 80 cols is a very practical width. Most lines in code that is well structured and simple are less than 80 cols wide. Lines that require more than that can be
616.
▲
by
sago
11y ago
So set up at 120, and then look at someone's code that's used 128 consistently. And then reformat for those few lines that went that long. See the point? You can't standardise based on what you are fond of. That's the po
617.
▲
by
sago
11y ago
One little quibble in an excellent talk: 80 cols exists for a reason. It means people don't have to lay out their editor and shell to match your code. Your editor can be set to 80 col, your shell can too, and then you can leave it and
618.
▲
by
sago
11y ago
Thanks, I'd not seen that :) I was following 'Hollywood Plotting Cliches', seems the screenwriters of that movie have the same book. I like my heist movies with fewer gunshots though, even the trailer left me cold.
619.
▲
by
sago
11y ago
Flip the plot and make it a heist movie. Movie opens with Chinese cyber-ops lab, head honcho brings in McGuffin device, plugs it in. Cut to scenes in US of machines being compromised, data, leaking, cars stopping, TV broadcasts being contro
620.
▲
by
sago
11y ago
Wow. I get the 'I want to climb Everest' idea of seeing if something can be done, and all props to mountaineers who make it, but this article reads as if the author is advocating this approach. Which would be a staggering waste of
621.
▲
by
sago
11y ago
The KS Terms are a little more nuanced. The 'refund' stipulation, for example, only says that they must refund any 'remaining' money, not that they must provide a full refund. And there are several criteria that a projec
622.
▲
by
sago
11y ago
Yes, if you center vertically with a flex-box, and you aren't doing anything weird with margins or overflow, and that's the only thing you do with it, you'll get non-centered results on IE8-9. Not a problem. But if you'r
623.
▲
by
sago
11y ago
And if they can't upgrade, or won't, or don't want to, or don't trust you to tell them to install something? We went through this years ago with IE6, there were always plenty of devs with variations of "screw '
624.
▲
by
sago
11y ago
The market share varies dramatically by niche. If you're running sites aimed at developers, you'll get very different results to a site aimed at teens on mobile, or one aimed at large blue-chip corporates. Supporting IE < 11 sh
625.
▲
by
sago
11y ago
I suspect I'm just not in the group of people for whom it is relevant any more. Way back I was optimising for console hardware when that hardware was quite rudimentary. Now the hardware is much more sophisticated, I don't need it.
626.
▲
by
sago
11y ago
A dismissive dev's 'legacy' browser, is 25% of actual web users. You can dismiss them as legacy if you like, but there isn't a minimum age before you get told your site sucks because a quarter of people get crap when the
627.
▲
by
sago
11y ago
Really? You don't think his kid's peers might not have the latest IE at home? Lot's of them will be on mobile, true (though some of them will be on Android's pre 4.4 browser, which also doesn't support it fully), bu
628.
▲
by
sago
11y ago
It'll be a while, sadly. IE8-10 are still up to 25% of the browsers[0] (caniuse puts them much lower, which isn't surprising for sampling dev oriented sites). IE10 (5% of that) needs a different syntax, and 8-9 don't support
629.
▲
by
sago
11y ago
That's been my experience too, not just of Duff's device but in general with trying to unroll loops. There may have been a point where it was practical (although early in my career I didn't do the profile-first-optimise-later
630.
▲
by
sago
11y ago
Seems an odd example: any code with a multiline comment can have the same issue. That's nothing to do with the strangeness of Duff's device. It would work the same in a series of function calls or calculations. And even then it is
More ›