Eclipse 在编辑窗口显示打印边距(换行参考线)

来源:互联网 发布:mysql @变量 编辑:程序博客网 时间:2024/05/22 06:45

为什么会要求每行代码不超过80个字符?

  1. 有说古时候的显示器一行只能显示80个字符,估计那时候横向分辨率只有480px。
  2. 现在的宽屏显示器,可以并排显示两个代码窗口进行代码比较。
  3. 可以让代码保持紧凑、简单,提高可读性。
  4. Python 编程风格指南“PEP 0008 -- Style Guide for Python Code”(https://www.python.org/dev/peps/pep-0008/#maximum-line-length)要求每行不超过79个字符:The Python standard library is conservative and requires limiting lines to 79 characters (and docstrings/comments to 72).
  5. Google Java 编程风格指南(原文要翻墙:http://google-styleguide.googlecode.com/svn/trunk/javaguide.html,译文将就看:http://www.hawstein.com/posts/google-java-style.html)要求每行代码不超过80或100个字符。

Window -> Preferences -> General -> Editors -> Text Editors: 勾选 Show print margin


0 0