Live data from Hacker News

Google C++ style guide

google-styleguide.googlecode.com

11–20 of 55 posts

Re: Google C++ style guide

#11
post #4

It might sound like a good idea to precisely describe how code should be written, until you realize it's inefficient and useless. Code coherence can be accomplished with more relaxed rules if you delegate more responsibility to your engineers.

> Code coherence can be accomplished with more relaxed rules if you delegate more responsibility to your engineers. Please elaborate.

I think consensus through code review is better as compilers and languages evolve. If you write rules for everything you spend your time checking for compliance and perhaps rewriting rules instead of relying on a more organic code quality assurance.

You also want your engineers to think by themselves instead of hiding behind a rules book.

Re: Google C++ style guide

#13
post #8

I love C++, I wish there was more work available that used it. EDIT: Clearly my issue is where I lived, not the lack of available jobs apparently.

HPC, games, portable mobile code and embedded systems.

Re: Google C++ style guide

#14
post #8

I love C++, I wish there was more work available that used it. EDIT: Clearly my issue is where I lived, not the lack of available jobs apparently.

Games programmer!

Yeah, this is true. But all places pretty much require you have prior experience. Not to mention most games these days are in Obj-c/Java. Plus game studios aren't exactly ubiquitous (least not where I'm from).

Re: Google C++ style guide

#15
post #14

Earlier quoted context omitted.

Games programmer!

Yeah, this is true. But all places pretty much require you have prior experience. Not to mention most games these days are in Obj-c/Java. Plus game studios aren't exactly ubiquitous (least not where I'm from).

> Not to mention most games these days are in Obj-c/Java.

Proof? I've seen _quite_ the opposite. Sure, these things (and Flash, still) are popular among small/indie devs, but I haven't heard about a single AAA title since ~1995 that didn't used C++.

There is an insane amount of big open source projects out there that use C++. Firefox, Chromium, KDE, .... the list is much longer. Making significant contributions to any of those would most likely be considered experience.

And there are tons of C++ jobs outside the game industry. Not for small-scale web stuff of course, but for client-side stuff, and really huge backends, C++ is still very popular.

Re: Google C++ style guide

#17

No lambdas allowed? For many other things they say "use within reason", I don't see why they can't say this for lambdas. They're finally making the stl algorithms easily usable. You don't have to write Functors that are in a different place then called. Also, the guide seems to completely miss templates and actually pretty much allow everything in C++ (except lambdas and exceptions). I don't really see the point then…

> They're finally making the stl algorithms easily usable. Well, considering they ban use of exceptions and considering that stl does use exceptions and therefore they cannot use stl, I don't think that they really care.

I suspect they either use an STL that has a way to disable exceptions (such as STLPort) or they disable exceptions using compiler flags, or maybe both.

You may argue that this really brings into question the "S" part of "STL" but it is done in practice and I'd argue it's not even all that difficult to deal with.

Re: Google C++ style guide

#18
post #13
post #8

I love C++, I wish there was more work available that used it. EDIT: Clearly my issue is where I lived, not the lack of available jobs apparently.

HPC, games, portable mobile code and embedded systems.

Indeed, I don't understand that statement either.

Re: Google C++ style guide

#19

No lambdas allowed? For many other things they say "use within reason", I don't see why they can't say this for lambdas. They're finally making the stl algorithms easily usable. You don't have to write Functors that are in a different place then called. Also, the guide seems to completely miss templates and actually pretty much allow everything in C++ (except lambdas and exceptions). I don't really see the point then…

This is an older revision of the style guide; they updated the style guide recently to allow lambdas. Other C++11 features were also under review for a while.
Post reply on HN