atoms used as status info, 'constants' etc

Steve Davis steven.charles.davis@REDACTED
Tue Aug 18 10:24:38 CEST 2009


Dave,
Here's my 2c on this one.

1) reuse atoms that are also used as return values from other modules
in the OTP platform where it makes sense,
2) try to name the atoms cleverly for best grok-ability
3) if you return an unpredictable number of status values, then use
"string" status values
3a) and... by "string" then probably it is "better" to use a binary
representation of the text, e.g. <<"my unpredictable return value">>

Regards,
/sd

On Aug 18, 2:27 am, Dave Pawson <dave.paw...@REDACTED> wrote:
> I'm using atoms as status value returns from functions.
> Is there any 'best practice' in this area?
>   In other languages I might keep them together as defined constants
> or some such?
>
> TIA
>
> --
> Dave Pawson
> XSLT XSL-FO FAQ.
> Docbook FAQ.http://www.dpawson.co.uk
>
> ________________________________________________________________
> erlang-questions mailing list. Seehttp://www.erlang.org/faq.html
> erlang-questions (at) erlang.org


More information about the erlang-questions mailing list