4 ms·
80-characters-per-line limits should be terminal, says Linus Torvalds
- KirillPanov 6y agoWould be nice if editors displayed lines longer than the terminal width wrapped (like notepad/textpad/etc do for prose) but with the programming-language-appropriate indentation.
- mytailorisrich 6y agoTo me the argument is not only technical. Of course these days a convention based on 80x25 terminals is anachronistic. But there is also a good reason to limit the length of lines for readability and indeed in typography the practice is to limit lines to ~50-70 characters. Personally I try to stick to that when I code because I find it more readable, and it's not the same as automatic line wrapping. In addition, unless you have heavily nested branches or loops with big-ish indentation, you don't often get to 80 characters anyway, which opens another discussion on whether code with 10 levels of nested 'if' or extra long sequences of boolean operators begs to be refactored.
- IcePic 6y agoI guess its not just indentation that matters here, but also if you can compare if strlen(szNotVeryImportantTemporaryStringWithSomeCharsInIt) > ui16MyConstantThatHoldsTheLenIThinkIsSuitable on one line or not, if you are limited to 80 chars at most. If you need your lines to accomplish anything, you can't have variables named like that and then it will look more "cryptic" to some, and "better" to others.
- simonblack 6y agoMy 'personal standard' is 58 lines of 115 characters whenever I launch a new xterm. Even then I often extend the width to 150 or more characters, depending on what I am doing.
- ufo 6y agoPrevious discussion: https://news.ycombinator.com/item?id=23356607 https://news.ycombinator.com/item?id=23356607