Live data from Hacker News

Has C++ jumped the shark?

johndcook.com

51–60 of 69 posts

Re: Has C++ jumped the shark?

#51
post #19

Earlier quoted context omitted.

Several years after I swore I would never work in C++ again, I agreed to do C++ in order to get a job with a company I was really interested in joining. I ended up working on a project that used C++ with lots of rules and restrictions, and it was not too bad except for lots of boilerplate. I would like to see something better come along that has some of the low-level power of C, but also supports sophisticated high-l…

Maybe try D? An­drei Alexan­dres­cu likes it, and he knows C++ really well.

My theory is, upon reading his book, is that he knows it as well as all but two or three people anywhere.

Re: Has C++ jumped the shark?

#52
post #31

Earlier quoted context omitted.

How do those features impact runtime performance? One example of templates affecting runtime performance is poor use of the instruction cache due to code duplication in every instantiation of a template.

If you are instantiating equivalent functions (sorting foo* vs sorting bar* ) then the linker will merge their binaries -no dupes there. If you are generating different functions (sorting foo vs foo* ) then you are asking for different functions -no dupes there either. If you want to keep everything down to one function, qsort() didn't disappear when they added std::sort() and it is pretty close to what a dynamic lan…

Some linkers do what you describe. Not all.

Re: Has C++ jumped the shark?

#53
post #51

Earlier quoted context omitted.

Maybe try D? An­drei Alexan­dres­cu likes it, and he knows C++ really well.

My theory is, upon reading his book, is that he knows it as well as all but two or three people anywhere.

Could you please clarify that a bit? That would imply that either everybody knows C++ or that I don't. Thanks!

Re: Has C++ jumped the shark?

#54
post #51

Earlier quoted context omitted.

My theory is, upon reading his book, is that he knows it as well as all but two or three people anywhere.

Could you please clarify that a bit? That would imply that either everybody knows C++ or that I don't. Thanks!

My reading of that comment is that he's saying you're in the top 4 worldwide..

Re: Has C++ jumped the shark?

#55

Earlier quoted context omitted.

Could you please clarify that a bit? That would imply that either everybody knows C++ or that I don't. Thanks!

My reading of that comment is that he's saying you're in the top 4 worldwide..

Lysdexia is killing me.

Re: Has C++ jumped the shark?

#56
post #19

Earlier quoted context omitted.

Several years after I swore I would never work in C++ again, I agreed to do C++ in order to get a job with a company I was really interested in joining. I ended up working on a project that used C++ with lots of rules and restrictions, and it was not too bad except for lots of boilerplate. I would like to see something better come along that has some of the low-level power of C, but also supports sophisticated high-l…

> I would like to see something better come along that has some of the low-level power of C, but also supports sophisticated high-level abstractions Objective C this very well. It adds classes and protocols. Closures can be implemented with blocks. Everything else is the same as in C.

As a C++ programmer dabbling in Objective-C, I have been extremely impressed. After clearing the "weird syntax" hurdle, Objective-C is a beautiful language. It is object-oriented, type-safe when you want, dynamic when you want, and C-compatible without all the problems C++ added.

However, much of joy of using Objective-C is Apple's Cocoa Foundation classes. Stuff like autorelease and NSString are not part of Objective-C's core language. And support for Objective-C or Cocoa on non-Apple platforms is limited or not well-supported.

Re: Has C++ jumped the shark?

#57
post #30
post #12

Earlier quoted context omitted.

"Massive bloat. Take a look to the Boost libraries and cry." Aside from your tears, what is the evidence that boost is bloated? Too slow? Too much source code? Too many files? I've been using Boost for nearly a decade. It does a ton of useful stuff (from template metaprogramming to fast matrix algebra), it's loosely coupled, and it's insanely fast. Given it's scope, it's the least bloated library of which I know. C++…

> ton of useful stuff (from template metaprogramming to fast matrix algebra), it's loosely coupled, and it's insanely fast It's actually not all that fast in a lot of cases. Boost's matrix manipulation support is particularly slow: http://eigen.tuxfamily.org/index.php?title=Benchmark-August2... Also a lot of the template aerobatics generate a ginormous number of symbols which massively increase the binary size and ca…

First of all, please provide recent benchmarks (GCC 4.2 is not recent) on multiple OSes that test more than one small subset of Boost. Otherwise your statements about performance are doubtful at best.

Second of all, those symbols will have an effect on compile times, but they should certainly be stripped out by the linker. Why would symbols that do nothing sit in the executable?

Thirdly, Boost's purpose is to iterate faster than the C++ standard library and have real-world data about what libraries work and are needed. Those libraries would then be included in next C++ standards, as it has happened with TR1. There are useful libraries inside Boost and there are research libraries or concept libraries. Don't use a library just because it's included in Boost!

I use Boost and Qt. Since TR1 I didn't need Boost as much, which means that it's achieved one of its goals.

Re: Has C++ jumped the shark?

#58
post #4

I've written in C++ professionally almost 12 years (17 years counting College), and in my opinion it is a shame how the language has not evolved properly. Unsolved things: - Unified C++ ABI call for making shared libraries without worrying about compiler manufacturer or version. - Massive bloat. Take a look to the Boost libraries and cry. - Poor debugging tools for templates (debugging templates it is crazy, and the…

Take a look to the Boost libraries and cry. Indeed! The thing I don't understand is that you go to the boost library website and you see that it touts itself as an all-volunteer effort. Who are these people who volunteer their time to produce this massively bloated, over-elaborated code? What is their motivation? What's going on here? I understand bureaucracies usually bureaucrats are paid and produce code and memos…

You shouldn't generalize. Saying 'X' about Boost is like saying 'X' about the US or Europe.

There are many different components in there.

Re: Has C++ jumped the shark?

#59
post #19

Earlier quoted context omitted.

Several years after I swore I would never work in C++ again, I agreed to do C++ in order to get a job with a company I was really interested in joining. I ended up working on a project that used C++ with lots of rules and restrictions, and it was not too bad except for lots of boilerplate. I would like to see something better come along that has some of the low-level power of C, but also supports sophisticated high-l…

> I would like to see something better come along that has some of the low-level power of C, but also supports sophisticated high-level abstractions Objective C this very well. It adds classes and protocols. Closures can be implemented with blocks. Everything else is the same as in C.

The problem with Objective-C is that it only adds things, it doesn't make the C part easier to use or safer.

As you've said: everything else is the same as in C.

Re: Has C++ jumped the shark?

#60
post #21
post #8

C++ is the only language I'm aware of where every extension made to the language is careful to only affect compilation time/complexity, while preserving the speed and operational semantics of the code at runtime. This makes it perfect for some domains, e.g. console game development, where the speeds required are only attainable by dicking around with pointers in C, but people want to use better abstractions than C is…

This is thing that annoys me about C++'s illusion of control: unless you have / take full responsibility over the compiler and standard library, the "control" that C++ gives you is actually an abnegation of choice which leaves you to reinvent the world if you want specific features. What if you want something like Smalltalk / Lisp images? Runtime code generation and optimization of virtual method calls? Precise garba…

"What if you want something like Smalltalk / Lisp images? Runtime code generation and optimization of virtual method calls? Precise garbage collection?"

What is the point of controlling all of those things? The GP was talking about speed - how are GC, JIT and images related to this?

Post reply on HN