Re: Is necessary to switch to C++ or some object-oriented language?
- From: "user923005" <dcorbit@xxxxxxxxx>
- Date: 23 Mar 2007 12:03:01 -0700
On Mar 23, 11:39 am, "Default User" <defaultuse...@xxxxxxxxx> wrote:
Richard Bos wrote:
"J. J. Farrell" <j...@xxxxxxxxxx> wrote:
On Mar 22, 11:48 am, "user923005" <dcor...@xxxxxxxxx> wrote:
On Mar 21, 7:16 pm, "J. J. Farrell" <j...@xxxxxxxxxx> wrote:
On Mar 21, 2:14 pm, "user923005" <dcor...@xxxxxxxxx> wrote:
I suppose it hinges on what you consider "minor", but please
specify why you consider this claim to be false. It's very rare
for programs to need to call main() recursively, or to care
about the type of a charater constant, for example. The need to
cast void * to other object pointer types is slightly more
intrusive, but I'd still consider it minor. Which are the
non-minor exceptions?
Take this
tarball:http://wwwmaster.postgresql.org/download/mirrors-ftp?file=
%2Fsource%2... Which is the PostgreSQL database (written in the
C language). Rename all of the .c files to .cpp and try to
compile it. Basically none of the files will compile.
I don't see how that's relevant to the question. If the minor
exceptions are widely used, there'll obviously be problems
compiling.
If they're widely used, I wouldn't call them minor. Some people would
say that the differences between a monkey's genome and a human's are
minor; but the differences between the resulting money and human
definitely aren't.
The common set of C and C++ is pretty broad and useful if one has some
reason to use it. I haven't personally ever needed it.
As far as porting from one language to another, C->C++ is one of the
easiest to do. For the most part, the programs will be broadly
structured correctly, and most the standard headers are acceptable
(except possibly C99 ones) although they should probably be updated to
the C++ replacements at some point. Additionally the C89 standard
library is available.
It can also be a non-trivial job to port some C89 programs to C99. I'm
in the process of modernizing my old text-adventure game, and one of
the tools I used was to run files through a C++ compiler. That
pinpointed all the implicit ints, undeclared functions, and K&R
function defintions that were still hanging around in the code.
It can also be fairly difficult to port from C to C++ (if that was
never the intention of the original authors).
I had a notion to try with PostgreSQL, but soon realized that hundreds
(thousands?) of hours were at stake and abandoned it.
We did the first (that I know of) port of PostgreSQL to Win32 several
years ago and we usually convert everything to C++ here, but that one
was a no-go.
The current version of PostgreSQL has some of our code in it.
.
- Follow-Ups:
- Re: Is necessary to switch to C++ or some object-oriented language?
- From: Malcolm McLean
- Re: Is necessary to switch to C++ or some object-oriented language?
- References:
- Is necessary to switch to C++ or some object-oriented language?
- From: ajba74
- Re: Is necessary to switch to C++ or some object-oriented language?
- From: arnuld
- Re: Is necessary to switch to C++ or some object-oriented language?
- From: Roland Pibinger
- Re: Is necessary to switch to C++ or some object-oriented language?
- From: user923005
- Re: Is necessary to switch to C++ or some object-oriented language?
- From: J. J. Farrell
- Re: Is necessary to switch to C++ or some object-oriented language?
- From: user923005
- Re: Is necessary to switch to C++ or some object-oriented language?
- From: J. J. Farrell
- Re: Is necessary to switch to C++ or some object-oriented language?
- From: Richard Bos
- Re: Is necessary to switch to C++ or some object-oriented language?
- From: Default User
- Is necessary to switch to C++ or some object-oriented language?
- Prev by Date: Re: How to load the whole file?
- Next by Date: Re: newbie question: whats wrong with my code?
- Previous by thread: Re: Is necessary to switch to C++ or some object-oriented language?
- Next by thread: Re: Is necessary to switch to C++ or some object-oriented language?
- Index(es):
Relevant Pages
|