Studies on optimal code width?

前端 未结 11 648
滥情空心
滥情空心 2021-01-29 18:42

If you enable the \"View Right Margin\" in your IDE of choice, it is likely that it will default to 80 characters. I tend to change it to 120 for no reason other than it was th

11条回答
  •  有刺的猬
    2021-01-29 19:16

    To the best of my knowledge the 80 character is used as a coding standard to maintain compatibility with command line editors (default terminal width is typically 80 characters). With modern IDEs and large screen resolutions 80 characters is probably not "optimal", but for many developers maintaining readability in the terminal is essential. For that reason it is not likely that 80 character width will be replaced as the de facto standard for code width anytime soon. And to answer your final question, yes, code width as well as any other characteristic which will affect your code's readability should be addressed in your coding standards.

提交回复
热议问题