Re: Java or C++?
- From: "Michael Jørgensen" <ccc59035@xxxxxxxxxxxxxxxx>
- Date: Wed, 19 Oct 2005 18:00:48 +0200
<adaworks@xxxxxxxxxxxxx> wrote in message
news:yNl5f.17428$6e1.2854@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> "Alan Balmer" <albalmer@xxxxxxx> wrote in message
> news:4qgal1pfc024fset0k61vv0tkp8nr9hrbl@xxxxxxxxxx
> >
> > C++ doesn't force anyone to write unsafe code, and silly analogies
> > don't change that.
> >
> True. C++ does not force anyone to write unsafe code. It does, however,
> make it so much easier to do so. If you are a practicing C++ programmer,
> you realize how easy it is to make errors that are never detected by the
> compiler.
"much easier"? Which language are you comparing C++ to now? C, Java, or
something else?
I find C++ compilers much more helpful than C compilers when it comes to
finding bugs. I migrated from C to C++ four years ago, and it is my
experience that the compiler catches many *more* errors that previously used
to be found at runtime. Many of these errors are silly, like type errors and
uninitialized variables, but I no longer have to track down hard-to-find
runtime bugs on that account, because the compiler finds them for me.
Of course, that may not be due to the change C -> C++, but could be instead
a general improvement in the number of warnings/errors that the compiler
checks for.
However, the possibility of using std::map to express associations between
two related concepts makes it easier and quicker to get a program working
than it used to when I only had C. Having to hand-code such relations in C
invariably leads to bugs at run-time.
> We are talking here about errors that would be detected early
> by a more robust language.
Could you be more specific, please. What errors, what language?
Would you say Java is more robust than C++?
Any language that does not explicitly support the concept of pointers and
(especially) pointer arithmetic would be (much) more robust than C/C++.
-Michael.
P.S. Why are we having this discussion? C++ is a powerful language, and with
all power-tools, some caution is required.
.
- Follow-Ups:
- Re: Java or C++?
- From: Walter Bright
- Re: Java or C++?
- From: adaworks
- Re: Java or C++?
- From: August Karlstrom
- Re: Java or C++?
- References:
- Java or C++?
- From: Flaran
- Re: Java or C++?
- From: Scott Moore
- Re: Java or C++?
- From: Jussi Jumppanen
- Re: Java or C++?
- From: Chris Dollin
- Re: Java or C++?
- From: Alan Balmer
- Re: Java or C++?
- From: Scott Moore
- Re: Java or C++?
- From: Alan Balmer
- Re: Java or C++?
- From: adaworks
- Java or C++?
- Prev by Date: Custom general bot programming but specializing in arbitrage/poker bots
- Next by Date: Re: Java or C++?
- Previous by thread: Re: Java or C++?
- Next by thread: Re: Java or C++?
- Index(es):
Relevant Pages
|