Or something like 2 days. You didn't need to rewrite it, just to make it compile. And from then you can use all C++ niceties in new code. No need to touch the old code if it works.
That is, until you want to start using STL classes as data members in your C structs…
Actually, it shouldn't be a problem since in C++ class and struct are fundamentally the same thing, with distinction on defaulting to public in struct s case.
Not quite true. It has to do when an object is created using said struct. The proper constructors do not get called for your STL objects as they would in a class.
That's why I suggest using some language that's actually GOOD with text manipulation, if you're going to be rewriting things anyways. C -> C++ buys you some things, but C++ really isn't all that good at text manipulation. You can use std::string, but you'll still find yourself having to muck about with pointers and whatnot as you invoke system calls.
Why not use a language where strings are a base type, and that lets you easily manipulate them without counting bytes and converting back and forth all the time?
There are large chunks of most of the Dikurivative codebases that would be entirely unneeded if you used a language like perl, since all that one_argument() parsing stuff would be replaced by a few lines using split()…. all the memory management nonsense would be totally unused, since perl/ruby/python all use garbage collection, and allocate as you need things.
That's why I'm staying as far away from C++ as possible! As a famous computer scientist once said, there are only two things wrong with C++: the initial concept and the implementation. :)
That's why I suggest using some language that's actually GOOD with text manipulation, if you're going to be rewriting things anyways. C -> C++ buys you some things, but C++ really isn't all that good at text manipulation. You can use std::string, but you'll still find yourself having to muck about with pointers and whatnot as you invoke system calls.
Why not use a language where strings are a base type, and that lets you easily manipulate them without counting bytes and converting back and forth all the time?
There are large chunks of most of the Dikurivative codebases that would be entirely unneeded if you used a language like perl, since all that one_argument() parsing stuff would be replaced by a few lines using split()…. all the memory management nonsense would be totally unused, since perl/ruby/python all use garbage collection, and allocate as you need things.
That's why I'm staying as far away from C++ as possible! As a famous computer scientist once said, there are only two things wrong with C++: the initial concept and the implementation. :)
As a less famous computer scientist once said (me): "The only thing wrong with C++ is that it's too newfangled and not C."
"Often, when people have trouble with C++, the real problem is that they don't have appropriate libraries–or that they can't find the libraries that are available … one serious problem is that currently, too many software developers are undereducated and undertrained." – Bjarne Stroustrup
"Often, when people have trouble with C++, the real problem is that they don't have appropriate libraries–or that they can't find the libraries that are available … one serious problem is that currently, too many software developers are undereducated and undertrained." – Bjarne Stroustrup
He also said: "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg."
My personal favourite, though, is "C++ is to C as Lung Cancer is to Lung." (anonymous)
"Often, when people have trouble with C++, the real problem is that they don't have appropriate libraries–or that they can't find the libraries that are available … one serious problem is that currently, too many software developers are undereducated and undertrained." – Bjarne Stroustrup
He also said: "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg."
My personal favourite, though, is "C++ is to C as Lung Cancer is to Lung." (anonymous)
I think you may be the least partial person to C++ that I've ever witnessed.
"Often, when people have trouble with C++, the real problem is that they don't have appropriate libraries–or that they can't find the libraries that are available … one serious problem is that currently, too many software developers are undereducated and undertrained." – Bjarne Stroustrup
He also said: "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg."
My personal favourite, though, is "C++ is to C as Lung Cancer is to Lung." (anonymous)
I think you may be the least partial person to C++ that I've ever witnessed.
I only use it if I have no other choice… which is almost never (thankfully).
That is, until you want to start using STL classes as data members in your C structs…
Actually, it shouldn't be a problem since in C++ class and struct are fundamentally the same thing, with distinction on defaulting to public in struct s case.
Not quite true. It has to do when an object is created using said struct. The proper constructors do not get called for your STL objects as they would in a class.