Re: [vox] Why C?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [vox] Why C?
On Sun, 2002-02-24 at 19:22, Mark K. Kim wrote:
> Something Micah said about C++:
>
> > almost as many of its idioms and concepts get in my way as facilitate
>
> That's absolutely true. It takes a long time to learn how to use the C++
> features properly. I'm still working on mine (I've been using C/C++ for
> about 8 years). To make things easier, I try to do as much of it in C
> syntax, and use C++ features only if it greatly improves the program
> reliability or readability, and that policy has worked very well for me.
Heh. I've learned the features properly (at least, well enough to
debate nitpicks on comp.lang.c++), and they still get in my way
sometimes. Other times, they are a godsend.
I really tend to treat C and C++ as different tools for different jobs,
unlike some (*ah-Stroustrup-em*) who try to say that C++ is a complete
replacement for C, superior in every way, blah blah blah.
I really think every programmer ought to know both - C++ seems to be in
demand today for systems programming, but C is still very much in demand
in the UNIX world, as well as in embedded systems. Many systems
programming jobs want knowledge in "C/C++", and it is helpful to know
the subtle differences between the two.
I use C++ primarily at work, and have really enjoyed certain aspects of
it. For example, I wrote a Base64 library using C++ high-level concepts
such as iostreams and iterators. You can use this library to do
encoding/decoding in chunks, or streaming, or however the hell you want
to do it - it's very general purpose, and you can use it as an iostream
in functions which don't even have to know that there's translation
going on behind the scenes. There is no way I could have done that in
C. But, in the same project, I was severely irked that, unlike in C,
there was no kosher way to cast (char*) to (unsigned char*) - it
requires a reinterpret_cast (which I *hate*) in several places.
Micah
_______________________________________________
vox mailing list
vox@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox
|