On 5/1/2020 10:43 AM, Paavo Helde wrote:
> 01.05.2020 19:45 red floyd kirjutas:
>>
>> I have a codebase written in c90. We have a once in a lifetime
>> opportunity to refactor, rearchitect, and rewrite. As such, we
>> are going to rewrite in C++.
>
> Having an opportunity is not a sufficient reason to justify a rewrite
> which will inevitable introduce new bugs and destabilize the code base
> (unless you have a pretty decent unit test coverage).
>
> A valid reason for a rewrite would be a need to significantly expand the
> system later. For that it would help if the existing codebase is written
> in ways compatible with extensions (abstract base classes, std::function
> callbacks, etc). C++03 is actually pretty good for building such
> infrastructure.
>
> However, if you are going to phase out the old platform anyway soon,
> will it benefit at all from this rewrite? If not, then it should be left
> to use the C solution.
>
> So, the correct answer depends on the actual reason of the rewrite which
> you have not disclosed. If this reason is valid also for the old
> platform you should rewrite the codebase in C++03 and move on to C++11
> later. If the reasons of rewrite do not apply to the old platform you
> should leave the old platform to the existing C solution and upgrade the
> rest of the system directly to C++11 (or later) as C++ programming has
> become much more convenient and safer with C++11.
Thanks, Paavo,
I understand your concerns, and am normally a huge proponent of the "if
it ain't broke, don't fix it" approach. However, I believe that it is
"broke".
The platforms currently share a common codebase. The code has become so
fragile, to the point that we are afraid to fix any bugs, because we are
worried that touching $X will break $Y. It's an accumulation of fifteen
years of ad hoc patches. This is ancient legacy code.
We also have some internal framework code that we use, but it's very
rudimentary, and doesn't support all the features we need, which has led
to some very ugly and fragile hacks. The latest version of the
framework, which includes fully fleshed out versions of the features
that we hacked, requires C++.
In all fairness to our management, they are giving us a reasonable
amount of time to do the up front design work.
The main question here was assuming that we are redesigning in C++ --
which, from signs given by management, appears to be a fait accompli --
Is it worth it to design in C++03, and later migrate to C++11, when the
users of the older platform have migrated to the newer platform? What
are people experiences in moving from C++03 to C++11 (or any modern
variant), and what is the level of effort involved?
-- red floyd