<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 02/26/2016 06:50 AM, Benoit Chesneau wrote:<br>
<blockquote
cite="mid:CAJNb-9qBg6uhY=01VytYzSa+jOOr2-y5J_yQeZVTABG2cqiXUQ@mail.gmail.com"
type="cite">
<div dir="ltr">Hi all,
<div><br>
</div>
<div>i tends these days to use maps instead of records, so you
dont' have to include a file to retrieve the "schema" but I
wonder if this is a good idea or not. Is there still some
usage for records vs maps? </div>
<div><br>
</div>
<div>- benoît</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
</blockquote>
Records allow you to specify type specification information, while
maps do not. Records are basic and efficient with the number of
elements 100 or less, while maps are great for dynamic use that
doesn't depend on type specification information. So, for process
state information, records provide more information when checking
dialyzer for problems. Records can also provide more checking with
dialyzer when storing database or protocol data (two places where
types are generally important for development).<br>
<br>
For dynamic key/value data, dict can use type specification
information while maps don't, so there can also be motivation to use
dicts instead of maps, even if only switching between the two for
running dialyzer. maps are great for efficient key/value access
though.<br>
</body>
</html>