Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Welcome Guest | Log In | Register | Benefits
Channels ▼
RSS

Design

The New Native Languages



Related Reading


More Insights




AndersSjogren

I agree! C++ is a jungle of functionalities and arcane gotchas, where you have to know the path to be out of trouble (but on that path it looks fine, just as in the presentation!), but it's easy to tread outside of that path and then you'd better be a survival (C++) expert.

father_ramon

Syntactically C++ is probably only slightly more complex than Java - semantically it is much more complex, with a lot of voodoo behavior that very few actually understand.

daminetreg

I use mainly Java, C++ and Javascript and even together day to day. I also write in C# and shell scripts some tools or helpers when they are more likely to fullfill the task. And from my personal experience, I don't find C++ more complex than Java.

I just feel that in Java and C# writing code is like filling a form : you can't do anything in another way than the language expects it and when writing C++ it's possible to implement a design without any barrier given from the language (e.g. Things like Sister class delegation).

This results in more maintainable code, and I find that it matters because the flexibility being smaller in Java and C#, it's more difficult to change a large application without refactoring the whole.

In fact I find that typing Java code even with all the eclim helps is more difficult and less clear than writing c++ one. I mean if (str.equals(otherStr)) begins already to be unreadable in comparison to if (str == otherStr). And the fact that to copy we have to write a clone() method calling Object.clone with a cast is really a pain in comparison to the default copy constructor provided in c++ which just works.

Additionally in Java I find initializing a list of a map is not that easy in comparison to using boost::assign::list_of, map_list_of or +=.

daminetreg

I think saying that C++ looks like in 1995 is wrong if you don't look at the standard library only. C++03 or C++11 have this flexibility (told as complexity by your article) which library developers can use to bring simplicity and flexibility to library users. You can't say that C++ is like in 1995 if you take a look at boost, because this library provides all the facilities and syntactic sugar to compete with languages like D, Go and so on. It adds features to the language (even new way to express code with Template Meta programming) without the need of an additional compilation step or tool, it simply uses the languages standard features. And nowadays compiler can handle this flexibility without any problem and in a cross platform way (i.e. I'm an embedded developer and I have no difficulties in using C++ for all the platforms I target which starts with MSPs and pass by the ARM families, ending with x86 platforms for linux or windows).

And this is a reason why I think that C++ is not lacking anything in comparison to Go, D and so on, when you use Boost, you will simply write code without having the impression you are lacking anything, you even get the impression that you aren't using all the power you have in the hands.

But I don't criticize the choice to make these articles which will be really interesting, I just wanted to react on the point that I think that objectively we can tell that C++ isn't lacking anything in comparison to the languages you gave and that code written nowadays definitely doesn't looks like code written in 1995.

Andrew Binstock

@VL000 We'll just have to agree to disagree here. The comparison of C++ and Java tends to support my argument. Java has become a complex language. I would disagree with Herb, though, as I think most developers who use both languages would consider C++ the more complex of the two. I cannot comment on C# as I don't know it well enough to put forth a qualified opinion.

VL000

"In some ways, this set of language designs underscores a fundamental issue in C++ that the new standard only marginally addresses: an unbridled complexity"
That's just not true. C++ is no more complex than any of its main competitors (java and C#). Herb Sutter stressed this in his presentation at the GoingNative 2012 conference. He compared the size of the language specification documents by word count and found the three to be really close. The difference come mainly from different design philosophies concerning performance/productivity tradeoffs. His talk is very interesting to get an overview of modern c++ and where it is heading; you can watch it here : http://channel9.msdn.com/Ev...

PMDubuc

There are many libraries and software frameworks available for C++ (Boost, Wt, WxWidgets, etc. etc.) Are any of these languages able to use these, or do they have sufficient support for equivalent functionality?

pjmlp

We really need to get back to native compilation. A lot of processor time is lost in interpreters and JIT engines.

A small correction to your article, D is open source. While the backend of the official DMD compiler is not open source, everything is available at github.

https://github.com/D-Progra...

Plus, there are at least the following fully open source compatible compilers:

- GDC (uses the GCC backend)
- LDC (uses the LLVM backend)
- SDC (newly implemented in D)

EBurkitt

Maybe it's time for someone to write "C++: The Good Parts", after Douglas Crockford's book on JavaScript. :)>