(no title)
AlDante2 | 1 year ago
Particularly in finance, yo need to distinguish between dates and durations, between interest rates and volatility and a host of other business concepts. Using strong user-defined types helps catch errors at compile time. I would have no problem, on a large project, with having every variable (with the possible exception of counters, etc.) being a user-defined type. On small projects, where one developer can comfortably oversee all of the code, the overhead of correctly defining types and their operations might not outweigh the benefits. In user-facing code, for example, UI frameworks don’t use business types. Writing conversion routines to translate user input to a business type can be a disproportionate amount of work for a small project.
No comments yet.