Project

General

Profile

Misc #12277

Coding rule: colum number

Added by ko1 (Koichi Sasada) over 3 years ago. Updated over 3 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
[ruby-core:74926]

Description

Eric proposed that code should be limited in 80 column.
https://bugs.ruby-lang.org/issues/12236#note-1

At today's developer's meeting, I asked how long column is suitable.

  • declaration can over limitation.
  • logic should have some limitation (permit exceptional cases)

This is an survey at today's meeting.

Expected column limitation:
      80 none
     100 2 people
     120 some people
over 120 only ko1

History

Updated by shyouhei (Shyouhei Urabe) over 3 years ago

I was on the meeting. I'm for some line width cap, be they 80 or 120.
It is a good idea to be concise. I'm especially for comments being concise.

However I don't like the idea of indiscreetly line-folding things only because they are long. I'd like to advise refactoring such function so that long lines would disappear. When avoiding long lines makes it less intuitive, they should be left long I believe. C's prototype declaration (especially with many const restrict pointers) is one of such example.

Updated by normalperson (Eric Wong) over 3 years ago

ko1@atdot.net wrote:

Eric proposed that code should be limited in 80 column.
https://bugs.ruby-lang.org/issues/12236#note-1

Not a proposal, just citing existing/common standard:

https://www.emacswiki.org/emacs/EightyColumnRule

For what it's worth, my personal preference is around 64 columns
because I have a short attention span and bad eyesight.
However 80 columns is the common standard, so I manage with 80.

At today's developer's meeting, I asked how long column is suitable.

  • declaration can over limitation.
  • logic should have some limitation (permit exceptional cases)

Longer format error messages are fine if it helps users find
errors with grep. However, output of error messages should
still be wrapped at 80 for compatibility and readability.

Also available in: Atom PDF