I’m developing a big scientific computation program in C++ and I have many functions that perform some mathematical magic on the data set I import to the system. I’ve implemented all these functions inside a class, say Mathematics_core, but my gut says that coding classes that big is not a good idea.
However to make code readable and maintainable I’m also implementing centralized logging and will implement other all-encompassing infrastructure as needed.
Is it a good idea to encapsulate a toolbox as a class or is it better to keep them different, small functions.
Thanks a lot!
If they all work on the same set of private state (e.g. the first parameter of every function is
data&) then a class may be appropriate.Otherwise, keep them free functions. Use a namespace to group them together.