G
Grahamo
Hi,
I'd like to get the opinion of this knowledgable group.
Basically we have 100 billions lines of legacy code that were written
in 1930. Hence there are no stl containers, no std::strings and we're
waaaaay back in the early days of C++. (OK I exaggerate just a little
but you get the drift).
We have a homegrown string class that behaves much like std::string,
call it ourString. ourString behaves much like std::string except that
it has a whole lot of extra methods defined. It inherits from a base
"Object" class a la java.
Object
^
|
String
Now I would like to see if I can get some improvements over the
existing code by using std::sting instead. If this is in place then I
get all the advantages of compiler optimisations and it brings us one
step closer to using stl and the newer features of C++. I can use stl
altorithms to implement the required methods on the class and reap the
advantages our that. i.e. speed and cleaner code.... no need to
reinvent the wheel etc.
My question is this. Is it worth my while embarking on this task? I
mean if I do write a class that encapsulates std::string and provides
the additional methods our custom String class defines, can I really
expect to see improvement. I would have thought yes. The additional
methods defined in the existing OurString will be implemented using stl
algorithms and I will be a little closer to the "stl way".
Or should I let sleeping dogs lie? Assuming the implementation will be
fine, is the net gain here worth the effort?
thanks much
GrahamO
I'd like to get the opinion of this knowledgable group.
Basically we have 100 billions lines of legacy code that were written
in 1930. Hence there are no stl containers, no std::strings and we're
waaaaay back in the early days of C++. (OK I exaggerate just a little
but you get the drift).
We have a homegrown string class that behaves much like std::string,
call it ourString. ourString behaves much like std::string except that
it has a whole lot of extra methods defined. It inherits from a base
"Object" class a la java.
Object
^
|
String
Now I would like to see if I can get some improvements over the
existing code by using std::sting instead. If this is in place then I
get all the advantages of compiler optimisations and it brings us one
step closer to using stl and the newer features of C++. I can use stl
altorithms to implement the required methods on the class and reap the
advantages our that. i.e. speed and cleaner code.... no need to
reinvent the wheel etc.
My question is this. Is it worth my while embarking on this task? I
mean if I do write a class that encapsulates std::string and provides
the additional methods our custom String class defines, can I really
expect to see improvement. I would have thought yes. The additional
methods defined in the existing OurString will be implemented using stl
algorithms and I will be a little closer to the "stl way".
Or should I let sleeping dogs lie? Assuming the implementation will be
fine, is the net gain here worth the effort?
thanks much
GrahamO