I'm new in my current company and working on a project written by my direct team lead. The company usually doesn't work with C++ but there is productive code written by my coworker in C/C++. It's just us who know how to code in C++ (me and my lead, so no 3rd opinion that can be involved).
After I got enough insight of the project I realized the whole structure is... special.
It actually consist of a single compilation unit where the makefile lists as only source the main.hpp
.
This headerfile then includes all the source files the project consists off, so it looks like a really big list of this:
#include "foo.cpp"
#include "bar.cpp"
While trying to understand the logic behind it and I realized that this is indeed working for this project, as it's just an interface where each unit can operate without accessing any other unit, at some point I asked him what are the reasons why he did it this way.
I got a defensive reaction with the argument
Well, it is working, isn't it? You are free to do it your way if you think that's better for you.
And that's what I'm doing now, simply because I'm really having trouble with thinking into this structure. So for now I'm applying the "usual" structure to the implementation I'm writing right now, while doing only mandatory changes to the whole project, to demonstrate how I would have designed it.
I think there are a lot of drawbacks, starting with mixing linkers and compilers jobs by own project structure can't serve well, up to optimizations that will probably end in redundant or obscure results, not to mention that a clean build of the project takes ~30 minutes, what I think might be caused by the structure as well. But I'm lacking the knowledge to name real and not just hypothetical issues with this.
And as his argument "It works my way, doesn't it?" holds true, I would like to be able to explain to him why it's a bad idea anyway, rather than coming over as the new nit picky guy.
So what problems could actually be caused by such a project structure? Or am I overreacting and such a structure is totally fine?