Flutterby™! : Any recommendations for a C style

Next unread comment / Catchup all unread comments User Account Info | Logout | XML/Pilot/etc versions | Long version (with comments) | Weblog archives | Site Map | | Browse Topics

Any recommendations for a C style

2015-04-08 15:35:04.3663+00 by Dan Lyke 4 comments

Any recommendations for a (C++) style guide? I'm prepping my framework for a "hey, this is useful" publicity, and should do some clean-up.

[ related topics: Douglas Adams ]

comments in ascending chronological order (reverse):

#Comment Re: Any recommendations for a C style made: 2015-04-08 16:06:56.89069+00 by: markd

The Google style guide has a bunch of stuff, ranging from "use this number of spaces and brace placements" up through a big bushel of Best Practices. https://google- styleguide.googlecode.com/svn/trunk/cppguide.html . There's rationale so you can decide whether or not a particular part is useful.

#Comment Re: Any recommendations for a C style made: 2015-04-08 20:13:00.14834+00 by: Dan Lyke

There's enough loathing for the Google C++ styles in the C++ community that I don't think that's the set of styles for me.

I think the answer is that there isn't enough of a consensus on style for there to be a "right way". So, yeah, I do need to think a bit about whether I like having an array object that can have references to it passed around, but generally whatever I'm doing is probably fine...

It's a little more complex because I'm trying to adopt a bit of NodeJS-ness, even though I'm not deep in that culture...

#Comment Re: Any recommendations for a C style made: 2015-04-08 21:37:20.746868+00 by: Mars Saxman

I was going to recommend the Google style guide too. Where is this loathing occurring? I am unaware of it.

#Comment Re: Any recommendations for a C style made: 2015-04-08 22:36:33.952721+00 by: Dan Lyke

A good well-thought out summary of the Google Style Guide hate: Why Google Style Guide for C++ is a deal-breaker.

I think the summary is that the Google Style Guide basically relegates C++ to being a better C. There's a place for that, sure, and I've advocated that for some places before, but it kind of precludes using C++ as C++.

out of band of the discussion thread: this Stack Overflow question has a couple of style guides linked.