|
 |
David Parrott <Xam### [at] quayles1 demon co uk> writes:
> In article <chrishuff_99-773CAB.07034410022000@news.povray.org>, Chris
> Huff <chr### [at] yahoo com> writes
> >
> >But POV isn't written in C++, it is written in C. :-)
> >Although there are plans to rewrite it in C++ for version 4...
> >
> I no it has nothing to do with me but I do not like this rewrite in C++
> idea. I like poking around in the source, never done anything useful.
> Anyway, if they convert I will not be able to do so! I know C but have
> absolutely no desire to learn C++, I will not go into reasons.
That's good. So, you won't object my propositions. :-)
You really don't know what you're missing. In C++ you have a lot of
features that aren't available in C. You have references, in particular
as parameters. You can protect yourself (and others) from modifying
locally constant variables. You can declare variables where you really
need them and not only at the beginning of a function. You have object
orientation to encapsulate your modules. You can really define your own
types and use them just like built-in types. Think of integers with
arbitrary precision, dates, times, colors, vectors,... etc. With C++
you can add, multiply or print them like integers or doubles -- and
you can (to some extent) use the compiler to check, whether it makes sense.
You can encapsulate your memory management and avoid memory leaks or
using freed memory.
As the most important feature I consider generic programming. This leads
to generic lists, sizable arrays, or trees -- with type safety.
Finally it's possible to make faster code with expression templates.
(By "faster" I mean "faster than C or fortran".)
Thomas
--
http://thomas.willhalm.de/ (includes pgp key)
Post a reply to this message
|
 |