Re: advantages of C
From: Willem (willem_at_stack.nl)
Date: 01/31/04
- Next message: Willem: "Re: Algorithm Question"
- Previous message: Irrational Number: "identical executables, different results, continued"
- In reply to: Kevin Cline: "Re: advantages of C"
- Next in thread: Richard Heathfield: "Re: advantages of C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Jan 2004 23:53:46 +0000 (UTC)
)> C++ is 'better' than C *because* it has classes.
Kevin wrote:
) And constructors and destructors and templates and exceptions and
) inheritance and virtual functions and the STL and operator overloading
) and ...
)
) In C++, it's easy for me to write code that is obviously correct. In
) C, life is harder. I have to manually make sure that there is a free
) for every malloc, and an unlock for every lock, instead of just coding
) a constructor and destructor. I have to handle error returns after
) every function call, instead of handling them all together in a single
) catch clause. I have to use the preprocessor, cut and paste code, or
) cast to void* instead of writing template classes. I have to replace
) operator expressions with function calls if I switch from a built-in
) type to a user-defined type, instead of overloading those operators
) for my type. I have to worry about overflowing char[] buffers,
) instead of using std::string. Correctly used, C++ is a great tool for
) keeping bugs out of code.
Most of these directly or indirectly have to do with classes, with the
possible exception of overloading. If, in C++, you did *not* have classes,
then what are you left with ?
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
- Next message: Willem: "Re: Algorithm Question"
- Previous message: Irrational Number: "identical executables, different results, continued"
- In reply to: Kevin Cline: "Re: advantages of C"
- Next in thread: Richard Heathfield: "Re: advantages of C"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|