On Thu, 31 Dec 2009, Antonio Diaz Diaz wrote:
rupert THURNER wrote:
why did you choose to implement it in c++ btw?
Because "I never saw a project for which C was better than C++ for any reason
but the lack of a good C++ compiler." (Bjarne Stroustrup).
The question for me is, why so many people still prefer plain C?
I can tell you only about my personal reasons.
a) "C makes it easy to shoot yourself in the foot; C++ makes it harder,
but when you do it blows your whole leg off" -- Bjarne Stroustrup [0].
b) For the size and caliber of my hobby project, C is better. C++ is much
more complex, it'd require much more effort on my part directed towards
the language itself. The greatly increased expressiveness of C++ is not
necessary for this kind of project of mine. For example, I'd have to
obsess about exceptions *in addition to* checking each and every syscall
and libc return value. (Or add/use wrappers that convert such syscalls
into exception-throwing methods.)
c) C *still* has much better portability. Both in the wild, and also when
looking at standards. As discussed before, none of SUSv1 to SUSv4 say
anything about C++. Some of my stuff builds on OpenVMS with the platform
compiler (not gcc). Case in point: long long / stdint.h / inttypes.h. None
of those are standard C++ until C++0X comes out. (Oh wait, that's C++1X in
a few hours, at least in +0100 :))
If you're interested in a view that may be a bit less balanced, I
recommend the C++ FQA (not a typo) by Yossi Kreinin [1].
Cheers,
lacos
[0] http://www2.research.att.com/~bs/bs_faq.html#really-say-that
[1] http://yosefk.com/c++fqa/
_______________________________________________
Lzip-bug mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lzip-bug