Studies on optimal code width?

前端 未结 11 732
滥情空心
滥情空心 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:03

    Maybe the 80 characters is also a good point to avoid these bad getter chains:

    object.getFoo().getBar().getFooBar().get ...
    

    if you limit it to 80 characters, maybe someone would localize these variables and do null check etc, but maybe most programmers would let them wrap in the next row. i don't know

    Beside that, 80 characters are great as starblue mentioned. This should defenitely goes into the coding standards.

提交回复
热议问题