[erlang-questions] Robustness problems when using records [WAS: Re: Question/Alternative on Frames Proposal [Warning: Long]]
Sat May 19 20:32:34 CEST 2012
We are making use of Ulf's exprecs module for this precise reason.
> Date: Sat, 19 May 2012 17:26:01 +0200
> From: kostis@REDACTED
> To: erlang-questions@REDACTED
> Subject: [erlang-questions] Robustness problems when using records [WAS: Re: Question/Alternative on Frames Proposal [Warning: Long]]
> On 05/18/2012 02:21 AM, Tom Parker wrote:
> > ....
> > Where I think we would vehemently agree: I expect Erlang to be robust.
> > That's why I'm even here. An issue with records where you can compile
> > two files (using the same .hrl) and end up with a result that (a)
> > compiles, (b) doesn't produce an error and (c) produces the wrong
> > answer... is a serious issue. It distinctly shows the shortcomings of
> > records.
> Not really related to the frame discussion, but I would like to point
> out that the above statement is wrong. The situation you describe does
> not show shortcomings of records; instead it shows shortcomings of
> programming with .hrl files and without an appropriate 'make'-like
> utility to track dependencies between files.
> Records are not without problems, but IMO this is not one of them. This
> is a problem of using .hrl files and choosing to program in a way which
> is not disciplined and thus error prone. There is a very simple way of
> avoiding this problem that IMO is a very nice way of programming: Use
> records as abstract data types and have them in a single module that
> exports appropriate getters and setters for manipulating fields of the
> record. If, for whatever reason, you do not like this way of using
> records and want the ability to perform pattern matching and field
> extraction in more than one module as you do today with records, better
> make sure you use an appropriate Makefile (or equivalent) for compiling
> your application. It's not the fault of record syntax if you do not use
> such a mechanism! (Makefiles are technology of the 70's after all...)
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions