coding style - Maintaining Maximum Line Length When Using Tabs Instead of Spaces? -


style guides various languages recommend maximum line length range of 80–100 characters readability , comprehension.

my question is, how people using tabs indentation comply line length limits? because, if length of tab set 2 in editor, same code over 80 characters long in else's editor tab length set 3/4/6/8.

some suggest mentally see tab length @ 8 characters. isn't realistic , won't let me focus on programming i'd have check every other line.

so, how (if use tabs in code) it?

almost languages have convention tab size. projects have convention tabs size well, usually (though not always) same language's tab size.
example, ruby 2, python & php 4, c 8, etc.

sticking project's tab length, or language tab size if there no obvious project tab size, far sane thing do, since people use, except perhaps few.
ability set different tab size largest advantage of using tabs instead of spaces, , if user wants deviate standard, that's fine, there no reasonable way also comply maximum line length in every possible situation.

you can compare web sites; they're designed 100% zoom level. zooming in or changing font size works, minor things may break. it's practically impossible design every possible zoom level & font size, artefacts accepted.

if want make sure code complies both line length and tab size, should use spaces, , not "real" tabs. personally, feel these guidelines that: guidelines; , not strict rules, don't think matters much. other people's opinion differs on matter, though.

personally, tabs, number of reasons not important now, only deviate standard temporarily, when editing heavy-nested code more clarity block i'm editing.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -