Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

While it might be true that 120 chars are ideal for screens [0], the consensus is an optimal line length is roughly 50 to 75 chars. [1]

[0] https://www.viget.com/articles/the-line-length-misconception...

[1] http://webtypography.net/2.1.2



Yeah but line formatting usually includes white space indentation in the calculation of the line length, I don't know whether you can 1:1 translate findings from normal text paragraphs like that. With linted code the actual relevant length might only be 20 characters, maybe we need some smarter linters.


That seems to apply for blocks of text. I don't know that the same would hold true for code.


What is code if not blocks of text


Sentences feel different from lines of code. "One statement doing one thing per line of code" seems a reasonable idea but "one sentence per line of text" seems a bit absurd.


A tree of nodes.


And we model sentences the same way


Often significantly more indented.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: