列宽为80在2019年是否有意义?

Does Column Width of 80 Make Sense in 2019? Does column width of 80 make sense in the age of small monitors? It also makes your code unnecessary long, then it actually is. I would say that consistency is nice and you must go for it but 80 or even 100 is too short. Our modern widescreen high definition LCD monitors can easily handle more. It is more readable than the excessive wrapping because I personally find it much harder to read a wrapped line than just seeing the whole.thing in one line.

列宽为80在2019年有意义吗?在小显示器时代,80的列宽有意义吗?它还会使你的代码变得不必要的长,那么它实际上是。我想说,一致性很好,你必须去做,但80甚至100太短了。我们现代的宽屏高清液晶显示器可以轻松处理更多。比起过度的包装,它更具有可读性,因为我个人觉得阅读一个包装好的行要比只看一行的整个.东西难得多。

image

I am Java programmer, blogger on http://javarevisited.blogspot.com and http://java67.com

我是Java程序员,是http://javarevisited.blogspot.comhttp://java67.com的博主。

One of the oldest coding practice is to keep line width 80, and many of us follow it blindly but have you ever thought why we have this practice in the first place?

最古老的编码实践之一是保持行宽80,我们中的许多人都盲目地遵循它,但你有没有想过,为什么我们首先要有这种做法?

I believe it was to make your code more readable in the age of small monitors so that whole content can fit in the screen, or it might have originated from the age of punch card, which was used to be 80 columns wide.

我相信这是为了使你的代码在小显示器时代更易读,以便整个内容可以容纳在屏幕中,或者它可能源于打卡时代,当时打卡的宽度是80列。

This sounds reasonable when we think about those old days but do you think this rule makes sense in 2019?

当我们想到以前的那些日子时,这听起来很合理,但你认为这个规则在2019年有意义吗?

We are now living in the age where most of the developers have got large monitors, which can show up to 180 characters, doesn’t this is wastage of precious monitor space? It also makes your code unnecessary long, then it actually is.

我们现在生活在这样一个时代,大多数开发者都有大屏幕,可以显示180个字符,这难道不是对宝贵的显示器空间的浪费吗?它还会使你的代码变得不必要的长,然后它实际上是。

I first come to know about line wrapping at 80, while reading Oracle Code Conventions for the Java Programming Language, which was last revised at April 20, 1999, which under indentation says

我第一次知道80行的换行,是在阅读1999年4月20日最后一次修订的《Java编程语言的Oracle代码规范》时,其中在缩进部分写道

4.1 Line Length
...

开通本站会员,查看完整译文。

首页 - Wiki
Copyright © 2011-2025 iteam. Current version is 2.144.0. UTC+08:00, 2025-06-29 13:08
浙ICP备14020137号-1 $访客地图$