News for hackers. Stuff that matters.
Re:Zed Shaw on C++ by jshen on Friday July 16, 2010 @12:16AM (#1520261)
"There isn't another language that has both the large-scale modularization given by OO and low-level efficiency of direct pointer manipulation and other C features."

Objective C?

Re:Zed Shaw on C++ by GreenMan on Friday July 16, 2010 @12:30AM (#1520287)
Arguably this might be true, however if you add another requirement to the list Joe posted it isn't. Cross platform code is important to many people. I work on large scale, performance intensive, cross platform applications. Microsoft tells me I should be doing everything in C#. Apple tells me I should be doing everything in Objective C. I just get on with it and use something that works. A language that gives me the ability to combine high level design with low level efficiency and run on multiple platforms.

I often use a paraphrase of the Winston Churchill quote as well. There are probably many better languages for many other applications, however for high performance, cross platform large scale apps C++ is still the only game in town.

Joe's point that all the complexities have reasons behind them is a really good one. I'd suggest reading Stroustrup's "The Design and Evolution of C++" for more information.

Re:Zed Shaw on C++ by jshen on Friday July 16, 2010 @12:45AM (#1520312)
gcc compiles Obj-C, but without some of the improvements apple has made. I personally wish Obj-C were more common because mindshare is a real issue.
Re:Zed Shaw on C++ by woadwarrior01 on Friday July 16, 2010 @02:21AM (#1520453)
Ironically, the whole iphone apps goldrush seems to have contributed in a big way to increase its mindshare. Obj-C is very beautifully designed, I especially like how it adds message passing OOP to C with very minimal syntax additions. But then calling objc_msgSend for every message send, does have a small performance penalty attached, which mostly static languages like C++ don't have to pay.
Re:Zed Shaw on C++ by wglb on Friday July 16, 2010 @08:01AM (#1520864)
So does C++ have any price to pay for say vtables?
Re:Zed Shaw on C++ by kragen on Friday July 16, 2010 @05:03PM (#1522575)
vtables in C++ aren't free, but C++ has a couple of advantages here:

• If you're calling a nonvirtual method, you don't have to pay the vtable cost at all, just the cost of passing this. And most methods in C++ are nonvirtual.

• A call through a vtable is typically a couple of indexed fetches and an indirect jump. Objective-C's mechanism involves a hash-table lookup, which is a bit slower.

Re:Zed Shaw on C++ by woadwarrior01 on Friday July 16, 2010 @04:15PM (#1522378)
Thats why I called C++ `mostly static`.
Re:Zed Shaw on C++ by rbanffy on Friday July 16, 2010 @02:29PM (#1522013)
> a small performance penalty attached, which mostly static languages like C++ don't have to pay.

Then code the performance sensitive parts in C and link it from the language that is best suited to express the solution.