I am new to my current company and am working on a project written by my direct management. The company usually does not work with C ++, but there is productive code written by my colleague in C / C ++. It is only we who know how to code in C ++ (me and my manual, so there is no third opinion that can be involved).
After I got a good idea about the project, I realized that the whole structure ... is special.
In fact, this consists of a single compilation unit in which the makefile only lists the source main.hpp .
This header file then includes all the source files that the project has been disabled, so it looks like a really big list:
#include "foo.cpp" #include "bar.cpp"
Trying to understand the logic behind it, I realized that this really works for this project, since it is just an interface in which each unit can work without access to any other unit. At some point, I asked him why he did it this way.
I got a defensive reaction with an argument
Well, it works, right? You can do it your own way if you think that is best for you.
And this is what I am doing now, simply because I really have problems with thinking in this structure. Therefore, at the moment I am applying the βnormalβ structure to the implementation, which I am writing right now, making only the necessary changes for the entire project, to demonstrate how I would develop it.
I think that there are many shortcomings, starting with mixing linkers and compilers with the help of our own project structure, that cannot serve well, up to optimizations that probably end up with redundant or obscure results, not to mention that a clean build project takes ~ 30 minutes, which, I think, may be caused by the structure. But I do not have enough knowledge to name real, and not just hypothetical problems with this.
And how is his argument "He works my way, doesn't he?" the truth is, I would like to explain to him why this is a bad idea, and not come as a new seductive guy.
So, what problems can be caused by such a project structure? Or am I overreacting, and is such a structure completely perfect?