Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c++,comp.lang.c Subject: Re: C/C++ question about dynamic "static struct" Date: Fri, 19 Oct 2012 21:34:23 +1300 Lines: 60 Message-ID: References: <507F380B.2060402@verizon.net> <8q66l9-lkm.ln1@wilbur.25thandClement.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net HLJqfuO5oA2lg/dfoS5MVQC1Uj62kcvyf9OZFQt91eKwWzQsJpFgCWkEM/aQVNOd/b Cancel-Lock: sha1:w1RcKQAaYA2GKvm27ASsOv3N5IU= User-Agent: Mozilla/5.0 (X11; SunOS i86pc; rv:12.0) Gecko/20120423 Thunderbird/12.0 In-Reply-To: <8q66l9-lkm.ln1@wilbur.25thandClement.com> Xref: csiph.com comp.lang.c++:19066 comp.lang.c:27337 On 10/19/12 09:52, William Ahern wrote: > In comp.lang.c Stuart wrote: >> On 10/18/12 James Kuyper wrote: >> [snip] >>> I'm primarily a C programmer, so I may be >>> missing out some elegant C++ way of doing that, but the following >>> inelegant (and untested) code should do the job: >> [snip] > >> I'm intrigued. I have never ever met someone who described himself as a C >> programmer. May I ask what kind of business you are in? My guess is your >> line of work includes either device drivers, embedded devices, kernel code >> or something else that forces you to write C instead of C++. In all these >> years I have never met someone who used C instead of C++ unless he was >> forced to do so. > > Well, you have now. I've worked in several shops (both small and billion > dollar companies) which were C only by choice. The consensus was that the > cost/benefit of C++ didn't pan out, particularly for backend, non-GUI work. > When you're writing high availability server software, the fewer moving > parts the better. That's one situation where the C++ subset of C + RAII can be an excellent choice. > C++ can be too big. You can certainly cherry pick features, but different > people cherry pick different features. And you also need someone who > understands _all_ the features to go through and grok those used and unused. That is why it is important that choice of features is a team decision. I have assisted a team who's chose to use just RAII and function overloaded and another who jumped in boots and all with boost. Both succeeded and both made the best choice for their projects and skill sets. > Plus, there's linking, interoperability, etc, which is more of a pain. And > C++'s strict typing can lead to code bloat and/or excessive casting. I can't say I've seen either and I'm not sure how that could arise. > There are lots of cool features in C++, but often those features are better > implemented in other languages. It can be easier to use C + [insert other > language], then just C++. So, depending on your perspective, C++'s winning > features can seem middling to someone willing to use more than a single > language. Unless like me you happen to be a driver writer! > I'm guessing that you come from a Windows background and/or graduated > college in the past 3 or 4 years. That's usually how it goes, IME. C++ > didn't make waves in the Unix world until a few years ago, and then it took > off with Google and Apple**, especially when they picked up their college > recruitment. C++ grew up in Microsoft-land and in Microsoft-friendly > universities which dumped SUN--or never had the history to begin with. Which > isn't a slight, just an observation about the peculiarities of C++ culture. It's not my sector, but I know C++ and Motif was very popular in the banking world back in the 90s. Maybe it still is. -- Ian Collins