|
|
Darren New <dne### [at] sanrrcom> wrote:
> Warp wrote:
> > Exactly which part of C is simpler for newbies than C++?
> You don't have to deal with constructors, destructors, exceptions, the
> difference between casing classes and casting pointers to classes, etc.
Why would a beginner need to deal with constructors, destructors,
exceptions and the like?
> It's simpler *because* it's less powerful, in the same way that using an axe
> is simpler for newbies than using a chainsaw.
No, C is a lot more complicated for the beginner precisely because it's
less powerful.
In C++ the beginner can write things like this:
std::string concatenate(const std::vector<std::string>& strings)
{
std::string result:
for(int i = 0; i < strings.size(); ++i)
result += strings[i];
return result;
}
Show me the same function implemented in C and explain how it would be
easier for a beginner (especially without any danger of memory leaks).
And here I didn't even get to the things that the C standard library
doesn't support.
--
- Warp
Post a reply to this message
|
|