News for hackers. Stuff that matters.

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

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.

( 17 comments | 11 points | on HN )
Re:Ask HN: C++ programmers, what dialect of the language do ... by UnoriginalGuy on Sunday February 21, 2016 @01:44AM (#11143599)
> 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.

Re:Ask HN: C++ programmers, what dialect of the language do ... by sklogic on Sunday February 21, 2016 @03:23AM (#11143787)
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?
Re:Ask HN: C++ programmers, what dialect of the language do ... by grif-fin on Monday February 22, 2016 @10:18AM (#11151324)
> ... 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?).

Re:Ask HN: C++ programmers, what dialect of the language do ... by sklogic on Monday February 22, 2016 @01:20PM (#11152989)
> 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.

Re:Ask HN: C++ programmers, what dialect of the language do ... by vmorgulis on Sunday February 21, 2016 @08:40AM (#11144450)
> When was the last time you ran across a C++ project that made you envious?

Chrome, Firefox, OpenCV...

Re:Ask HN: C++ programmers, what dialect of the language do ... by danbolt on Sunday February 21, 2016 @02:03AM (#11143625)
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?

Re:Ask HN: C++ programmers, what dialect of the language do ... by davismwfl on Monday February 22, 2016 @12:45PM (#11152673)
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.

Re:Ask HN: C++ programmers, what dialect of the language do ... by chrisbennet on Sunday February 21, 2016 @02:56AM (#11143737)
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.

Re:Ask HN: C++ programmers, what dialect of the language do ... by Marqin on Sunday February 21, 2016 @11:55AM (#11145210)
Here I'm using C++14 with Filesystem TS ( provided by G++ 5.3+ ). Ah, and we must not use boost.
Re:Ask HN: C++ programmers, what dialect of the language do ... by danbolt on Sunday February 21, 2016 @07:45PM (#11147529)
Interesting! How come no boost?
Re:Ask HN: C++ programmers, what dialect of the language do ... by Marqin on Wednesday February 24, 2016 @07:44AM (#11166273)
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 ).
Re:Ask HN: C++ programmers, what dialect of the language do ... by osullivj on Monday February 22, 2016 @10:40AM (#11151501)
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.
Re:Ask HN: C++ programmers, what dialect of the language do ... by archietcture on Monday February 22, 2016 @06:24AM (#11150061)
I am working in C# language . By Anaya, http://www.3d-architectural-rendering.com
Re:Ask HN: C++ programmers, what dialect of the language do ... by archietcture on Monday February 22, 2016 @06:25AM (#11150063)
I am using C# language. By Anaya, http://www.3d-architectural-rendering.com
Re:Ask HN: C++ programmers, what dialect of the language do ... by partisan on Sunday February 21, 2016 @01:11AM (#11143539)
Just curious what you appreciate about C++ over C#.
Re:Ask HN: C++ programmers, what dialect of the language do ... by danbolt on Sunday February 21, 2016 @02:00AM (#11143622)
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.

Re:Ask HN: C++ programmers, what dialect of the language do ... by sklogic on Sunday February 21, 2016 @03:26AM (#11143789)
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.