是否有一个有效的原因,在代码文件中强制使用最大宽度为80个字符,这个日期和年龄? [英] Is there a valid reason for enforcing a maximum width of 80 characters in a code file, this day and age?

查看:283
本文介绍了是否有一个有效的原因,在代码文件中强制使用最大宽度为80个字符,这个日期和年龄?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

认真。在22英寸的显示器上,它只能覆盖屏幕的四分之一,我需要一些弹药来消除这个规则。

Seriously. On a 22" monitor, it only covers maybe a quarter of the screen. I need some ammo to axe down this rule.

编辑:我不是说不应该是一个限制;我只是说,80个字符是非常小的。

I'm not saying that there shouldn't be a limit; I'm just saying, 80 characters is very small.

推荐答案

代码到80(或79)列最初创建,以支持人们在80列哑终端或80列打印输出上编辑代码,这些要求现在已经消失了,但仍然有效的理由保持80列规则:

I think the practice of keeping code to 80 (or 79) columns was originally created to support people editing code on 80-column dumb terminals or on 80-column printouts. Those requirement have mostly gone away now, but there are still valid reasons to keep the 80 column rule:


  • 在将代码复制到电子邮件,网页和书籍时避免包装。

  • 多个源窗口并排或使用side-by-side diff查看器。

  • 提高可读性。窄代码可以快速读取,而不必从一侧扫描到另一侧。

我认为最后一点是最重要的,虽然在过去几年中显示器的尺寸和分辨率都有所增长, >眼睛没有。

I think the last point is the most important. Though displays have grown in size and resolution in the last few years, eyes haven't.

这篇关于是否有一个有效的原因,在代码文件中强制使用最大宽度为80个字符,这个日期和年龄?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆