Guidance in naming awkward domain-specific objects?
Posted
by
GlenH7
on Programmers
See other posts from Programmers
or by GlenH7
Published on 2012-12-19T16:01:28Z
Indexed on
2012/12/19
23:13 UTC
Read the original article
Hit count: 402
naming
|complexity
I'm modeling a chemical system, and I'm having problems with naming my objects within an enum.
I'm not sure if I should use:
- the atomic formula
- the chemical name
- an abbreviated chemical name.
For example, sulfuric acid is H2SO4 and hydrochloric acid is HCl.
With those two, I would probably just use the atomic formula as they are reasonably common.
However, I have others like sodium hexafluorosilicate which is Na2SiF6.
In that example, the atomic formula isn't as obvious (to me) but the chemical name is hideously long: myEnum.SodiumHexaFluoroSilicate
. I'm not sure how I would be able to safely come up with an abbreviated chemical name that would have a consistent naming pattern.
From a maintenance point of view, which of the options would you prefer to see and why?
Some details from comments on this question:
- Audience for the code will be just programmers, not chemists.
- I'm using C#, but I think this question is more interesting when ignoring the implementation language
- I'm starting with 10 - 20 compounds and would have at most 100 compounds.
- The enum is to facilitate common calculations - the equation is the same for all compounds but you insert a property of the compound to complete the equation.
- For example, Molar mass (in g/mol) is used when calculating the number of moles from a mass (in grams) of the compound.
- Another example of a common calculation is the Ideal Gas Law and its use of the Specific Gas Constant
© Programmers or respective owner