Instead of assumptions, lets say creativity exercise (or "brainstorm", "benchmark" if you are a market oriented person) aimed at finding breaking errors as soon as possible and avoid them.
Sure thing but TS hasn't mention anything in that regards. Personally I'm in lazy mode by default
So, my suggestion is to use configuration files (ini, json, yaml, whatever) to save list like machine configurations.
...
Depends on the use case but you have a point.
You mentioned "choosing the right type". You suggested pointers, correct? Would you choose them for performance?
The remark about the right type was about declaring the right types and make use of the right types as there is quite a difference between static and dynamic arrays. Also note that TS' example snippets are riddled with errors.
I've opted for a pointer for two reasons:
- to stay as close to the answer that TS seems to be looking for
- These parameters/records might be static, though the proposed solution allows for them to be expanded.
I am aware that your suggestion(s) are more future proof and flexible, e.g. there is nothing wrong with it and perhaps even preferable.
The lack of crystal balls might have influenced my answer
I am kind of afraid of pointers. I know they are powerful. But I am used to break my code use them .
Under the hood your dictionary solution uses even more pointers but I digress.
There are use cases where pointers are simply quicker to setup and/or work with (jump tables comes to mind).