logoalt Hacker News

ben-schaaflast Sunday at 4:24 PM1 replyview on HN

As someone who works almost exclusively in C++, the whole "most vexing parse" makes the syntax indefensible.


Replies

zabzonklast Sunday at 5:21 PM

In my experience, people simply go "Doh, of course!" or don't write the wrong code in the first place. It has never caused me any real problems.

For those of you that may be curious, or not know C++, in C++ this:

    Obj x();
is a declaration of a function called x that returns an Obj. Whereas this:

    Obj x;
defines (possibly, depending on context) an instance of the type Obj called x.

Most people get over this pretty quickly.

If that is your main complaint about a language then the language doesn't have too many problems. Not that I'm suggesting that C++ doesn't have more serious problems.