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

Vlad Dumitrescu <>
Wed Aug 31 08:44:24 CEST 2016


On Wed, Aug 31, 2016 at 3:13 AM, Richard A. O'Keefe <>
wrote:

>
>
> 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.
> [...]
> 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.


I agree. My argument wasn't that 80 columns is bad or useless, but that
some people might prefer other values. A formatter without any
configuration options is bound to make some people unhappy. So I argue that
the tools should be configurable.

As Bengt and Tuncer pointed at, one may use a standard format when
committing the code, so that the repository has an uniform format, but when
checking out would like to see the code differently. It would be a waste to
use two different tools for that, instead of one with different
configuration. The default format should be something that most people can
agree upon, because my guess is that after a while only a few will keep
converting the code back and forth when editing it.

best regards,
Vlad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160831/1e41b84e/attachment.html>


More information about the erlang-questions mailing list