[erlang-questions] PropEr after test clean up

Hynek Vychodil vychodil.hynek@REDACTED
Wed May 27 11:25:55 CEST 2015


Well is so uncommon and subjective that this approach even make it to the
http://www.erlang.se/doc/programming_rules.shtml#HDR13

Making fixtures, keeping related things together and using processes for an
initiating clean state are best practices in Erlang. PropEr doesn't follow
those principles. Sentences like " the whole issue is about something which
is not functional in the first place" is not helping. "If you find it
disturbing, then simply write functional code." I would like to, but I
found this issue dealing with digraph module form OTP stdlib!

On Tue, May 26, 2015 at 9:03 PM, Kostis Sagonas <kostis@REDACTED> wrote:

> On 05/26/2015 08:02 PM, Hynek Vychodil wrote:
>
>> You just can't make simple and reliable clean up embedded in wrapper
>> macro or function. You always have to make explicit ugly procedural code
>>
>> Objs = init(),
>> run(),
>> delete(Objs),
>> test()
>>
>> You simply can't make nice clean functional or function like wrapper. It
>> is ugly, repetitive, error-prone, procedural code. This is wrong.
>>
>
> I will not comment on the "ugly", "repetitive", "error-prone" and "wrong"
> characterizations.  As I wrote in my previous message these are not defined
> objectively.
>
> However, please realize that the whole issue is about something which is
> not functional in the first place!  Under this prism, I am not very
> surprised you cannot, or at least find it difficult to, find a "clean
> functional" solution...  I would even argue that it is better this way.
> (I.e., that there is a "penalty" for wanting to test non-functional code.
> If you find it disturbing, then simply write functional code.)
>
> Kostis
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150527/2fba9131/attachment.htm>


More information about the erlang-questions mailing list