Topic: Re Matt Austern: .. about C++ .. all is pretty!
Author: Heinz Kohl <kohl@informatik.uni-stuttgart.de>
Date: 1997/08/01 Raw View
Matt Austern wrote:
>
> That's not true. The lifetime of temporary objects is not
> implementation defined, it is standardized. It's described in section
> 12.2 of the draft C++ standard.
> ---
I really hope, the biggest bugs will disappear with the standard.
Looking at the draft at a glance, this seems to be the case in this
topic.
But as you say, up to now there's only a draft, not a standard.
But anyway, it's nice to see a problem disappearing in near future
(lets guess: anno Domini 2000), which took me some month of work
in the past.
But today i've fallen into a one of the usual silly pitfalls in C++:
typedef char x[40]; .. class z ..{ x y; z(x p) { y = p; .. } .. }
Do you see it? Naturally, y and p are totally incompatible,
compiler resignes at this point.
Up to now I've seen 4 C++-compilers. And all of them had the typical
random looking errorness that seems to be unavoidable for all bigger
C++ programs, like:
- procedure parameter strictly pointing to the start of the
memory cluster, not to the variable
- 'forgotten' procedure call (it took a half day for verification and
a half day for changing the program without changing the semantics
until it disappeared)
and so on and so on. None of this errors I've seen twice.
I think, there's no really hard tested feature of a C++ compiler,
that may not fail sporadic and without any reasonable cause.
The experienced C++ programmer I know said, it tooks him 50% of the
testing time to cope with compiler errors (the code warrior C++
compiler he's now using seems to be much better).
Other weaknesses seems to be typical for all the modern software:
e.g. misleading error messages up to 'internal compiler error'
(the cause for the latter may be paging file exhausted)
Do you think, it will be possible to change C++ till working
like an ordinary computer language?
Let's really hope, the standard will do this job.
(kohl@informatik.uni-stuttgart.de)
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Author: Hyman Rosen <cardboard.mti.sgi.com!sgi.com!ncar.UCAR.EDU!uunet!jyacc!calumny!hymie>
Date: 1997/08/04 Raw View
Heinz Kohl <kohl@informatik.uni-stuttgart.de> writes:
> But today i've fallen into a one of the usual silly pitfalls in C++:
> typedef char x[40]; .. class z ..{ x y; z(x p) { y = p; .. } .. }
> Do you see it? Naturally, y and p are totally incompatible,
> compiler resignes at this point.
This is not a silly pitfall in C++, this is a silly pitfall in C.
The type 'x' is an array. In neither C nor C++ can you pass an
array by value. Neither is an array an lvalue; you can not assign
to arrays. If you are making these kinds of errors, it's little
wonder that your code has all sorts of obscure bugs. I would advise
you to learn the language better. Also, everyone on this group will
be happy to tell you to stop using C-style arrays altogether, and
switch to string and vector.
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]