[erlang-questions] [ANN] erlang-formatter 1.0.0 (go fmt for Erlang)

Richard A. O'Keefe ok@REDACTED
Wed Aug 31 03:13:40 CEST 2016



On 30/08/16 7:54 PM, Vlad Dumitrescu wrote:
> My take on this is that the first step is to define what the right way
> to format code is, in form of a specification or a test suite to be
> passed by the formatter. A big part of this is to decide if formatting
> should be "indentation only" or "full rewrite" or both - there are
> arguments to be made for each variant. Another one is about how to
> indent (tabs, spaces, how many) and how wide the page is (80 characters
> may feel too narrow for today's monitors, but sometimes code has to be
> read/edited on narrow terminals).

There are four important factors.

(1) Natural language text formatted for ease of human reading
     is formatted in narrow columns.  Newspapers are wide, but
     they use that to pack more narrow columns in, not wider ones.

(2) It is often necessary to view multiple files at once.
     And I don't mean "have in tabs", I mean *VIEW* so that I
     can actually *SEE* the contents I'm working with.
     At the moment, for example, I have two source files and a
     LaTeX file open, and even at 80 columns per window the monitor
     is NOT wide enough to view them without frequent flicking one
     or another to the front.  I should have made the text narrower.

(3) Some people may well be trying to read stuff on tablets.
     Funnily enough, fondleslabs don't come with huge monitors.
     (Me, sometimes.)

(4) Some people may be rich in years and prefer to spend their
     screen area on larger fonts.  (Sticks hand up in air and waves
     it excitedly. Hooray for Cmd-Plus say I.)

I can assure you that due to factors (1), (2), and (4)
I do *not* find 80 characters too narrow on my 27-inch monitor.
When I use an iPad (3) to read stuff, I do not find 80 columns
too narrow there either.




More information about the erlang-questions mailing list