tirzanello wrote:
I'm "converting" a C program into C++.
Why?
Before writing down code, I want
to redesign the whole structure in OO, I can do it with the old
pencil&paper but I'm searching a program to make more easy this step,
nothing complex, just something easy to use and to understand that can
give an overview of classes structure. Do you have any hint?
Nobody designs a program from scratch like that - even if it's a rewrite of
a pre-existing program.
The best technique is to alternate tiny design phases with tiny code (and
test) phases. Each step will cross-verify the other steps. That forces your
design to be implementable, useful, and testable.
If the current program has a design - even a C-style one - then it is far
above any "new UML design" you could draw. Your C program, presumably,
works. Any UML design you make might be pretty, but it _won't_work_ for a
very long time. You don't need that burden; you need to rapidly return value
to whoever hired you.
Please carefully reconsider why you want to rewrite this. If the answer is
"personal education", then by all means dive in and have fun. Use any
technique that tickles you.
If the answer is "to maintain the value of this code, while adding new
features", then read /Working Effectively with Legacy Code/ by Mike
Feathers, and change the code as incrementally as possible.
One important (and mercifully reversible) change you can start now is simply
recompiling the code as C-style C++ code. You may get syntax errors (and may
get the occassional crash). Forcing the code over this hump will improve it,
because C++ can be used more typesafely than C.
--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!