Is it a best practice to have table_name and record same?

Steve Davis steven.charles.davis@REDACTED
Wed Dec 16 14:56:51 CET 2009



On Dec 16, 6:25 am, "MAthuvathanan Mou." <cowboyma...@REDACTED>
wrote:
> Hi all,
>
> I have record with two parameters like
>
> -record(user, {name, password}).
>
> I am using above record for a user table.
>
> I need to create another table country_code with country and code.
>
> Is it all correct to re-use above record for country_code as well or else do

No.

> I have to create another record like
>
> -record(country_code, {country, code}).
>
Yes.

> Or else, should I create a common record with two parmeters like
>
> -record(two_params, {first, second}).
>
No.
> Which one is good practice?
>
Only the second one.

Consider, for example...

Username: United States
Password: USA

...and all other sorts of confusion.

/s


More information about the erlang-questions mailing list