Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

From what I understand, Google is really about a crippled subset of C++, that people jokingly call "C+-".

I ran a C++ shop for 25 years. I used to program in it, but stopped, many moons ago. The new C++ is a huge change from what I knew.

I am expecting to see a lot of hate for the language, in this thread.

Regardless, it is a very powerful language, and it is not for the faint of heart.

I attended a Swift conference, many moons ago, and one of the speakers was this wonderful woman that had recently moved to Adobe (a C++ shop).

She was supposed to speak about Swift, but ended up speaking about C++, and the wonderful, supportive community of older, experienced developers she found, around the language.

I loved it, but I'll bet a lot of the folks around me, were squirming.



All sane C++ codebases must use a defined subset of the language. Google's is one that works for them, with some pretty strong standardization. It's a good set of compromises. But you won't get far programming in it if you don't know the broader semantics of the language.

I didn't do C++ from about 2003 to 2013. When I came back I was delighted. It's so much better.


I liken C++ (and other "industrial" languages, like PHP), to "advanced" tools, like the specialty tools and brands, that only professional mechanics know, like OTC. You won't get them at Home Depot.

The language definitely has its niche, and I am glad to see it not being used for standard GUI programming, anymore.

But for that niche, there's nothing better, and it's a big niche.


What can PHP do that other less vilified languages can't? What is its "niche"?


Please, everyone is supposed to be slagging C++ (and me), here. I'm sure there will be rich opportunities to dis PHP, in other threads.


You are right, my apologies. It was just so surprising a mention I couldn't stop myself.


My experience from 1990 was it was the perfect language to add a bit of server-side logic to some raw HTML.

So the niche (for me) was a nice transition from something I understood (HTML) to something new (dynamic webpages).

In that way it is similar to batch files / bash scripts.


If only unique_ptr makes the whole experience so much better


There are only two types of C++ shops: the ones that use a rigorously-enforced subset of it, and the ones where the codebase is an impenetrable hornet's nest. You must decide on a subset of C++ to use or you'll go insane. Google made some opinionated choices and tradeoffs about which subset to use (as did Microsoft and every other company with a huge C++ codebase), and it's possible to disagree with the specific boundaries they chose, but the mere fact that they chose to do this is unimpeachable.


C+- is pretty common. I last read the Google C++ guidelines maybe ten years ago. They were pretty much in line with the decisions that other large C++ projects I've worked on had made, like we all encountered the same footguns and language misfeatures.

Every 5-10 years there's a big shakeup and the C++ culture changes, but it takes a long time for things to filter down into the embedded world (for instance).


Perhaps in the past, but they aren't too terribly far behind C++20 and a bunch of stuff that has been added to the language over time (like stringviews) was made available much earlier via library support. I don't think I've ever heard this "C+-" joke at Google despite working in C++ here for a very long time.


I heard it quite frequently, but not from people that worked there.

I believe that there was a published style guide. My experience is years old, but I remember seeing that it was basically “C++ without objects.”

It’s a great language, and the 20 additions bring it right on par with other languages, in terms of type and memory safety.


The style guide is publicly available: https://google.github.io/styleguide/cppguide.html

I've never heard anything remotely similar to "avoid objects" here.


Yeah. If anything the Chromium codebase is bloated with uncomfortably intricate OO patterns. Google3, less so, but that's because that kind of server-stuff doesn't lend itself to the same kind of thing, maybe.

I like the Google style guide overall. I tend to use it on new projects even though I'm not there anymore, and when I get into other people's code often my first instinct is to "clean it up" into that style :-)


Well, this was back in the C++ 11 days.

No biggie. Won't get in a fight about it.

Have a great day!


It is true that the adoption C++11 was later than ideal. Since then, the C++ build and library maintainers have made a priority of not letting that happen again and have done a really really good job (IMO).


Maybe more like C++ without (most) pointers. A coupe of years ago they allowed mutable references in function arguments, so the use cases for passing pointers around were reduced even further.


That's it. Not "without objects," but without pointers. One of the things (back then) that made C++ so powerful, was direct memory access.

However, I really like style guides.

Except the Taligent one: https://root.cern.ch/TaligentDocs/TaligentOnline/DocumentRoo...


"Don't use pointers" was definitely never in the style guide.


Well ... like I said, it was a long time ago (I don't know if Google had even made their first hundred billion, yet). I suffer from CRS. You know how us old "boomers" are...

Not interested in fighting about it. I'm sure that I'm wrong. Being right buys me absolutely nothing. It's not my wheelhouse.


"From what I understand, Google is really about a crippled subset of C++, that people jokingly call "C+-"."

Chrome is pretty good at using modern C++ FWIW.


MSFT was the same (at least the corner of it that I knew). We called it "C, with classes".

I never apply to C++ jobs despite those 6 years of experience because I think my knowledge there is stuck in 1999 and I have no idea about the STL.


Learning the language fundamentals robustly is the hard part, and everyone has incomplete knowledge. The C++ standard library is easy to learn for someone in your position. If you want to, start with something like iterator pairs and few trial problems, it will feel just like pointer arithmetic then the standard algorithms will be easy.

I have tried to focus on C++ during my career and I still haven't even touched ranges or needed about half the std algorithms.


Ranges are a little frustrating, they aren't uniformly implemented across the commonly used compilers.


It's hardly "crippled". I find myself quite productive writing C++ at Google.

Take a look at the style guide yourself. I think it's pragmatic.

https://google.github.io/styleguide/cppguide.html


Ah! "C+-" is what i called Golang when i first tried it around 2014-2015. I guess i can see where some ideas came from.

(Still a very good language if you know what to do with it)


Did they upload the recording to YouTube? I would like to listen to her.


It was try!Swift New York, back in 2017, or so. I don't think they published vids, but maybe. I'll have to go look at my badge, to see which one it is.

https://www.tryswift.co

[UPDATE] It was 2019. They have videos, but hers (and a few others) aren't there.

[UPDATE 2] Found it. It isn't linked from the main site, but is on the YouTube playlist: https://www.youtube.com/watch?v=CZOVnlwWPZk

It's a really good talk. I like her attitude.

This is her: https://www.savinola.com


Thanks. I watched it.

That was a lovely talk and changed my perspective on C++. My impression was that C++ is a ancient language with lots of footgun.

The talk reminds me of its value. C++ is still evolving. Improvements are introduced slower compared to other languages, but still, C++ is making progress and many found it pleasant to work with. It just need more time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: