Re: C++ implementation for C API ---- converting legacy C code to C++
- From: Michael Feathers <mfeathers@xxxxxxxxxxxxxxxx>
- Date: Thu, 25 Aug 2005 00:06:12 GMT
H. S. Lahman wrote:
Responding to Masood...
In this day and age, you never say no to any work that is thrown at you ---- so when I was offered this short-term contract to convert legacy C code to C++, I did not say no. Personally I believed that it was a somewhat futile exercise since one of the main requirements was for the existing API (a functional interface written in C) to remain the same. I would have much rathered that the mandate be ab-initio, but that was not the case here. My client had a bad experience with OO, and they wanted to re-tread this path very very carefully. They were convinced that a "phased approach" to OO worked much better for them.
I basically agree with Nolan. Don't convert the C code; rewrite in C++ from the ground up.
That's fine if you wrote the code or feel that you understand it well, but the world is littered with half-done replacement projects that people where people thought that the understood the original system. It can be done, but often a better way of going is to introduce enough OO in the code base to get tests in place then you can refactor or replace pieces as necessary.
Michael Feathers author, Working Effectively with Legacy Code (Prentice Hall 2005) www.objectmentor.com .
- Follow-Ups:
- Re: C++ implementation for C API ---- converting legacy C code to C++
- From: H. S. Lahman
- Re: C++ implementation for C API ---- converting legacy C code to C++
- References:
- Re: C++ implementation for C API ---- converting legacy C code to C++
- From: H. S. Lahman
- Re: C++ implementation for C API ---- converting legacy C code to C++
- Prev by Date: Re: precondition and postcondition
- Next by Date: Re: chooses not to generate code at all
- Previous by thread: Re: C++ implementation for C API ---- converting legacy C code to C++
- Next by thread: Re: C++ implementation for C API ---- converting legacy C code to C++
- Index(es):
Relevant Pages
|