top | item 42190029

(no title)

lcuff | 1 year ago

>at a comfortable 10 point font size.

How lovely for you. As someone with significantly impaired vision, even when corrected, I have my font size set to 18, thank you very much. A coding standard that assumes a 10 point font size would violate the Americans with Disabilities Act's 'reasonable accommodation' mandate. I wasn't pushy enough to act on it, but it sure pissed me off when my fellow team members blew off my complaints about how we formatted our code. (Including two space indents...grrrr.) My worse than 20/200 vision (Can't see the big E on an eye chart) lets me see code, but legally, I'm blind in one eye.

I admit, it's a classic 'no perfect solution' scenario, because I like very long variable and function names. I write tiny functions (5-10 lines) because they only need one or two levels of indent. Some programmers I've worked with really dislike such small functions.

discuss

order

nwiswell|1 year ago

> A coding standard that assumes a 10 point font size would violate the Americans with Disabilities Act's 'reasonable accommodation' mandate.

Would it? You can still set the size to 18, you just might have to scroll or line wrap. That's a mild inconvenience, not "inaccessible".

hsbauauvhabzb|1 year ago

I try and maintain 100 char width in most code, because I feel like it makes people more concise.

I’m curious on several statements you made, please take these as genuine and well intended questions:

what’s wrong with two space indent?

Would a bigger monitor with higher DPI solve some of these issues?

Have you considered a horizontal scroll wheel or similar? I think this is a Band-Aid to a bad pattern, but may be a legitimate option

You may appreciate python PEP8, which discusses things like highly nested code and functions being considered bad. I first followed PEP8 kicking and screaming, but I think it forced me to remove some bad programming habits and I now lint check my code habitually.

lcuff|1 year ago

Sorry to take so long to answer. Good questions. 2 space indents, in (say) 30 line functions, get harder to discern the more indent levels. This problem is exacerbated by bad eyesight.

Bigger monitor with higher DPI does help, yep.

Horizontal scroll: I suppose it could help. The more immediate tradeoff tends to be that I use a terminal full width on a large monitor when needed, and tolerate the fact that I'd prefer to have space to have a web browser open on the same screen.

I'm a big fan of Sandy Metz, who advocates 5 line routines. In Python and Ruby, this is possible, and the indentation problems go away. In C, it's more of a challenge.

zamadatix|1 year ago

So long as everyone adopts a consistent base it doesn't matter if the font ends up with the number 2 or 200, the actual size that'll appear for each user is tuned to the overall visual scale that they like best on their device.

It's one of the things that drives me nuts about shared Excel spreadsheets. Rather than just zoom in or out someone will mess with the font size to make it fit their screen and suddenly it's just screwy enough for someone else with different eyes on a different monitor when then goes to change... you get the idea.

lmm|1 year ago

> A coding standard that assumes a 10 point font size would violate the Americans with Disabilities Act's 'reasonable accommodation' mandate.

Would it? I don't think having to make all my lines 44% shorter than they should be is reasonable; that's going to be a massive impingement on productivity.

lcuff|1 year ago

44% shorter: is your claim that limiting line lengths to 80 or 100 characters is going to 'massively impinge' your productivity? That seems unlikely to me.

CrimsonRain|1 year ago

Write tiny functions because of aesthetics; not because the flow calls for it ಠ_ಠ