×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Interview Update With Bjarne Stroustrup On C++0x

CmdrTaco posted more than 5 years ago | from the name-spelling-indicates-language-complexity dept.

Programming 589

An anonymous reader writes "DevX interviewed Bjarne Stroustrup about C++0x, the new C++ standard that is due in 2009. Bjarne Stroustrup has classified the new features into three categories: Concurrency, Libraries and Language. The changes introduced in Concurrency makes C++ more standardized and easy to use on multi-core processors. It is good to see that some of the commonly used libraries are becoming standard (eg: unordered_maps and regex)."

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered

589 comments

Nice name, chief. (4, Funny)

snarfies (115214) | more than 5 years ago | (#24690589)

I saw the headline and thought I was seeing some 1337 form of "cox."

huhuhuuhuhuh he said "form."

C#++? (2, Funny)

WED Fan (911325) | more than 5 years ago | (#24690837)

So we are going to create the unmanaged form of C#?

Re:C#++? (4, Insightful)

Noodles (39504) | more than 5 years ago | (#24691001)

Because performance is important to some people.

Re:C#++? (1)

WED Fan (911325) | more than 5 years ago | (#24691121)

Boy, you missed it.

In the section where the interviewer tries to get him to compare with other languages, he says he prefers not to. But, some of the changes being considered look like a melding of ideas from Java and C# to name a few.

The question is, why go that far?

Tackle some of the changes in technology, but by and large, leave the language alone. It is good as it stands.

Re:C#++? (4, Insightful)

neokushan (932374) | more than 5 years ago | (#24691471)

If it was as good as it stands, then newer languages such as C# wouldn't take off.
Don't get me wrong, I love C++ and it's my primary programming language, but to say it's perfect as it is, is just silly.

Re:C#++? (0)

Yetihehe (971185) | more than 5 years ago | (#24691591)

Yeah, maybe they will add GC or JIT in this new C++ already. If they cram some GITS [wikipedia.org] MBA's will not need programmers anymore, so we'll be able to code OSS full time!

Truer words have never been spoken. (5, Funny)

Anonymous Coward | more than 5 years ago | (#24691251)


C++ is to C as Lung Cancer is to Lung

It hurts you to learn C++ is still being used. (0)

Anonymous Coward | more than 5 years ago | (#24690595)

You can't figure out why. You'll never know.

And that warms my heart.

Re:It hurts you to learn C++ is still being used. (2, Insightful)

mangu (126918) | more than 5 years ago | (#24690667)

You can't figure out why

Try writing a large program that needs to do heavy number-crunching in Java/Ruby/Perl/Python, or whatever is your preferred language.

Re:It hurts you to learn C++ is still being used. (0, Troll)

Schnoogs (1087081) | more than 5 years ago | (#24690765)

I have on numerous occasions...and you know what? It was just as fast in Java.

Re:It hurts you to learn C++ is still being used. (2, Funny)

Hognoxious (631665) | more than 5 years ago | (#24691377)

I have on numerous occasions...and you know what? It was just as slow in Java.

Fixed that for you. Maybe it's how you program?

Re:It hurts you to learn C++ is still being used. (-1)

Anonymous Coward | more than 5 years ago | (#24691539)

I have on numerous occasions...and you know what? It was just as slow in Java.

Fixed that for you. Maybe it's how I don't know what I'm talking about because I'm a big stupidhead and nobody likes me and I'm ugly and smell bad?

There, fixed that for you. Maybe you can discuss this without shoving words in someone else's mouth and actually providing some sort of references to back your claims?

Re:It hurts you to learn C++ is still being used. (1)

YodaToad (164273) | more than 5 years ago | (#24691519)

A couple questions for you then:

1. If it was already written in one language why did you rewrite it in the other?
2. If it wasn't written in both languages how would you know it was just as fast?

If you really did write it in both languages I'd be surprised if it really was the "large program" the grandparent was talking about.

Re:It hurts you to learn C++ is still being used. (4, Insightful)

Free the Cowards (1280296) | more than 5 years ago | (#24690767)

Been there, done that.

Most of the time, the potentially reduced running time of the C++ implementation never comes close to the months saved in development.

And when it does, it's trivial to go in and write the speed-sensitive portions of the program in a faster language.

I just don't get it.... (5, Insightful)

AmazingRuss (555076) | more than 5 years ago | (#24691011)

...what do people find so difficult about C++? Use the standard libraries, exception handling, and make sure your news all have deletes, and it's no more difficult than any scripting language. I actually prefer it over scripting languages, which have their place, but feel all sloppy and unspecific. It's like the difference between building a house out of 2x4s and building one out of sticks you found laying on the ground.

Re:I just don't get it.... (-1, Troll)

Anonymous Coward | more than 5 years ago | (#24691207)

If you want to go with your analogy - it's more like the difference between building a house with a hammer and nails (C++) and a nailgun. One will get the job done faster, while the other will make you work more, but potentially give you more flexibility (to break nails).

Re:I just don't get it.... (2, Insightful)

umghhh (965931) | more than 5 years ago | (#24691477)

There is nothing preventing anybody from bad habits in coding and putting nails into own foot. Whether you use hammer or nailgun it makes your foot ache all the same.

Re:I just don't get it.... (5, Interesting)

Free the Cowards (1280296) | more than 5 years ago | (#24691405)

Well, here's what I personally dislike about C++. You don't have to agree with them, but this is how I feel and I think it's how many other people do as well. Certainly when talking to people who prefer other languages over C++, they have expressed similar sentiments.

  1. Lack of libraries. The C++ standard library basically gives you file IO, containers, and that's it. If I want to do something like fetch the contents of an HTTP URL, parse XML, serialize objects, compute dates and times, use regular expressions, compress data, or even just simple, basic Unicode support, then I have to hit some external library that I may have to install and probably can't rely on existing on another machine.
  2. Flexibility. In C++ it is essentially impossible to make, say, a dictionary where each key can refer to an object of a completely different type. This is what you refer to as "sloppy", but I actually find this flexibility to be essential in designing good software. The fact that C++ does not allow it forces me to either twist my program's design in unnatural ways to fit the language, or do a lot of extra work to twist C++ to fit my program's design.
  3. Manual memory management. In any complex program, balancing your news with deletes is not as simple as you make it out to be. Object ownership is a tough problem. Lots of C++ code solves this problem by making a lot of defensive copies, which in turn hurts performance greatly.
  4. Errors. Make one simple typo in a template instantiation and you can generate literally pages of twisted, non-obvious errors. This makes it much harder to get a C++ program to compile than it should be.
  5. Nonportability. C++ compilers tend to differ massively in just how well they adhere to the C++ specification. Creating portable C++ code is much harder than it ought to be, especially when you take into account the necessary dependence on external libraries I mentioned above. And then you need a build system to go with all of that, which brings its own set of headaches.
  6. Readability and writability. With all the type information being declared all over the place, big template declarations, and the like, I find that C++ takes considerably more effort to both read and write.

The really big issues for me are the flexibility and the lack of libraries. The rest is less important. But with C++ it's like building a house out of 2x4s that you're not allowed to cut to length, whereas with moer modern languages it's more like building a house out of prefabricated rooms, with a ready supply of 2x4s and tools to shape them as you need if the prefabbed rooms don't fit your needs.

Please note that this is just my opinion, and you asked for it. Feel free to disagree, but please don't flame.

Some counterpoints. (3, Insightful)

warrax_666 (144623) | more than 5 years ago | (#24691585)

1. Boost.
2. Nonsense. Boost has facilities for this ("any", iirc) and also for something called "sum" types which can achieve what you want in a better way ("variant", iirc).
3. shared_ptr, weak_ptr.
4. Yup. Going to be fixed by C++0x.
5. C++ can be written to be a lot more portable than your Ruby or Python.
6. A matter of taste.

Re:I just don't get it.... (3, Funny)

Hognoxious (631665) | more than 5 years ago | (#24691417)

It's like the difference between building a house out of 2x4s and building one out of sticks you found laying on the ground.

Error 2317 - Invalid analogy - no wheels. Bailing...

Re:It hurts you to learn C++ is still being used. (3, Informative)

squarooticus (5092) | more than 5 years ago | (#24691047)

And when it does, it's trivial to go in and write the speed-sensitive portions of the program in a faster language.

Agreed. Premature optimization is the root of all evil. Write the control flow in a high-level, easy-to-debug language, and later optimize the pieces running unacceptably slow by rewriting them in C. No object-oriented language with legacy holdovers, static typing, and gross syntax needed.

Despite knowing it is a fallacy, I will instruct by appealing to my experience: 27 years coding, 10 of that with a salary, and 5 years before that as an entrepreneur. I have forgotten more C++ than most people know, having written everything from a reference-counting garbage collector to an entire content management system in it... and with the benefit of 7 years of professional C++ development, I can say with a straight face that it is the wrong tool for every job.

Re:It hurts you to learn C++ is still being used. (1, Insightful)

Anonymous Coward | more than 5 years ago | (#24691267)

You are forgetting about the areas where everything is "unacceptably slow" by default. I.E it's never fast enough. (Real time A/V processing for example)

What is needed in those circumstances is a language that is both "close to the metal" and allows for inline ASM, but also lets you do OO on the structural level.

What are the options there? D maybe?

Re:It hurts you to learn C++ is still being used. (5, Insightful)

Free the Cowards (1280296) | more than 5 years ago | (#24691479)

No, the "premature optimization" thing applies to all areas. Especially areas where it's never fast enough.

Why? It's simple: resource management.

You have X amount of resources to put into your product. X is always finite. It's kind of tough to measure X, but you can think of it as lines of code, man-years, or even just dollars. The amount of resources you have varies a lot depending on your budget, how much time you have, and the quality of the programmers you have. But the important thing is that X is always limited.

Now you have two approaches:

  1. Spend X on making the code fast from the start, and keep spending X until you run out.
  2. Spend X on making the code functional and with good design. When appropriate (i.e. when the design is good and the code works), start spending X on making the program go faster. Keep spending X on speed until you run out.

Paradoxically, I hold that #2 will produce a faster program. This is because the X you spend on making the program faster in #2 will be more effective, because you've already laid the groundwork for it. It's always difficult and time consuming to optimize code that doesn't even run yet. It's much more efficient to optimize code that already works. So the result, even though you spend less X on speed, is a faster program.

Think of it as transporting a lot of material into the wilderness somewhere. If you first spend some of your resources on building a road, you'll get the job done for less time and money than if you just start hauling stuff into the woods immediately.

Re:It hurts you to learn C++ is still being used. (3, Insightful)

ardor (673957) | more than 5 years ago | (#24691269)

And I can say with a straight face that you are wrong.

If you base your experiences on pre-2000s C++, you know very little of modern C++. I have been developing in it for more than 10 years, and a few years ago I would have agreed with you, but things have changed. Really.

Re:It hurts you to learn C++ is still being used. (0)

Anonymous Coward | more than 5 years ago | (#24691497)

Agreed. For some reason, stuff like multiple inheritance actually works and makes things easier rather than harder.

And personally, I believe it's because we see more pure C++ as opposed to C++ as grudgingly done by C programmers.

Re:It hurts you to learn C++ is still being used. (1)

pherthyl (445706) | more than 5 years ago | (#24691455)

and with the benefit of 7 years of professional C++ development, I can say with a straight face that it is the wrong tool for every job.

Just goes to show that no matter how experienced you are, you still have things to learn.. I program in C++/Qt full time at work, and for my side business. I did some years of Java, and every time we eventually ran into performance problems. Not to mention terrible platform integration. So I use C++ with a good cross-platform class library (Qt). No performance problems, just as easy to program as Java (although eclipse is nicer than most C++ IDEs), cross-platform, and integrated much better into any platform than Java is.

C# is right out, since it's not cross-platform. Any scripting language is not suitable for large scale apps (and performance is a problem). C is way too low-level to be productive compared to OO languages.

You used C++ for the wrong jobs, or used it with the wrong class libraries (MFC for example). Sucks for you, but if you use the right tools it just can't be beaten.

Re:It hurts you to learn C++ is still being used. (3, Insightful)

iplayfast (166447) | more than 5 years ago | (#24691153)

I've found that the biggest advantage for C++ is the portability. I have written an application backend for PC's (back in the days of DOS) and since then ported it through various versions of windows, Linux (for web use), Palms, and Pocket PC's.

Using C++ allowed me to very easily make the different processor needs, compatible, by writing little compatibility layers, which would swap bigend values, unpack data structures from disk into memory (so is on even boundary). and so on.

Yes the fast speed was why I originally went with the C/C++ route, but the big benefit has been the portability.

Re:It hurts you to learn C++ is still being used. (4, Insightful)

FishWithAHammer (957772) | more than 5 years ago | (#24691423)

You do know that you don't have to screw around with any of that in a managed language, right? "Very easily make the different processor needs compatible" my ass--Java/C# do it on their own.

Re:It hurts you to learn C++ is still being used. (5, Insightful)

johannesg (664142) | more than 5 years ago | (#24691155)

...and roll on the C++-hatred! Second C++ article in a short time, and again lots of venom and anger. "Months saved in development"? Really? What are you doing, implementing your own OS before you start application development? Here's a newsflash: C++ also has support libraries, just like Java, Perl, Python and Ruby. They may not be part of the language specification (and I still think that's a weird idea to begin with, but I'm old-fashioned that way), but that doesn't mean they don't exist.

Anything you could want for in a modern language is there. And nobody is holding a gun to your head and making you write those scary templates if you don't want to.

I'm just positively amazed that Slashdot, in theory home of programmer geeks anywhere, should have such a violent dislike of C++. Not that there is nothing to criticize about it, but it is still an amazingly powerful, versatile tool that programmers anywhere would do well to learn.

Re:It hurts you to learn C++ is still being used. (1)

geminidomino (614729) | more than 5 years ago | (#24691323)

C++ also has support libraries, just like Java, Perl, Python and Ruby. They may not be part of the language specification (and I still think that's a weird idea to begin with, but I'm old-fashioned that way)

Agreed. The thought of C++ going the way of PHP (The number of built-ins is OVER NINE^WTHREE THOUSAND!!!) makes my soul die a little.

Re:It hurts you to learn C++ is still being used. (1)

Free the Cowards (1280296) | more than 5 years ago | (#24691523)

Wow, I don't know what I wrote to deserve such a response.

Speaking from my own personal experience, developing anything sizable in C++ takes much longer than in other languages. Maybe there are C++ gurus out there for whom this is not true. If so, good for them. It does not change my situation. For me, C++ is the wrong tool for the job, end of story. You don't have to agree with that, or even like it, but you ought to at least respect it.

Re:It hurts you to learn C++ is still being used. (1)

Tenrosei (1305283) | more than 5 years ago | (#24690795)

Most/All NDS games are Written in C++. C++ is a great language because it allows you to do so many things and still run fast. BTW i love this quote from Bjarne: "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows your whole leg off." -Bjarne Stroustrup

Re:It hurts you to learn C++ is still being used. (2, Interesting)

Anonymous Coward | more than 5 years ago | (#24690907)

Most/All NDS games are Written in C++. C++ is a great language because it allows you to do so many things and still run fast. BTW i love this quote from Bjarne:
"C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows your whole leg off."
-Bjarne Stroustrup

Yeah except he's absolutely wrong. C++ makes it much easier to shoot yourself, but the effect is more like dropping an atomic weapon on yourself.

I think Alan Kay put it best:
"Actually I made up the term "object-oriented", and I can tell you I did not have C++ in mind."

Kay goes on further to categorically state that C++ does not support object oriented programming because of the static type system.

Re:It hurts you to learn C++ is still being used. (1)

Tenrosei (1305283) | more than 5 years ago | (#24691115)

Obviously c++ isn't really object orientated it was meant to be an application of object orientation on C. and still be able to run and compile C. Only an idiot would say C++ is the definition of an Object Orientated language. but why did we get on its not object orientated all i said was it runs fast and can be used to do a lot of things. It seems you want to say c++ sucks because its not Object orientated when I didn't claim it was.

Re:It hurts you to learn C++ is still being used. (0)

Anonymous Coward | more than 5 years ago | (#24691317)

Obviously c++ isn't really object orientated it was meant to be an application of object orientation on C. and still be able to run and compile C. Only an idiot would say C++ is the definition of an Object Orientated language. but why did we get on its not object orientated all i said was it runs fast and can be used to do a lot of things. It seems you want to say c++ sucks because its not Object orientated when I didn't claim it was.

Granted

However there are literally 10's of thousands of drone programmers out there who think it is, and worse yet they think that it is the very examplar of OO-ness.

Actually I'm not a fan of OO anyway (though it does have its uses in the correct context).

That said C++ (or preferably plain old 'C') is a useful tool to carry around in one's toolbox, but the amount of crap code that is churned out in it everyday really makes it just another COBOL (just as Java is), someone said it best elsewhere in this set of comments: "When C++ is your hammer, everything looks like a thumb."

Re:It hurts you to learn C++ is still being used. (1)

Tenrosei (1305283) | more than 5 years ago | (#24691551)

How can you blame a language for shitty programmers. They shouldn't be called programmers if they need a syntax to hold their hands and say oh you didn't set this pointer to a reference so I won't run it please fix it. People that can't handle the raw power shouldn't receive it in the first place. I say ban people from using c++ if they can't handle it.

Re:It hurts you to learn C++ is still being used. (1)

ardor (673957) | more than 5 years ago | (#24691129)

Yeah except he's absolutely wrong. C++ makes it much easier to shoot yourself, but the effect is more like dropping an atomic weapon on yourself.

I keep hearing this, and every time I see the actual code, its a horrible mess. C++ has bazillions of features; if people are too stupid to understand them, then they shall not blame it on the language. The same people abhor Lisp because its so complicated, Haskell because its so alien etc. and stay in C#/Java wonderland.

Of course there are problems with C++, like the horrible, over-complicated syntax, slow compilation, etc. but most people dont come even close to these.

Re:It hurts you to learn C++ is still being used. (1)

salec (791463) | more than 5 years ago | (#24691137)

Well, it is like a fence: it protects you from falling over, but once it runs out, you may fall again. If you put the fence all around you, you won't be able to go anywhere further.

Similar thing is with protection provided in C++: it works against C kind of stupid mistakes but it brings in a set of its own stupid mistakes. There is always another downfall we are yet to encounter.

Therefore, and realizing it struck me this very moment, languages should be as permissive and empowering as possible (go ahead, knock your self out completely, foot, leg, everything!), but discipline should be enforced intrinsic to language definition.

Language should have means to enable us to construct discipline rule set and just blindly check consistency of code and attached discipline (akin to XML idea, although XML is not a programming language). To return to "fence" analogy, programmer (or project architect) should be allowed to construct new safety fences (or even remove old ones if necessary) as needs arise or problems are encountered.

Programmable Programming languages. (1)

IdeaMan (216340) | more than 5 years ago | (#24691535)

Building a self-consistent rule set as complex as a parser/compiler combination takes years and years of work to get it right. And you're saying leave that to the programmer??? That's the biggest maintenance nightmare I have EVER heard of.

It's bad enough that a new programmer has to learn the application idiosyncrasies; throwing in the fact that every instance of the language is fundamentally different would at least double the length of the learning curve.

I do however see the appeal of having a common syntax for several different styles of programming schema. Imagine having one punctuation set and operator set for a language that can be either script-like (no typing system), strongly typed, garbage collected, etc, and have it all inter-operate. I just don't think it should be left to the whims of some dude in the back room that would never document his intent and execution properly.

If you do go ahead and write it, I nominate Female+- as the name (see http://www.anvari.org/fun/Gender/17_Female_Rules.html [anvari.org] )

Ha! Yeah right. (3, Funny)

bigtallmofo (695287) | more than 5 years ago | (#24690815)

Try writing a large program that needs to do heavy number-crunching in Java/Ruby/Perl/Python

Those languages are way too high level. What you make up in development time will nowhere near compensate you for the greater processing time. I mean, CPU costs are through the roof these days!

But I have to say - even C++ is too high level. I hand code assembler with vi. That's what real number crunchers do.

Re:Ha! Yeah right. (1)

Anonymous Coward | more than 5 years ago | (#24690891)

Why the hell would you waste precious cycles running an assembler? That's what grad students are for!

Re:It hurts you to learn C++ is still being used. (0)

Anonymous Coward | more than 5 years ago | (#24690893)

When benchmarks show that your favourite language is faster than the competition, you use them as supporting evidence.
When benchmarks show that your favourite language is slower, you say benchmarks are useless because they don't represent real-world situations.

Are you kidding, right? (1)

YA_Python_dev (885173) | more than 5 years ago | (#24691309)

You can't figure out why

Try writing a large program that needs to do heavy number-crunching in Java/Ruby/Perl/Python, or whatever is your preferred language.

Python + Numpy [scipy.org] is probably faster that anything most C++ programmer can write, since it uses libraries that can be optimized for the specific processor they run on, including using multiple processors/cores if available.

Hand-optimizing code that runs on modern processors is not a trivial task at all (very simple example: caches can have extremely big and very non-intuitive effects on the speed of code).

Try writing a trivial (5 or 6 lines of code) md5 implementation using only the Python standard library and compare its speed to the GNU md5sum program (written in C). Hint: read blocks with sizes of roughly 10 kB.

Re:It hurts you to learn C++ is still being used. (1)

ratboy666 (104074) | more than 5 years ago | (#24691463)

Sure - pick a reasonable Scheme implementation. Something like Gambit www.iro.umontreal.ca/~gambit/

Full number tower. Reasonable compiler. Sane syntax and semantics. Templates for performance? Sure, just partially specialize functions. Since functions are first-class, you CAN operate on them (just like templates, but without losing your mind). Macros that work, and, if you REALLY like infix notation, Gambit support "six" syntax -- a C-like syntax for Scheme.

Compile your code when you are done (both an interpreter and a compiler). Need MORE optimization? Drop in C bits; right in-line with the Scheme code. Or, for "better-than-C" compilation, move to Stalin. en.wikipedia.org/wiki/Stalin_(Scheme_implementation) Possibly the most aggressive optimizing compiler in (common) use.

Back to you -- why C++?

Interesting suffix (1)

GroeFaZ (850443) | more than 5 years ago | (#24690597)

will it be applied to C as well?

Re:Interesting suffix (3, Informative)

xenocide2 (231786) | more than 5 years ago | (#24690743)

Yes. It's already been done once, aka C99. This isn't the thing that will replace C++, it's the next revision of the language, with multithreading support etc. Once C++ has worked out the hard stuff, C will have it's own next revision based on that.

Once everything's finished, it should be finalized as C++09. It may carry on another year, in which case you might call it "C++0xa" ;)

Re:Interesting suffix (1, Insightful)

Anonymous Coward | more than 5 years ago | (#24690835)

Haha, disregard that, I suck C0x!

instead of Botox (0)

Anonymous Coward | more than 5 years ago | (#24690639)

Now we got "cetox"

Objective C and C++ (3, Interesting)

Midnight Thunder (17205) | more than 5 years ago | (#24690663)

If anyone has used both Objective-C and current C++, can anyone tell me whether the new specification is a clear improvement on either if these?

Re:Objective C and C++ (4, Interesting)

thermian (1267986) | more than 5 years ago | (#24690781)

No, not really.

In fact C++ is barely managing to hold its own any more against C# and Java.

It's not that C++ isn't good, its just that its harder to do things in it then it is to do those same things in either C# or Java. Harder to do means more expensive, and businesses all over are having to tighten their purse strings.

I keep finding that for fast number crunching apps, C beats C++, and for less intensive work its usually easier to use Java or C#, or indeed python, then it is to use C++.

Also, its certainly true to say that in the UK C++ is not anywhere near as useful in terms of getting yourself a job as it used to be.

Re:Objective C and C++ (1)

Ed Avis (5917) | more than 5 years ago | (#24691053)

What exactly are the advantages of C over C++? Assuming a programmer with good taste.

Re:Objective C and C++ (0)

Anonymous Coward | more than 5 years ago | (#24691395)

It is more compact and efficient because it doesn't have those two extraneous plus signs on the end.

Re:Objective C and C++ (0)

Anonymous Coward | more than 5 years ago | (#24691547)

A programmer with good taste.

Re:Objective C and C++ (1)

ardor (673957) | more than 5 years ago | (#24691071)

Well, if you use generic programming properly, you can in fact beat C with C++. Expression templates are an example.

Re:Objective C and C++ (4, Informative)

Free the Cowards (1280296) | more than 5 years ago | (#24690791)

Objective-C is essentially unrelated to C++ in every way. C++0x does not change this fact at all. Comparing the two makes just slightly more sense than comparing C++ and Prolog.

Re:Objective C and C++ (2, Interesting)

larry bagina (561269) | more than 5 years ago | (#24691117)

Objective C is C with a dynamic/runtime-based OO on top. C++ is C with a static/compile-time based OO on top. Plus lots of other syntactic sugar (operater overloading, references, templates, namespaces, etc). And did I mention that Bjarne Stroustrup hates the C language? Not surprisingly, there's a lot more syntactic sugar in the new standard. I hope you don't have diabetes!

On of the features: (4, Funny)

Daimanta (1140543) | more than 5 years ago | (#24690707)

"control of alignment"

I'd like chaotic good please

Re:On of the features: (5, Funny)

meringuoid (568297) | more than 5 years ago | (#24690777)

I'd like chaotic good please

I hate to be the one to break the news, but C++ isn't the only thing that's been revised recently...

Re:On of the features: (1, Insightful)

Anonymous Coward | more than 5 years ago | (#24690991)

Hopefully C++'s revision is better than the crapfest that is "D&D" 4.0.

Re:On of the features: (0)

Anonymous Coward | more than 5 years ago | (#24691245)

Are you talking about d&d 4th edition?

And Then COBOL 2009 (-1, Flamebait)

curmudgeon99 (1040054) | more than 5 years ago | (#24690751)

C++? Isn't that dead and buried? Bjorne created one interesting thing in his life and he is hell bent on keeping it alive--after Java and C# have buried it. Anyone ever tried to get a C++ job? They are few and far between. Java for sure and C# slightly have killed it. How many of you have had to spend countless hours tracking down memory leaks? It's all thanks to Bjorne and his crap C++. Next thing, someone will be pushing a new version of COBOL!

Re:And Then COBOL 2009 (1)

niklask (1073774) | more than 5 years ago | (#24690847)

Have you ever tried writing a large-scale simulation code, for say dark matter/cosmology or cosmic-ray propagation in Java or C#? Please let me know when your code has finished executing.

Re:And Then COBOL 2009 (1)

gladish (982899) | more than 5 years ago | (#24691291)

The amazing part to me is that when people try to compare managed code -- like java or .NET -- to native code c, c+++ they make these wild claims about how much faster native code is. But they fail to mention that most of the managed code is running natively. And as far as your simulation, can you reasonably explain why it would be so much faster in c++ as opposed to say java that we would have to wait forever for it to finish?

Re:And Then COBOL 2009 (0)

Anonymous Coward | more than 5 years ago | (#24690939)

You blame your memory leaks on the language? No wonder you couldn't find a C++ job.

Here's some free advice: Next time you are working in a non-GC language and allocate memory, write the line that deallocates that memory next and then work from both ends towards the middle. Or, be a lazy bastard like me and do everything with std::auto_ptr. :)

Re:And Then COBOL 2009 (4, Insightful)

Tenrosei (1305283) | more than 5 years ago | (#24690943)

hours finding memory leaks? How bad are you at debugging? Plus there are tons of tools to assist with memory leak detection. However, protection is no substitute for abstinence. Learn to write code better. BTW go do some embedded software with C# or Java.

Re:And Then COBOL 2009 (2, Insightful)

bunratty (545641) | more than 5 years ago | (#24690947)

I have C++ code that I maintain. It was written in 2004. I also use Firefox, Notepad++, FileZilla, 7-Zip, which are all written in C++. It seems like most the applications I run are written in C++, with many written in C and some Microsoft programs perhaps written in C#. Java killed C++? You wouldn't be aware of it from the software on my computer.

Re:And Then COBOL 2009 (1)

TheRealMindChild (743925) | more than 5 years ago | (#24690983)

C++? Isn't that dead and buried? Bjorne created one interesting thing in his life and he is hell bent on keeping it alive--after Java and C# have buried it. Anyone ever tried to get a C++ job? They are few and far between.

Maybe if you are the kind of programmer/developer that endlessly creates one-off database front end applications, this is true. C/C++ jobs are not hard to find at all. They just have a different target than you are apparently willing to work with. Try analytics. Try custom driver development.

Re:And Then COBOL 2009 (4, Insightful)

ardor (673957) | more than 5 years ago | (#24691027)

I'll consider Java and C# as C++ replacements once they get:

  1. REAL templates, not this generics joke
  2. Proper RAII, which many programmers mistakenly believe to be useful for memory management ONLY (scoped locks come to mind) (Java/C# finalizers are no replacement)
  3. Java: operator overloading

These points are serious, especially the first, without real templates, generic programming/metaprogramming at compile-time is not possible. These two are one of C++'s biggest strenghts, though.

To be fair, C# 3.0 is somewhat nice, especially its functional core. Java is a totally uninteresting language with very small expressiveness. Of course, if the job requires it, there is no discussion, but in my spare time, I prefer C++.

Re:And Then COBOL 2009 (1)

nate nice (672391) | more than 5 years ago | (#24691163)

All my favorite video game engines are written in Java I hear.

This guy is an obvious troll.

One thing I've noticed is that you're much more likely to work with idiots if working on applications that use Java or C#. As the programming language becomes more powerful, the programmers using it are often far better and of superior education and degree.

Re:And Then COBOL 2009 (0)

Anonymous Coward | more than 5 years ago | (#24691277)

You haven't spent enough time looking then for horribly crappy C++ apps. Especially in MMO emulator communities (SWGemu I'm looking at you!)

Re:And Then COBOL 2009 (1)

dedazo (737510) | more than 5 years ago | (#24691257)

How many of you have had to spend countless hours tracking down memory leaks?

You didn't get a big show of hands here, eh? 1997 called, he wants his raw pointers back. Nowadays we use any of the myriad freely available pointer wrappers and libraries. If you're using any framework at all, chances are you have a pointer class. STL, Boost, ATL, APR, MFC, MC++, etc. They all do. If you are a masochist, that's fine. Just don't assume everyone else is too.

It's all thanks to Bjorne and his crap C++

Well, you're probably just trolling here, but C++ is hardly dead, and it's hardly crap. After all, the two languages you claim "buried" it are written in C++.

Re:And Then COBOL 2009 (1)

UtucXul (658400) | more than 5 years ago | (#24691259)

Anyone ever tried to get a C++ job? They are few and far between.

Actually I just did a couple of months ago. And I found more than one. In fact I'm sitting here at the one I took posting this while I wait for a whole lot of C++ code to compile.

Re:And Then COBOL 2009 (1)

mooingyak (720677) | more than 5 years ago | (#24691313)

Anyone ever tried to get a C++ job?

I had done some very light/minor C++ dev in my time, so I included it as an item on my resume. Last time I was job hunting (about a year ago), 90% of the calls that I got were for C++ positions, which I really did not want. I ended up removing it to filter out the noise.

Garbage Collection? No? BAH! (2, Informative)

WolverineOfLove (1305907) | more than 5 years ago | (#24690779)

I want to like C++, heck, it was the first language I learned. But after so many hours of memory leaks and pointer-induced errors... My friend had mentioned at one point there was going to be transparent garbage collection in the C++0x standard. Unfortunately... looks like it's tabled for now: http://en.wikipedia.org/wiki/C%2B%2B0x#Transparent_garbage_collection [wikipedia.org] Oh well.

Re:Garbage Collection? No? BAH! (2)

luzr (896024) | more than 5 years ago | (#24690957)

But after so many hours of memory leaks and pointer-induced errors...

Memory leaks? In C++?! Well, if you are still managing the memory using new/delete, then you perhaps deserve it. Modern C++ code should not contain more than one delete statement per 10000 lines. If you have more, you should learn the language first.

Re:Garbage Collection? No? BAH! (0)

Anonymous Coward | more than 5 years ago | (#24691045)

hours of memory leaks and pointer-induced errors

Aren't those programmer induced errors?

Re:Garbage Collection? No? BAH! (0)

Anonymous Coward | more than 5 years ago | (#24691329)

Smart pointers. RAII. It's not hard.

LOL C++0x0Rz (5, Funny)

jeffb (2.718) (1189693) | more than 5 years ago | (#24690821)

...or, as a former manager explained it, "When C++ is your hammer, everything looks like a thumb."

Re:LOL C++0x0Rz (5, Funny)

Xeth (614132) | more than 5 years ago | (#24691005)

No, no. It's "C gives you enough rope to hang yourself. C++ gives you enough rope to hang yourself and every programmer who comes after you"

Why not just call it C++#? (2, Insightful)

tjstork (137384) | more than 5 years ago | (#24690985)

That's what this is... automatic memory management...bigger libraries... restricting pointers more and more....

I mean, C++ is evolving so badly it makes Pascal suddenly look a lot better as a compile time language.

Re:Why not just call it C++#? (3, Insightful)

Ed Avis (5917) | more than 5 years ago | (#24691133)

Trust your uncle Bjarne. If you don't use it, you don't pay for it. You need not worry that the language is turning into C# or Python. It's still just as efficient for bare-metal programming as C ever was (and more so in some cases, with template specialization at compile time).

As for 'automatic memory management', that was one of C's big features. Remember the 'auto' keyword?

Re:Why not just call it C++#? (2, Insightful)

Anonymous Coward | more than 5 years ago | (#24691283)

Uh, things like smart pointers have been a standard part of C++ for well over a decade. Way back when C++ first took off, a lot of people got it into their heads that it was just "C with classes", and that stuck around for a hell of a long time because of poor compiler support for the more advanced features. But seriously, you're working with a totally out of date concept of what C++ is. You're like the people who last used Windows when it was 3.11 and haven't updated their understanding of it.

Concurrency in C++ (0)

Anonymous Coward | more than 5 years ago | (#24691055)

I wonder what Fred Brookes would say about that? Perhaps a revised edition of the Mythical Man Month is required here... 'cept he'll have to rename it the Mythical Man Millenium.

Seriously Bjarne, give it up already.

C++ sucked the 1st time round, the only thing he could do to fix the design mistakes would be to invent time travel and perform an actual experimental test of the Grandfather Paradox.

Oh and Taco, FFS fix the captcha system, it's not very reliable.

What's in a name? (1)

bradgoodman (964302) | more than 5 years ago | (#24691173)

"C++0x" - it just rolls off the tounge!

But to their/his credit, from the Wikipedia entry on the "Haxe" language:

he name haXe was chosen because it is short, easy, cool, and "has an X inside", which the author claims is necessary to make any new technology a success. /quote

Re:What's in a name? (1)

pauljlucas (529435) | more than 5 years ago | (#24691389)

"C++0x" - it just rolls off the tounge!

They're not changing the name of the language. "C++0x" simply refers to the C++ specification that is slated for release sometime in the future. Back when they started working on it, they couldn't forecast the year in which it would actually get released; hence "0x" is a placeholder where "x" will eventually get replaced with the last digit of the year the specification is released. As of right now, it's looking like it'll be 2009; hence the specification will become C++09.

MMIC!!! (1)

starglider29a (719559) | more than 5 years ago | (#24691555)

Great! That means in 2099, will have another "man made crisis" when C++99 is being superseded by C++100!!!

Or will we count by Hex? C++0x0x63?

Hopefully, we'll be up to "D" by then.

Fingers Crossed for Native Implementations (2, Informative)

bsmoor01 (150458) | more than 5 years ago | (#24691209)

I really, really, really hope a lot of these things are implemented as compiler- or runtime-level features. I understand the purity aspect of implementing features as templates, but it just bloats my code and slows my compile times. A lot of the compile time for my apps is spent regenerating the same template crap over and over, then waiting on the linker to weed out what's duplicated. It takes forever.

Time for the C++ haters to post... (4, Insightful)

serviscope_minor (664417) | more than 5 years ago | (#24691345)

We will see the usual litany of C++ hating here in this thread. The hating will be generally based around misconceptions or problems that are 5 years old.

So to get them out of the way:

If you're leaking memory or spending time managing memory in C++, then you're using C++ wrong. Get a book written in the last 5 years.

If you're worried about compiler compatibility (with the exception of export which isn't much use anyway), get a compiler written in the last 5 years.

If you think that C does some subset of your task better, then write it in the common subset of C and C++ and quit whining. Or, write it in C and link it against your C++ code and quit whining.

If you think that templates simply provide code bloat, then get a compiler newer than 5 years old.

If you think C++ is slower than C, then get a good optimizing compiler (you know one written in the last 5 years) and do a benchmark. You will generally find that templates make C++ faster.

If you think "modern" languages are more expressive, then give "modern" C++ a try (insert comment about recent compilers here).

Sure there are valid complaints about C++, but the majority of them I hear on slashdot are complete bull. The majority of the remaining complaints will be fixed by C++0x.

One remaining problem is the lack of a vast array of standard, business oriented libraries. I don't write business oriented code, and I find the C++ STL one of the best libraries out there since it provides really good support for writing efficient algorithms.

Another problem is the difficulty in parsing C++. Sadly that's never going away.

But if you're going to complain about C++ compared to recent languages here, make sure that you're talking about recent C++ too, and try to make sure the complaints are accurate.

Re:Time for the C++ haters to post... (0)

Anonymous Coward | more than 5 years ago | (#24691469)

I just ran out of points, and I'm pissed because you deserve one for that post.

I'll never understand how religious adherence to bigoted opinions is something geeks admire in each other but decry in other. The geek hypocrisy stinks worse than the unwashed geek body.

And then there was one (1)

synriga (946549) | more than 5 years ago | (#24691459)

Much like in Demolition Man where in the future all restaurants are Taco Bell, in the future there will be only one programming language.

Thank the maker that I won't live to see it.

C++ has one major problem (5, Insightful)

Barnett (550375) | more than 5 years ago | (#24691467)

C++ is an extremely powerful programming language and that is why I use it every day. But it has one major problem: It is too complicated. As long as you do programming full time you are OK but if too much of your time is spent on the application side of things you quickly get in trouble. This is what people like BS don't seem to get - not everyone can spend 100% of their time studying the language.

Bjarne (0)

Anonymous Coward | more than 5 years ago | (#24691495)

I am with Bjarne on this one.
Bjarne Stroustrup, creator of the C++ programming language, claims that C++ is experiencing a revival and
that there is a backlash against newer programming languages such as Java and C#. "C++ is bigger than ever.
There are more than three million C++ programmers. Everywhere I look there has been an uprising
- more and more projects are using C++. A lot of teaching was going to Java, but more are teaching C++ again.
There has been a backlash.", said Stroustrup.

He continues.. ..What would the world be like without Google?... Only C++ can allow you to create applications as powerful as MapReduce which allows them to create fast searches.

I totally agree. If Java ( or Pyhton etc. for that matter ) were fast enough why did Google choose C++ to build their insanely fast search engine. MapReduce rocks.. No Java solution can even come close.
I rest my case.

auto rocks (5, Interesting)

ultrabot (200914) | more than 5 years ago | (#24691515)

The new "auto" declarations really fix one of the biggest gripes with C++. Everybody is dead tired of doing


std::map::iterator it = m.begin()

Now you can just do:

auto ip = m.begin()

It takes much of the pain away from static typing...

Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...