POV-Ray : Newsgroups : povray.off-topic : Standard libraries : Re: Standard libraries Server Time
6 Sep 2024 15:19:28 EDT (-0400)
  Re: Standard libraries  
From: Warp
Date: 7 Mar 2009 17:46:46
Message: <49b2f956@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> But C++ syntax is so bad you 
> can't even tell whether a line of code is a type declaration or a variable 
> declaration or a function invocation without reading all the include files. 

  That's also one of the great assets of the language. Consider this:

template<typename F>
void foo()
{
    F(5);
}

  Is that F(5) a function call or is it instantiating a variable of type F?
It's impossible to tell without knowing what F might be.

  However, it doesn't matter! As long as F behaves like a function, that's
just fine. This is used quite a lot in template coding, eg. with functors
and comparators. This gives flexibility and versatility.

  It's not like C++ was the only language which behaves like this.

> To the point where you start getting things like the "typename" keyword 
> (iirc) just to tell the compiler whether you meant to give a type or a 
> variable name at that point.

  Most languages have special keywords to denote what you want to do.
For example, some languages might have a keyword like "function" to denote
that you are starting a function definition, as opposed to starting a
function call. I don't really see the big difference.

> You can't tell me a language with undecidable syntax isn't at least a little 
> sucky, yes?

  When that syntax brings flexibility, I don't consider is such a huge
problem.

-- 
                                                          - Warp


Post a reply to this message

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