Ask HN: C++ programmers, what dialect of the language do you use at work?

11 points by danbolt ↗ HN
C++ is a behemoth of a language, and it can be surprisingly difficult to find two programmers that agree on the same subset of it to be best when developing software.

As a recovering C# programmer, I'm getting back into C++ and really enjoying the new features of C++11/14. Still, there's a lot to know about the language, and I'd love to hear about what day-to-day C++ programmers stick to when developing software.

18 comments

[ 3.5 ms ] story [ 51.3 ms ] thread
(comment deleted)
Just curious what you appreciate about C++ over C#.
Ah, I guess I'm interested in becoming more proficient in languages that have very tight control over memory. I didn't mean the comment as a dig against C#. I like the language a lot!

I think I've been reading too many snooty remarks about non-C++ languages, and the jab in my post probably shouldn't have been there.

I like both languages, they both fit well into their niches. But C++ got some really killer features that could have been used far beyond its niche: RAII and templates.
> As a recovering C# programmer

As someone who knows C# and C++ and has worked with both professionally; C# is a much better designed language than ANY version of C++. C/C++ isn't going anywhere, but you could do much worse than to have developed in C#.

I think these types of remarks are reminiscent of the 1980-1990s where people declared one language or framework more "1337" than another, however the ironic thing is that they often poked fun at C++ for being less "serious" than ASM or C.

I stopped caring about which language made me feel more hackery a long time ago, because it became apparent that I didn't envy people who could write better assembler than me, it is people who are more productive and produce really cool stuff.

Right now I'd happily give up everything I knew about C++ to become a AngularJS expert because that's where the money is, and that's somewhere I could be extremely productive. C++ is still in the royal family for high performance, but who is recruiting for that? Where is the exciting C++ development going on? When was the last time you ran across a C++ project that made you envious?

PS - In answer to your question: I always work in the version of C++ that the codebase is written in, or the latest for new projects. C++ has received too many incredible improvements to ignore later versions of the language.

I agree about the design comments! C# is a lot more pleasant to work with. I really shouldn't have put the 'recovering' bit. It was pretty juvenile and didn't add to the discussion.

In response to your PS bit, has your build environment ever restricted which features you're enabled to use? Do you avoid certain parts of C++ due to needs of your project?

It's an interesting attitude. How can someone swap high performance or system programming (and this is actually where the interesting money is) for something as boring and pitiful as web?
> ... for something as boring and pitiful as web?

That hurt me. To call the current technology of web pitiful these days is not fair I think. How it is changing communication in life is impossible to ignore.

I agree with the big trade off of "speed" and productivity ("speed" because, really? How many projects are there that speed is the number one factor and productivity number 2?).

> To call the current technology of web pitiful these days

It's more and more pitiful every year. Old standards do not go away, new ones pile upon layers and layers of the historical cruft. It is not going to ever get any better.

> How many projects are there that speed is the number one factor and productivity number 2?

The web stuff is abysmal in both dimensions. There is no way it can be anywhere near any high performance, and there is nothing that could help developers to be productive, because - see above.

> When was the last time you ran across a C++ project that made you envious?

Chrome, Firefox, OpenCV...

I've been using Microsoft's C++ for decades so I wasn't able to use the cool C++ 11 features until recently. I'm like a kid in a candy shop with the new features. I've got a lot of C# experience so I was familiar with things like lambdas already.

I only work on greenfield projects so I'm free to use what I want. So far I've only taken advantage of lambdas and atomics and some of the new threading stuff.

Here I'm using C++14 with Filesystem TS ( provided by G++ 5.3+ ). Ah, and we must not use boost.
Interesting! How come no boost?
With templates, C++14 and new TS we don't see any need for Boost ( and Boost would be another ton of MB to compile/link ).
C++ MFC in Visual Studio 2003. No STL, no Boost, no templates. Like mid 90s C++ in fact, because the codebase dates back to the mid 90s. It's a contract gig on a legacy mortgage system.
For C++, I follow whatever is the standard for the code base, or the latest I can support on each planned environment -- which of course is not always the latest C++ standard out. I think that is a standard practice for most people.

Overall, I really like both languages and have bounced back and forth quite a bit. I'd say they both have good and bad things, in different ways, and their overall purposes are different. I'd also say that people who compare the two languages aren't really comparing apples to apples. For the simple reason you cannot remove the .NET eco system from C#, but C++ does stand on its own. The .NET ecosystem is what provides for the majority of productivity and other gains that C# affords. That isn't a knock against either, but I just don't see them as equivalents. To me it is like comparing a race car to an every day driver, both will do the job of getting you to and from the store, your more likely to kill yourself or others in the race car and don't have all the built in conveniences, but both can get you to and from.