4 ms·
Let me guess... It is hard for you to read long lines or your monitor isn't big enough? You might call that an accessibility thing right? You get what I'm getti
by agentgt 10y ago
Let me guess... It is hard for you to read long lines or your monitor isn't big enough? You might call that an accessibility thing right? You get what I'm getting at. You traded one accessibility that is fairly easy to fix (at worse case you have line wrapping) for one that is almost impossible to fix (zooming and large font don't really help).
- gbog 10y agoReading long lines is also difficult. To me some parts of FE development kind of require deep nesting, e.g. css, but in javascript if you are 4/5 levels deep in the nest (with the "long lines symptom"), then you should do as proposed in the article: split into modules and functions. And sometimes (often?) long lines comes from the bad habit to do 3/4 things in one statement. To me good code does exactly one thing per statement, and except for config or urls, is should not be long.
- agentgt 10y agoYes but like I said before long lines is an extremely easy thing to fix in most PLs (ignoring config of course). You can refactor code so that the line is not as long but you can't refactor indention spacing.
- d--b 10y agoIt's hard for me to read long lines. I don't think 4 spaces makes it easier to know in what scope I'm in when there are a lot of scopes. The amount of white space is a bit overwhelming to me. But you know, it's no big deal, just a matter of taste. Maybe 3 spaces is a better answer, which I guess we'll never know...
- agentgt 10y agoHow long of a line are we talking here? Most coding standards are 80-120 with maybe some at 140. If you are say 4 levels deep the additional characters used over 2 spaces is 8 characters. You got whopping 8 additional characters to make an even longer line of code (code to be interpreted or read) and screwed over the people who need the indenting. If long lines are a problem than just refactor. I agree long lines are hard to read but there is a simple fix. Either refactor or just put in a line feed (or however the PL deal with long lines aka \ for bash or python).
- Sean1708 10y ago> Maybe 3 spaces is a better answer No, tabs is the answer.