POV-Ray : Newsgroups : povray.off-topic : Coding in ___ is like ___ : Re: Coding in ___ is like ___ Server Time
4 Sep 2024 21:19:06 EDT (-0400)
  Re: Coding in ___ is like ___  
From: Warp
Date: 26 Feb 2010 12:35:13
Message: <4b880650@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.