News for hackers. Stuff that matters.
Re:C++ Hating by Teckla on Sunday November 21, 2010 @05:16PM (#1928042)
As it turns out, the Microsoft Office example is not a good one.

Microsoft Office was written in C, and only relatively recently ported to C++. Please note that I didn't say it was rewritten in C++. It was ported to C++. That is, the minimum changes necessary were made to get it to compile without errors or warnings under a C++ compiler.

That means, technically speaking, Microsoft Office is now written in C++, but it's still very much written in the style of C. Quite a few applications that use C++ are written this way.

Speaking just for myself, I think C++ is scary-complex. There are a lot of corner cases and unexpected behavior to memorize. To be blunt, I think the complexity of C++ gets in the way of productivity. There is no question C++ has some nice features, I'm simply unconvinced they're worth the cost.

I'll stick with C for low level, and pick from a variety of better and more sane (in my opinion) choices for medium and high level work. That being said, if someone is happy and productive with C++, that's great. There's room for lots of programming languages in this world, including C++.

But please, don't look down on developers like myself that have rejected C++, for what we consider good reasons.

Re:C++ Hating by corysama on Sunday November 21, 2010 @01:36PM (#1927549)
I know native desktop applications are considered passé, but I still wonder: How many common/popular native desktop apps can people name that aren't obviously written in C/C++? I guess in the Mac world, Obj-C is common, but that's only a half-step away from C. I thought OpenOffice was a good example until I was educated that it is based much more on C++ than Java. The original bittorrent client was Python, but the Steam Hardware Survey indicates that µTorrent is the client of choice in practice.

I ask because the very common argument that it would be more effective to build apps in higher level languages always made sense to me in theory. But, I don't see it happening in practice. Can anyone provide good counter-examples?

Edit:

Minecraft is Java. That's one.

Re:C++ Hating by gte910h on Sunday November 21, 2010 @02:34PM (#1927676)
Most native widows desktop applications are old, as in pre-2k, when C++ was really the only way to get a high performing desktop program other than C, and really it was argued (now proven false, according to Code Complete 2 as well as lectures I've seen at Georgia Tech) that large C++ programs were more maintainable than large C programs.

For mac, they're usually Objective C, especially if they're from the post NEXT era.

Mozilla is from 1994, MSWord is from the 80's, etc.

Objective C is vastly different from C++, as is straight C. The people who confused C and C++ are really missing a boat to understandingville. You write real C applications completely differently than you write C++ applications, a fact few C++ advocates admit or understand. The added complexity and workplace changes (about 1.5x more expensive engineers and a culture of "easy to fire") required to use C++ (correctly) is huge.

Games/Applications Written in python: Eve Online (a sure counterpoint to his World of Warcraft example), CIV IV, Miro, Blender, MacTelnet, Bazaar, Mercurial,

Applications written in java: Limewire, Maple (the mathematics software), FreeMind, Azureus, jEdit, Eclipse, Spark IM, matlab(along with a pile of other languages),

Re:C++ Hating by makecheck on Sunday November 21, 2010 @08:38PM (#1928449)
I agree, but I think there is a middle ground, which is to use the strengths of multiple languages in the same app. And interestingly, one of the examples you gave is an app that I wrote (MacTelnet), which doesn't just use Python; it also calls C++ and Objective-C. :)

While C was the first language used, I added the others to gain their strengths, which include maintainability and access to powerful libraries.

Re:C++ Hating by gte910h on Sunday November 21, 2010 @10:07PM (#1928577)
Almost all languages use C libraries at some point (as that's what the OSes are written in), but yes, several of the apps are multilanguage.

I find python + weave.inline (insert C++ which is dynamically compiled the first time called) pretty awesome at getting performant apps which are fast to build and simple to debug.

Re:C++ Hating by corysama on Monday November 22, 2010 @01:24AM (#1928893)
I expect that the middle ground of C+HLL is more common than the purist approach simply because it makes sense to use the right tools for very different jobs.

I know that Eve is Python on top of a large, custom C++ code base. Civ and Blender as well. Adobe's Lightroom is a nice case study of 50% C++ and 50% Lua.

I've never used Python+Weave, but it makes total sense. I do think Python's built-in CTypes library is unfortunately underused. (highlights: You can create C-callable function pointers and you can call C DLL functions from default Python. No add-on libs required.)

Re:C++ Hating by gte910h on Monday November 22, 2010 @10:46AM (#1930103)
Almost all the alternatives are quite a bit easier to use than ctypes, with the exception of SWIG
Re:C++ Hating by gte910h on Monday November 22, 2010 @11:20AM (#1930251)
>interestingly, one of the examples you gave is an app that I wrote (MacTelnet), which doesn't just use Python; it also calls C++ and Objective-C. :)

What a small world.

Did you write the C and ObjC code it's calling, or are they independent libraries?

Re:C++ Hating by helmut_hed on Monday November 22, 2010 @05:07AM (#1929298)
"now proven false... that large C++ programs were more maintainable than large C programs"

[citation needed]

"You write real C applications completely differently than you write C++ applications, a fact few C++ advocates admit or understand"

Actually I would assume C++ advocates would be the first to assert this was true... otherwise, why C++?

Re:C++ Hating by gte910h on Monday November 22, 2010 @10:48AM (#1930116)
>>now proven false, according to Code Complete 2 as well as lectures I've seen at Georgia Tech

>[citation needed]

That's a citation...

>"You write real C applications completely differently than you write C++ applications, a fact few C++ advocates admit or understand"

Perhaps, but this article again goes on about C being a subset of C++, which besides being somewhat untrue, it also means he's implying correct C is a subset of correct C++. It isn't. You structure things completely differently, and most C++ programmers have never written large scale C programs before.

Other citations:

http://archive.oredev.org/download/18.5bd7fa0510edb4a8ce4800... Slide 21

The particular lecture was in 2000 around July by Dr. Mark Guzdial which was citing other research which I don't remember over a decade later.

Re:C++ Hating by helmut_hed on Tuesday November 23, 2010 @02:05AM (#1932864)
It's a citation, but not of the right type. You say it has been proven false that large C++ programs were more maintainable than large C programs. Such a proof would be quite extraordinary, to say the least. There is a vast difference between a strongly held opinion that this is true and a proof. Your proposed citations: something in Code Complete (where? what does he say exactly?), lectures you've seen at Georgia Tech (which? where? what is claimed?), and a slide showing that in some codebase (again, which?) a given C++ bug took longer to fix than a given C bug (what was the sample set? how many bugs in each language were there overall? was it the same program implemented in both languages, or something else? were they the same programmers?). None of these things are citations of a proof.

Listen, I don't doubt there are some good arguments against C++. But to claim something is proven is a very strong claim indeed, and not IMO supported by the evidence you've cited. Can we say, instead, that the advantages of C++ are "contested"? Or "debatable"? Or that some C programs are more maintainable than some similar, but different C++ programs by different authors? I could agree with that...

Re:C++ Hating by anon_d on Sunday November 21, 2010 @01:17PM (#1927499)
A long and mostly incoherent rant. I'm ever so sick of seeing these.
Re:C++ Hating by alkavan on Sunday November 21, 2010 @06:49AM (#1926925)
thanks for this article! a very interesting one! didn't know Google Chrome is using Qt GUI framework...

i'm a LAMP web application developer. i know some C++, although never used it in any real-world project, and i strongly agree with the author... if a day comes and i'll need really good performance from my application, think there's only one true solution and it's writing C++ code.

Re:C++ Hating by spooneybarger on Sunday November 21, 2010 @07:59AM (#1926987)
you didn't know chrome was using Qt because it isn't.
Re:C++ Hating by alkavan on Sunday November 21, 2010 @08:05AM (#1926994)
oh, i see now it has been stroked trough! =]