[erlang-questions] Erlang Style Guide

Jack Moffitt <>
Wed May 18 16:16:08 CEST 2011


> I daresay, if ROK would publish his standards, I’d probably follow them.
> He’s the guy who puts punctuation at the beginning of a lot of lines.  The
> way it is now, I just go with what looks good (which means punctuation at
> the end of the line), because I can’t be bothered coming up with rules to
> follow, but I’m pretty sure ROK has in his head some self-consistent system
> that makes sense and makes coding easier.

+1 for people publishing these. I don't everyone will agree on a
single set, but having a few of these to point to would help I think.
Is there not an OTP coding guidelines that OTP contributors must
follow?

Currently I let the Emacs mode decide what is best, but I often
disagree with it. I've been considering changing forms like:

Something = case mod:func(Args) of
                        foo ->
                            ok;
                        bar ->
                            not_ok
                  end,

to:

Something = case mod:func(Args) of
    foo ->
        ok;
    bar ->
        not_ok
end,

which is more what I'm used to from JavaScript.

jack.



More information about the erlang-questions mailing list