Remix.run Logo
camkego 5 days ago

The article says "I think the biggest factor is that any rewrite of an existing codebase is going to yield better results than the original codebase.".

Yeah, sorry, but no, ask some long-term developers about how this often goes.

ryao 5 days ago | parent | next [-]

It depends on the codebase. If the code base deserves to be a case study in how not to do programming, then a rewrite will definitely yield better results.

I once encountered this situation with C# code written by an undergraduate, rewrote it from scratch in C++ and got a better result. In hindsight, the result would have been even better in C since I spent about 80% of my time fighting with C++ to try to use every language feature possible. I had just graduated from college and my code whole better, did a number of things wrong too (although far fewer to my credit). I look back at it in hindsight and think less is more when it comes to language features.

I actually am currently maintaining that codebase at a health care startup (I left shortly after it was founded and rejoined not that long ago). I am incrementally rewriting it to use a C subset of C++ whenever I need to make a change to it. At some point, I expect to compile it as C and put C++ behind me.

glouwbug 4 days ago | parent [-]

Data structures like maps and vectors from the standard library are still incredibly useful and make a fantastic addition to C if your focus relies on POD types, though if real time performance with heap cohesion is a problem then you’re right to go pure C

dayvster 5 days ago | parent | prev [-]

Hi author of the article here.

I've been a software developer for nearly 2 decades at this point, contributed to several rewrites and oversaw several rewrites of legacy software.

From my experience I can assure you that rewriting a legacy codebase to modern C++ will yield a better and safer codebase overall.

There are multiple factors that contribute to this, such one of which is what I reffer to as "lessons learnt" if you have a stable team of developers maintaining a legacy codebase they will know where the problematic areas are and will be able to avoid re-creating them in a rewrite.

An additonal factor to consider is that a lot of legacy C++ codebases can not be upgraded to use modern language features like smart pointers. The value smart pointers provide in a full rewrite can not be overstated.

Then there's also the factor that is a bit anecdotal which is I find that there are less C++ devs in general as there was 15 years ago, but those that stayed / survived are generally better and more experienced with very few enthusiastic juniors coming in.

I'm sorry you did not enjoy the article though, but thank you for giving it your time and reading it that part I really appreciate.