The Register® — Biting the hand that feeds IT

Feeds

The New C++: Lay down your guns, knives, and clubs

Pick up your multI-cores

Agentless Backup is Not a Myth

"The world is built on C++," Herb Sutter tells The Reg. Considering he's one of the language's chief stewards, we question his impartiality. But he does have a point.

After more than 30 years – depending on whose numbers you swallow (these or these) – C++ remains one of computing's most popular programming languages, favored for its speed if not its simplicity.

Apple's Mac OS X, Adobe Illustrator, Facebook, Google's Chrome browser, the Apache MapReduce clustered data-processing architecture, Microsoft Windows 7 and Internet Explorer, Firefox, and MySQL – to name just a handful – are written in part or in their entirety with C++.

And while new languages have since been born, C++ has endured. Java is the only one to have outpaced it in popularity, according to the TIOBE Index. PHP, Ruby, and JavaScript? Sure, some might claim that they are the future, but C++ is the past, the present, and the future.

According to Sutter, C++ is on the verge of its biggest change in the 13 years since it became an official ISO standard, a change that will make it relevant for the next two decades.

The recently finished C++ ISO standard, with the working name of C++0x, is due to be published this summer, following the finishing touches to the ISO spec language and standards wonks agreed upon in March.

Sutter didn't create C++, but he is chair of the ISO's C++ committee in addition to being a noted C++ programmer, author, and chief native-languages architect at Microsoft.

Herb Sutter, photo: Microsoft PDC

Sutter's world: C++ owns it

Sutter tells us: "This is the first major rev of the standard with new features since 1998." when the ISO ratified the first C++ standard.

The new C++ features many changes, but when asked to name the biggest, Sutter highlights those that address some of C++'s biggest bugbears: productivity and efficiency.

The complexity of working in C++ is one thing that Sun Microsystems' James Gosling tried to tackle when making a language that was more programmer-friendly; he cooked up Java, reputedly calling it C++ "without the guns, knives, and clubs." C++'s complexity might also be responsible for making C++ jockeys more prone to swearing than other coders.

Sutter lists auto keywords, lambda functions, and initializer lists as reasons you'll type – and swear – less. Some of the C++ clutter has also been stripped out.

"It really feels like you get the familiar power and way of talking about your code, but [it] feels like a fresh language that doesn't get in your way ... and [you] can write in much more expressive language," Sutter tells us.

Arguably the most significant changes will help C++ catch up to Java in popularity, now that C++ software can be built and run with fewer headaches in the rapidly dawning world of multi-core CPUs.

C++0x introduces a standardized memory model, something that Sun introduced in Java Standard Edition (Java SE) 5.0 in 2005.

Without a memory model, devs have either been building or picking their own libraries to achieve concurrency. Concurrency goes hand in hand with multi-core, as it means that chips with more than one core can run different threads in an application across their cores – or even on different servers. It helps handle the way the threads talk to the chip's memory.

The need for a consistent memory model is growing as more multi-core chips from Intel, AMD, and others become standard in mainstream computers from the PC on your desk to servers at Facebook to the smartphone in your hand.

Regcast training : Hyper-V 3.0, VM high availability and disaster recovery

Next page: Single-core eaten up

Syntax

I take issue with almost all of the above!

On ease of typing, I fail to see how typing "}" can possibly be slower than typing e.g. "End If", especially when including wasted time relocating the cursor to correct typos.

On spotting errors, I fail to see how a missing "}" can be easier to spot than a missing "End If". The eye automatically matches bracket pairs, whereas matching "If", "End If" is far harder.

On the comparison with English, note that English can be pretty punctuation heavy when conveying complex concepts, and all the better for it. Compare the following:

> "When you wake up in the morning, Pooh," said Piglet at last, "what's the first thing you say to yourself?"

"What's for breakfast?" said Pooh. "What do you say, Piglet?"

"I say, I wonder what's going to happen exciting today?" said Piglet.

Pooh nodded thoughtfully. "It's the same thing," he said.

> Open Quote When you wake up in the morning Comma Pooh Comma Close Quote said Piglet at last Comma Open Quote what's the first thing you say to yourself Question Close Quote

Open Quote What's for breakfast Question Close Quote said Pooh Stop Open Quote What do you say Comma Piglet Question Close Quote

Open Quote I say Comma I wonder what's going to happen exciting today Question Close Quote said Piglet Stop

Pooh nodded thoughtfully Stop Open Quote It's the same thing Comma Close Quote he said Stop

16
0
Anonymous Coward

"choice of C syntax came about in the early days of the PC"

What ??!!

12
0

We do need new tools for multicore

I don't know if this new C++ is what we need, but there has been a need this past five years for a toolset that approaches the bare metal like C, but leverages the many core direction our processors are moving in.

Whatever the end product is, it should be able to handle heterogenous cores, because that's the direction platforms are moving in. Multiple different CPU cores, GPUs, hardware media decoders, varying forms of ALU, RNG's and PhysX units included in the silicon. The core system is getting revved these days far faster than before and with a lot of oddball things that didn't used to be considered part of the platform. The software tools are lagging these days, as dealing with this riotous mix always involves custom coding.

It's incredibly complex. I think we'll be groping about for an easy answer for a long time, and in the interim kernel coders are going to earn their money. More power to 'em. Whatever the answer is, it ain't Java, nor C#, nor COBOL.

11
0

More from The Register

Bjarne Again: Hallelujah for C++
Plus: Now officially OK to admit you never used STL algorithms
Interwebs taunt Sir Jony over Apple eye candy makeover
Hey Ive, Ive... add more unicorns, willya?
SCO vs. IBM battle resumes over ownership of Unix
Zombie lawsuit back and wants to suck the brains out of Linux
Apple: iOS7 dayglo Barbie makeover is UNFINISHED - report
Plus: You don't like the icons? Blame marketing
Red Hat to ditch MySQL for MariaDB in RHEL 7
So long, Oracle! Don't let the door hit you on the way out
Shy? Socially inadequate? Fiddling with your phone could help
App 'tells the brutal truth' about social inadequates' chatup lines
Java EE 7 melds HTML5 with enterprise apps
New release arrives with GlassFish, NetBeans support
 breaking news
'Office Facebook' firm Tibbr wants you to PAY for mobe-meetings app
Great idea. Punters won't cough for it though
 breaking news
The only Waze is Google: Ad giant tipped to gobble map app 'for $1.3bn'
Pac-Man-satnav-ish upstart in bidding war with Apple, Facebook
 breaking news
PM Cameron calls for modern, programmable computers! (We think)
IT education musings to G8 chiefs to mystify IT industry