Stroustrup on the Future of C++
/ASCII writes "Bjarne Stroustrup, the father of C++, has written an essay [PDF] on the features of the upcoming C++0x standard. In his essay, he argues that new features should whenever possible go into the standard library and not into the language, but that the language needs to shave of a few rough corners to make it easier to use for novices."
It is interesting to see how an abstract language like a programming language evolves through time. I would think that in a language like C++ the more userfriendlyness should be in the libraries and not in the language, so I agree with the author on this point. Putting it in the libraries makes it better backwards compatible, and distributable.
My wife's sketchblog Blob[p]: Gastrono-me
Shaving off a 'few' rough edges to make it more easy for newbies... It's that what Sun tried to do? (hint: java)
Wenn ist das Nunstueck git und Slotermeyer? Ja! Beiherhund das Oder die Flipperwaldt gersput.
.. as to the pronunciation of 'C++0x'. Any suggestions ?
Stuff that went into Boost should be in the standard library from now on... Also anyone who has had to use g++filt will agree with me that C++ STL error messages need to look less like the dog's breakfast :)
Quidquid latine dictum sit, altum videtur
but that the language needs to shave of a few rough corners to make it easier to use for novices. - that is probably true. Analogy:
GLICK
Exactly! And that's what we're looking to do -
shake these people up a bit, get them motivated.
That's the whole point of the campaign. Mass
attendance is at an all-time low in this country.
And it's not like we're losing them to the
Protestants or Baptists - people aren't practicing
at any denomination these days. If we can sell
them some show - let 'em know the Catholic church
has some panache, we can win them back - even get
some new ones. Fill them pews, people - that's the
key. And cross-promoting - like with the cereal
tie-in grabs the little ones as well. Hook 'em
while they're young.
(sits at his desk, lights smoke)
RUFUS
Kind of like the tobacco industry?
GLICK
Oh - if only we had their numbers. But we are
aiming for the same demographic, even though mine
is the soul-saving biz. And if I have to play a
bit of the devil to bring them closer to the Lord,
then I'll wear the cloven hooves and carry the
pitch fork.
-
Today the battle is between Java and C++ and Java wins. Not because it's faster, because it is more convenient.
What C++ could use from Java? Why, an option to have garbage collection for starters. Just an option, not a requirement.
You can't handle the truth.
Am I the only one who wonders why we need a successor to C or C++?
I've sat through the past 10 years and watched things like Java and D and Objective C come, but meanwhile most serious OS level and game development continues to be in C or C++. Doesn't this demonstrate that new language are merely a distraction to developers who haven't fully exploited the current set?
Perfect opportunity to come up with a decent name but nope, geekiness prevails and the best he can do is: C++0x
And I hate PDFs...if it had spiffy charts or images or something, it would be great...but it's just text! Opened it, saved as HTML and it was 78k.
Shutting down free speech with violence isn't fighting fascism. It IS fascism!
... its embarasing. Compare it to CPAN (perl) or Java. It can't do very much. I wish they could get some real functionality in there. Adding the Boost stuff is nice but. What some something like Java's SWT where you can write an entire GUI using the standard library. Now that would be an improvement for C++.
.h header files. Call it the standard and let vendors code it out. Sweet!
I would be very easy to do. Just "steal" the API spec's from Java. That's what C# did. Just recode the entire Java API into some C++
Why do we need this? D is a beautiful, well-appointed systems programming language. It's got a gcc front-end. It's got garbage-collection if you want, custom memory management if you want. It's got embedded assembly if you want. And it's fast
I thought we were staying with C++ because of all the code that's already written in it...
Global symbol "$deity" requires explicit package name at line 2. - If only $scripture started "use strict;"
C was never a "nice" langauge, it was ugly, had massive problems around memory allocations, and the old unallocated pointer problems. It had unmangled names, so everything was in a global scope.
Then you had langauges like Smalltalk and Eiffel, elegant languages, simplicity, languages which gave control and power.
Then came C++, like C but improving on some things (name mangling), and adding the "power" of multiple inheritence. But worst it didn't solve the problems around memory allocation.
Languages like C# and Java have learnt from C++ and made it much easier to use (but not from Smalltalk see Ruby for evidence of that, and not Eiffel damn though it was good to develop it).
C++ was IMO a dreadful halfway house of a language that had most of the flaws of C and none of the advantages of Smalltalk/Eiffel.
Sometimes the best thing a creator of a language could do is declare it "dead" and get people to move away. Why do C++ if you can do Java/C#, why do Perl if you can do Ruby?
An Eye for an Eye will make the whole world blind - Gandhi
I still remember the 'C++ Advisor' or something the like from Unix Magazine or a similar publication who wrote his last column giving up on the language because only a language lawyer could keep up on the accretions to it. I don't remember what the guy went for, but if one is into OO C derivatives you have C# with its integrated, extensible type system from the DBMS up to other languages. Or Java, if you don't want to be torpedoed by MS' 'IP'. C++ should have been fixed a long time ago, but then AT&T wouldn't have suffered from NIHS and we'd be all using ObjC and OpenStep.
Leandro Guimarães Faria Corcete DUTRA
DA, DBA, SysAdmin, Data Modeller
GNU Project, Debian GNU/Lin
I really wonder how they're gonna do that. I know some compilers have tried that in the past, with some export template thingy stuff. Templates where instantiated at link time. However, AFAIK, that never really worked.
Tristan
Every time a cost of entry is reduced and the expected prerequisites are thrown aside, the result is a truly less capable *person*, not a more capable tool.
Agreed - There are some things that need smoothing, but I for one am tired of dealing with people who lack a fundamental understanding of the *systems* as a whole. Examples of this are the folks coming out with CS degrees who aren't even capable of following a thought, let alone starting an actual career designing and developing software.
For them, a tool like Java offers an entry level that is acceptable given there current capabilities - A tool geared towards THAT user (and a fine one at that).
But C (and C++) can be leveraged by people who know the tool and *use* the tool for what it can do, even with it's high(er, intellectually) cost of entry.
2020. Good luck getting all the stuff in. Long live open standards.
... posts the AC as he thinks to himself, "VB roolz".
twitter.com/gravitronic
I program in C++ from dawn to dusk, and a few things really irk me about it:
1. Member function pointers. Implementation dependent and messy syntax that few people even know about. Their use is limited, and they don't support delegates like C#, making them ugly to work with.
2. The "virtual =0" syntax instead of something nice like "abstract" or "interface" is just weird. How can you set a prototype equal to 0? What's wrong with nice words?
3. Operator new and delete were designed by someone on crack. The only way to call a constructor is with placement new, whose syntax looks like: new (var) type(). Placement delete, however, doesn't call the destructor, which must be invoked manually. Furthermore, delete can't take parameters like new. What.
4. There is a "typeid" operator but no "typeof" operator. GCC has an extension for this, but it's not standard C++ I think.
I'm sure there are other language constructs that have annoyed me, and if you don't read my mind and fix them, Bjarne, I will kick you in the pants!
If you say "here goes my karma" I will bite you!!!
In no way. If you read the B.S. writings (and I recommend he favor the world with a middle initial) he is always concerned with teachability of a feature, which is pretty understandable when you consider he's an academic.
Now, what an academic is doing having a successful programming language with real-world applications is another question...
Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
"Standards are nice, everybody should have their own" That quote always cracks me up.
My other comment is funny
the language needs to shave of a few rough corners
Yo nee t b carefu whe cuttin corner; i yo cu to fa yo ca reall "f" yoursel ove goo!
--MarkusQ
I mainly use Java, just commenting on languages evolving. Looking at Java, I think Java is one of the most clear examples in it. Sun reacts to input of users of the language, and to its competition (.NET) by updating the language and the VM to be able to stay competitive.
The library problems of C++ are well known to me too (port application from one linux box to the next, and welcome incompatibilities and the hours of solving it, last problem though was with IBM Java: It started, but just not completely, library problem!)
My wife's sketchblog Blob[p]: Gastrono-me
I read the article and was confused by some of the code examples.
The '=' have been replaced by '-' signs. (In Acrobat 7 on Windows anyway.) The code makes a heck of a lot more sense once you realize this.
I'm a first year programming student at an Ivy League school and I've
just finished my Visual Basic classes. This term I'll be moving onto
C++. However I've noticed some issues with C++ that I'd like to
discuss with the rest of the programming community. Please do not
think of me as being technically ignorant. In addition to VB, I am
very skilled at HTML programming, one of the most challenging
languages out there!
C++ is based on a concept known as Object Oriented Programming. In
this style of programming (also known as OOPS in the coding community)
a programmer builds "objects" or "glasses" out of his code, and then
manipulates these "glasses". Since I'm assuming that you, dear reader,
are as skilled at programming as I am, I'll skip further explanation
of these "glasses".
Please allow me to make a brief aside here and discuss the origins C++
for a moment. My research shows that this language is one of the
oldest languages in existence, pre-dating even assembly! It was
created in the early 70s when AT&T began looking for a new language to
write BSD, its Unix Operation System (later on, other companies would
"borrow" the BSD source code to build both Solaris and Linux!)
Interestingly, the name C++ is a pun by the creator of the language.
When the first beta was released, it was remarked that the language
would be graded as a C+, because of how hideously complex and unwieldy
it was. The extra plus was tacked on during a later release when some
of these issues were fixed. The language would still be graded a C,
but it was the highest C possible! Truly a clever name for this
language.
Back to the topic on hand, I feel that C++ - despite its flaws - has
been a very valuable tool to the world of computers. Unfortunately
it's starting to show its age, and I feel that it should be
retired, as COBOL, ADA and Smalltalk seem to have been. Recently I've
become acquainted with another language that's quite recently been
developed. Its one that promises to greatly simplify programming. This
new language is called C.
Although syntactically borrowing a great deal from its predecessor
C++, C greatly simplifies things (thus its name, which hints at its
simpler nature by striping off the clunky double-pluses.) Its biggest
strength is that it abandons an OOPS-style of programming. No more
awkward "objects" or "glasses". Instead C uses what are called
structs. Vaguely similar to a C++ "glass", a struct does away with
anachronisms like inheritance, namespaces and the whole
private/public/protected/friend access issues of its variables and
routines. By freeing the programmer from the requirement to juggle all
these issues, the coder can focus on implementing his algorithm and
rapidly developing his application.
While C lacks the speed and robustness of C++, I think these are petty
issues. Given the speed of modern computers, the relative sluggishness
of C shouldn't be an issue. Robustness and stability will occur as C
becomes more pervasive amongst the programming community and it
becomes more fine-tuned. Eventually C should have stability rivaling
that of C++.
I'm hoping to see C adopted as the de facto standard of programming.
Based on what I've learned of this language, the future seems very
bright indeed for C! Eventually, many years from now, perhaps we'll
even see an operating system coded in this language.
Thank you for your time. Your feedback is greatly appreciated.
...change the name from C++ to Coo
if that were to happen i'd *so* be exhilerated!
not having a way to initialize a std::vector with some values has always been one minor annoyance for me when using the stl containers!
and about that "expert" thing: it is not by chance that c++ has become an expert-oriented language! there are SO many hidden traps and arcane details to get wrong that one can't just use c++ with intermediate skills and hope not to be punished! even the most simple mistakes can (and will) lead to segmentation faults and memory corruption!
i am not even saying that c++ is an evil language, but it sure as hell isn't newbie-friendly!
http://linux.wku.edu/~lamonml/software/cpptruth.ht ml
So what is C++0x going to obfuscate now ?
*ducks*
\u262D = \u5350
BTW Some people don't see memory allocation as a 'problem'. For many applications you want complete control over memory allocation and you don't want garbage collections and random moments, expecially for applications with a real-time component.
What I don't understand is this: if you're going to sacrifice performance then the world is your oyster. Why do you have to use some lame C++ clone like Java or C#? Why not try ocaml (whose performance isn't bad at all anyway), or Haskell (where you can make your code as elegant as a Haiku), or some other powerful language. C# and Java solve only one problem in C++ but otherwise open up few new options. Functional programming languages rethink the entirety of programming and make countless new techniques available.
Doesn't it make you feel good to know that our freedoms are protected by politicans, lawyers and journalists.
template serialize(const T& t);
that prints the members of the class recursively.
Wondering why i am doing so strange posts? I am trying to get a "+5,Flamebait" or "-1,Insightful" rating.
Alot of these professors started their career roots with C and old school languages from th 80s. They see no need to change. Why go to C# and have some kid in the classroom smarter than you?
There is still alot of schools out there with a strong focus in C++. The programs figured if you can learn C/C++, you can learn the rest. The reality is not so true. I have seen plenty of graduated kids really struggling to learn a non-Object oriented language.
"template typedef" is for instance something very important (and that will very like be added). Templates are a compile-time functional language, and i think that making this functional language more powerful and easer to use could be a big win.
Wondering why i am doing so strange posts? I am trying to get a "+5,Flamebait" or "-1,Insightful" rating.
I won't argue the relative merits of C++ to other languages. For many organizations, switching from C++ (regardless of whether it would make things easier) is often not an option, and not considered as an option. I will also not argue whether that is bad.
... For Great Code!
The fact is, there's a huge C++ user and code base out there, and if they are going to stick with C++, there's exciting stuff coming.
I feel that C++ is having its second coming, primarily due to developments like the boost library and the Modern C++ Design book.
For example, I've been using a combination of boost::function and boost::bind to make powerful, flexible callbacks like nobody's business. Finally, there's a function "pointer" that can work with both freestanding functions, member functions and function objects, and finally there's an easy way to delay calling functions and use closures, respectively. (Also see boost::lambda).
Sure, almost all of this has been possible one way or the other (the flexible callback has been typically implemented via function ptr and void ptr argument, C-style), but it's very refreshing to actually have the code say what you mean: "I want to delay calling this function", or "this callback doesn't give a crap whether the function you're giving it is a member function or not".
Then there are smart pointers, which have easier-to-follow, clearer semantics, and can be used in STL containers and such. No more using easy-to-shoot-yourself-in-foot auto_ptr. It's been possible to write large chunks of code that have multiple "new" statements, but have no "delete" statements, all while maintaining exact control over the memory allocation.
Of course there's more... Maybe it's stuff that LISP/Scheme programmers have been using for ages, but the key difference is I can now apply tools in production commercial C++ code, during my everyday work. I no longer sit and say: "oh, crap, I could really use a closure here." I just do it.
A big problem is that the new features require greater understanding of the language and thus better training of the run-of-the-mill C++ developer. Many C++ developers I encounter do not have the sufficient understanding of these tools, and of the language. We should strive to educate our fellow developers,
I agree with you -- but if you read the article, you'll notice that Bjarne's point of view (and for that matter, the prevailing view in the community) is also consistent with yours. Basically, changes in the language are to be as minimal as possible. The changes that he proposes will not make life harder or more confusing. The "new C++" is going to be much the same as the old C++, but with a larger standard library.
The place where more substantial changes will occur (in fact have already occurred in TR1) is in the library. Libraries do change, that's a basic fact of life. The C++ standard library is still much simpler than other standard libraries.
What would be great if C++ gets member function pointers to make things like:
:-)
button.onClick = myObject.handleClick;
(Delphi has this sort of event handling)
At the moment you have to play with ugly templates (see gtkmm/sigc++) or you have to make language extensions like Qt does with Signal/Slots.
If C++ would have easy member function pointers (without scary syntax) it would be possible to make nice GUI toolkits in it. The Qt-way is good but not standard... MFCs and wxWidgets way of event handling are ugly C macro dispatch tables, afaik...
Easy member function pointers -> please put it in!
- Some cases where you can type ; where previously {} was necessary, saving as many as two keystrokes.
- The lexer ambiguity where a<b<c>> and a<b<c> > meant entirely different things is fixed, saving as many as one keystroke.
- EVEN MORE "free" constructors which may or may not work quite the way you wanted them to in practice.
- More "fancy cast" operators, which sounds nice until you remember that if there's ever a time you find yourself using the C++ "fancy cast" operators, then there is a damn good chance that it's because you're doing something unwise enough it really would be a better idea to refactor the code to make the "fancy cast" unnecessary.
...in the meantime the fundamental issues with C++ remain not only unresolved, but unaddressed. The template system is still not a generics system, but an ugly cut & paste macro system which can incidentally be used for generics, with some caveats. The class system is still fundamentally brittle and unfriendly to simple things such as upgrading a DLL or determining at runtime if two objects are of the same type. The syntax is still a forest of features whose features interact in ways so crazy and unpredictable it approaches Perl in its chaos; references are still gimped; the distinctions in behavior and use between static and dynamic objects remain awkward and newbie-unfriendly. The features that people obviously desire to have in the language as demonstrated by their tendency to hack them in with third-party libraries (like BOOST) are-- they tell us-- a good thing, and they tell us we should continue to hack them in with libraries (like BOOST). That's nice. You know, that would be a lot easier though if we had a macro system** capable of anything smarter than blind code cut and paste-- or at least a macro system** fundamentally designed to be used for anything at all other than generics.Meanwhile, it appears if I'm reading this right that the most important differences in C++0x will be changes to the standard library. Great. The STL was defined how many years ago, and it's only just in the last few years that compliant implementations have become commonplace? How many decades will it be before the "C++0x" library changes have become common in a cross-platform compatible way?
C++ is an extremely useful language, and making an update to C++ which changes as little as possible so as to follow some kind of "if it aint broken don't fix it" principle is an idea which makes a whole lot of sense. However it seems likely to me from reading this that C++0x will offer so little significant difference from C++ as to make itself simply redundant.
* ("C++0x". Were they specifically trying to come up with a name less convenient than "C#"? Ah well, I guess we can call it "COX" or "cocks" for short.)
** "Template system"
Irritable, left-wing and possibly humorous bumper stickers and t-shirts
More powerful languages like ML, CAML and some Schemes have a module system. This allows the programmer to control the meaning of identifiers (e.g. what function they mean). E.g. what gets imported (and with what name), what gets exported.
Often there is a separate notation for the modules -- it says what files contain the things, what's exported/imported etc.
That's very useful for encapsulation.
C++'s namespaces are a crappy attempt to get the benefits of a module system -- that's likely where he got the idea from.
Hygienic macros would be a good step too.
http://www.thebricktestament.com/the_law/when_to_
--
What short sigs we have -
One hundred and twenty chars!
Too short for haiku.
In CS, you should have learned programming, not a language. You should have been exposed to at least 6 different languages as well as compiler concepts and OS design. If you were not, then you have a Programming degree, not a CS degree, regardless what your diploma says.
Food not Bombs is a nice platitude but it breaks down when you notice that the Bombees are usually well fed
... aren't that standard. Look at the effort that it takes to get Java ported to somewhere. Kaffe is/has been ready for years. Classpath (your standard library) is only getting useful (it compiles Eclipse!) And how many "deprecated" components are there in Java? C++ has plenty of people working on less-than-set-in-stone projects, but those shouldn't be considered standard. Use gktmm by all means. Use Qt. Use ACE. None of them can be considered standard, but you can use them today and Get Shit Done (TM). Hell, even Boost isn't standard. The day anything turns standard in C++ is the day that niche is basically done (on the scale short of introsort pushing out quicksort). GUI programming is by no means a done deal yet; the Adobe people are working up some very interesting tools; Mozart is investigating along similar lines; there's also a smaller personal project that uses embedded DSL in C++ (Boost.Spirit style). Until the One-True-Abstraction blows everything else away, you get the choice of making your own bed and lying in it.
Sigs cause cancer.
First off, Java only recently got templates and generics.
Secondly, C++ is a multi-paradigms language, you can OO or not OO, template or not template, h4x with the void pointers or not h4x with the void pointers. You and your problem choose, not someone else.
It also has operator overloading and you can control your resourse management options, rather than rely on Java's garbage collection which fails when you want to manage resourses other than memory (e.g. DB connections)
So Java and C# may have superseded C++ in many domains, but C++ is still king baby. Albeit a mean king.
And then Microsoft did it right, with C#. Really. It's like C++ version 3, i.e. the one that finally works the way it's supposed to.
If you were blocking sigs, you wouldn't have to read this.
I think the OP would have got on better with "mindshare" than market share...but that's just an aside. I agree that C++ and C#/Java/Objective-C object models cannot be considered supersets or subsets of each other, and think that a language which was "C++ but with C# inheritance" would not be a useful language. At least it wouldn't be a language offering anything significant that others already don't - it would be like Objective-C with static compile-time method lookups. I've never particularly got on with multiple inheritance (I'm an ObjC protocol/Java interface man) but it has its uses to a lot of people - I think it seems like a first go at aspects. Get rid of it and whatever you end up with may be of use to someone, but C++ it isn't. My particular issue with C++ is that which BS seems to be warning against - unlike him I already think there's far too much in the C++ language that should properly have gone into the standard library. For me, OO languages should be like Ruby or ObjC - give me a way to manipulate objects, then give me a bucketload of objects. On the other hand, it's possible to go too far in the opposite direction and end up with a designed-by-committee API like Java which bloats with every new release, because someone somewhere didn't like a particular package and decided it needed a complete reimplementation (but we can't deprecate the existing one for another release or so).
Yes, I have heard of Mono, which last I checked does not include major parts of the core C# libraries. How many major linux applications are written in C# ? I agree that it's a standard. But it is originally designed, and implemented, as a Windows programming language. For example, it is designed to run on an operating system that has a number of features including support for graphical user interfaces and multithreading. It is not a general purpose programming language in the same sense that C++ is.
C# is what C++ always wanted to be. It was written by people who had learned from the mistakes of C++ and Java. It's not perfect, but it's better than either of the others for the majority of desktop and server applications. Anyone who tells you otherwise is a Microsoft hater, or isn't working in that problem realm.
You might also want to have a look at the D programming language, which is a ruthlessly pragmatic alternative.
If you were blocking sigs, you wouldn't have to read this.
C# can be compiled without any problems in almost all platforms
Obviously. The same goes for any language. But what do you propose to replace it? The vast majority of "modern" languages are not compiled to machine code. For the moment, C++ is a good balance between the efficiency of C and the user-friendliness of higher-level languages. It fills a niche (resource-gobbling 3D games, operating systems, compatibility with C/C++ libraries, etc) that no other language does.
LOAD "SIG",8,1
I've been in the profession for over 20 years, and I've seen the same thing happen to certain "standards". Something new and innovative will come along, and within a decade, features will be added that will make it unusable, and foster the demand for "something like X but easier/simpler/faster/cleaner". Most of the feature creep is driven by large corporate interests and the demands of their programming staffs to add features that they claim they can't develop without.
Not many people remember X Window 10R4, but the entire Xlib documentation took up a half-inch thick stack of single-sided pages, and described a basic networked window system that was useful enough to develop distributed systems with. The protocol was easy to implement, straightforward, and clean. But that wasn't good enough for the wonks at Apollo, DEC, HP, Sun, AT&T, and the researchers at MIT. So, once everyone added their "must have" requirements to X Window (we have to have font servers or we can't write good systems!) you ended up with a monstrosity of an Xlib spec that took up a thousand or so pages of documentation, added thousands of new points of failure, and spawned an entire bookshelf from O'Reilly just to try to explain how to use X.
I saw the same thing happen to C++. In the early days it was what it set out to be, a simple, easy to implement extension to C that let you do basic object oriented programming. Sure, it wasn't Smalltalk or Scheme, but it was good enough for 90% of the tasks that really needed simple lightweight objects. But, certain vested software interests demanded that the spec be extended to include things like templates and virtual this and that, all designed to save some corporate programming group some design time, at the expense of creating a spec that required Talmudic scholars to interpret.
I've been on the outside of Java, watching it since it was first described, and I've seen the changes and additions to the language spec over the years. The same thing is happening to Java that I saw happen to X and C++, and I predict that in 10 years or so someone will come out with a language "that does what Java does without all the overhead". I knew Java was doomed to follow the C++/X path when they announced namespace support in the language. Sorry, Javaheads, but that was the tipping point, and you're all on that long slide into obfuscation and bloat that many derided C++ for.
I know many who actually read this post won't believe it, will argue that "Java is different" somehow, but mark my words, Java will bloat into uselessness within 10 years, just like C++ did.
By the taping of my glasses, something geeky this way passes
1. signals & slots. These *must* be introduced. Event handling is a breeze with them.
2. make it mandatory for allocations to be deallocated in the heap they were allocated, that is, for example if you allocate memory with new or malloc() in a DLL, and you deallocate it with delete or free(), then the deallocation must be done in the DLL. This could be done with some tables storing the heap for each allocation. This is *very* important if you work with several DLLs in your project, since if you deallocate something that was allocated in a different module, the system crashes because you try to deallocate in the wrong heap. Especially STL containers cause a lot of trouble with DLLs.
Well, this can be solved by overloading the new & delete operators; also, choosing "multithreaded DLL" as CRT in VisualC is a solution, since then all "multithreded DLL"-Modules share the same heap. Nevertheless, this is something that should be dealt with in the language.
This sig does not contain any SCO code.
-1 Troll??
Come on, that post should have been modded +100,000 Funny. Man, that just made my day.
Another unmarried marriage guidance councillor.
If you were blocking sigs, you wouldn't have to read this.
Oh God, please, no!
C++ desperately needs some basic functionality in its standard library: concurrency, GUI, maybe things like sockets. (Alas, by the standards committee's own admission, some of these -- particularly the GUI one -- are unlikely to happen.)
What C++ doesn't need is for its relatively simple but useful standard library to be overwhelmed by every template freak and his brother's pet ideas, which is very much the direction a lot of the "in crowd" and a lot of Boost contributors are tending towards at present.
By all means, let library designers use whatever language features are useful in whatever ingenious ways they can, but please let the interface for anything that actually gets into the standard library be simple and effective, not infinitely customisable but massively over-complex. That means some parts of Boost would be excellent additions, but others certainly would not.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
I know that's a relatively intangible question to quantify but I did find a survey that lists different programming languages used in the workplace. Seems as if C++ definitely isn't dying just yet. I found another seemingly google-based article on the popularity of various programming languages. Sure Java and C# are up there with PHP thrown in as well, but C++ still has lots of current uses. Seeing I am hooked on Ruby in my workplace I am one of the few according to all of these figures :-)
For a moment there I thought I was looking at a new function name. No offense intended.
Interesting article, no attempt to learn from the mistakes other languages have made. No observation that India/ China/ Pakistan are the new markets. No acknowledgment that the programming IT market is shrinking. C++ was previously just lucky as its previous early adopters were not primarily professionals but were more importantly enthusiastic. As India grows a crop of new low paid professionals just how long will C++ stand up in a world with substantially better language / framework and practical alternatives? 20 x 20 hindsight show that "No substitute exists for being in the right place at the right time" Stroustrup forgets the time,
What kind of twisted logic caused you to work in C++ for 16 years? Pure stubborness or lack of carreer mobility? The WISH LIST of the UPCOMING C++ standard includes absolutely basic things like - Threads - GUI Support (not real GUI support mind you, just things like call backs that make this easier) - Database support When Java, which you so offhandedly distain, had things java.lang.Thread, Swing, and JDBC since Java2.
C++ is the only major language with extensive abstraction but without memory safety. All other major languages are either memory-safe or don't hide the underlying machinery. (Java, C#, VB, Perl, Python, etc. all have automatic memory management. Some use garbage collection; some use reference counts. C is unsafe, but hides nothing.) This fact is responsible for millions of program crashes every day. Most security holes in C++ code come from this problem. Java and C# were invented primarily to eliminate the safety problems of C++. The open source community has generally stayed with C, where at least you can see by examination what's going on. C++ is losing market share to Java.
And Strostrup denies this is a problem.
This has happened before. Last time, it was Wirth. Wirth designed Pascal, Modula, and Modula II, but refused to admit that each had serious problems. He fought external compilation in Pascal. He fought extensions to the language. He even fought compile-time arithmetic. In the end, he took Pascal from a major language to a historical footnote.
Serious systems programming was once done in Pascal, but not in Wirth's version of it. The original Macintosh and Lisa software was written in nonstandard versions of Pascal. And much of the DOS era was built on Turbo Pascal. But proliferating nonstandard versions of Pascal caused another set of problems.
C++ has been in decline for years. "Evans Data has found that the percentage of developers using C++ has steadily declined over the last six years--from 76 percent in the spring 1998 to 46 percent in fall 2004." Strostrup also denies that.
The C++ committee has been taken over by template fanatics. Most of the committee's effort revolves around obscure template features that few will use, and which no responsible programming manager would allow on a mission-critical project. There's very little interest in language safety, and a vocal minority that insists language safety is undesirable or impossible.
All is not well in the C++ world. Claming otherwise is irresponsible.
...is that they're already in use.
Remember that, when the language syntax was designed, the idea was that every conforming C program would also be a conforming "C With Classes" program. Identifiers like "abstract" and "interface" were already in use as user variables, types, functions, etc.
I think you would be pretty pissed off if the next revision of your dawn-to-disk programming language suddenly made "foo" or "i" a reserved keyword. :-)
Time has passed and the two languages no longer fit together like that. Hell, they barely resemble each other anymore. But even ignoring C, now there are valid C++ programs which use "abstract" and "interface" as identifiers, so the problem remains.
You cannot apply a technological solution to a sociological problem. (Edwards' Law)
> forgive me if I take exception to some programmer hack calling himself a Scientist.
No, I won't forgive you, you pompous fuck. He didnt call himself a scientist, he said he had graduated with a degree in CS. That's what it's called and it has as much right to be called a science as rocket science, which is more obviously engineering than CS.
http://rareformnewmedia.com/
First, with ISO-quality standards, updates are made carefully and slowly to insure the least pain to all users relying on the standard. Backwards compatibility is usually the most important concern to the maintainers; there's no "willy nilly" changing going on. [Compare this to say Java, whose specs change much more quickly and perhaps more "willy" than C++]
There are many reasons to update standards periodically:
1. Most standards bodies (such as ISO) *require* that all standards be updated, or at least re-affirmed, on a periodic basis; usually once per decade. Otherwise they are considered abandonded and "revoked" from having its standard status. This helps weed out truely abandoned standards as well as insures that the standard is properly maintained and retains its usefulness.
2. As with most language standards, there are always many many small technical imperfections, or more commonly ambiguities, that need to be addressed or clarified. Most of these will never affect the "common" programmer, except perhaps those on the fringe (such as with embedded systems and so forth).
3. Practical experiences with a language often show shortcommings that, although may be technically minor, greatly detract from the language's usefulness in some cases. For instance when the C standard was last updated they made the numerical semantics much tighter (because they found out FORTRAN programmers could not adequately port programs to C without them). These changes would be hardly noticed by most programmers who don't do heavy and precise computation; but greatly welcomed by those who did.
4. Sometimes novel techniques or components are invented which prove to be very general solutions to widely-encountered problems, and which fit the "style" of the language very closely. Once these experimental components are deemed very mature and stable, adding them into the language proper can benifit all language users. For C++, many of these new extensions come out of the Boost project. But only the most mature and the most general-purpose extensions should be considered for standardization.
For a look at what's on the C++ issue lists, look at http://www.open-std.org/jtc1/sc22/wg21/
I prefer to think of that volume as "The Design Rationalization and Mutation of C++". An astounding amount of it is Stroustrup explaining why one feature or another would have been a good idea, but had to be shelved in favor of something simpler to implement, or requiring fewer keywords to change. It shows the extent to which C++'s design was political in addition to being technical (see Lambda the Ultimate Political Party for how this worked in the Lisp community).
It's a good, informative read, though not always a fun one - I still gnash my teeth every time I read about how they settled on termination semantics for exceptions.
To a Lisp hacker, XML is S-expressions in drag.
D is a refactoring of C++ to make it easier, more powerful, and more robust to use. -Walter
In this case, everyone knows who the father is. It's the mother that is unknown.
un-ALTERED reproduction and dissimination of this IMPORTANT information is ENCOURAGED
I haven't RTFA but I just hope that Stroustrup has come to his senses and got rid of the 'friend' keyword.
I've never seen 'friend' used other than as a bodge to hide the fact that the original design was botched.
After many years of software development, I've never found any use of 'friend' where the rest of the code isn't really hacky too, or any good developer that would consider using it.
The perfect balance of ease of use and richness of features for C++ is defined thusly:
If any novice is able to pick up Bjarne Stroustrups' The C++ Language and beat him within an inch of his life... but no more, then the book is perfectly balanced between ease of use and richness of features.
As it currently stands, I believe that every second or third novice would easily be able to beat Bjarne to a messy, bloody pulp almost as ugly as the code his language engenders.
So do we get a packed decimal datatype yet? WHat of Zoned decimal?
Eh. Everyone should just switch to an interpreted, procedural language with objected-orientedness tacked on to the side, and which keeps promising to come out with a new, slick standard with more integrated OO features and which will break about 3/4 of the existing programs but which (so far) has completely failed to do so which means that existing programs are (so far) safe like, oh say, Perl.
[big, toothy grin]
"Those who are too smart to engage in politics are punished by being governed by those who are dumber" -- Plato
And other TLAs. There should be a moratorium on any more acronyms being added to Java. No language should have more than two or three TLA or FLAs, at the most. When you have acronyms that are as long as the language you're acronyming, that's too much!
I mean, I've seen MILSPECs with fewer T/FLAs than Java has spawned! Hell, even the MILSPEC computer language doesn't have that many!
By the taping of my glasses, something geeky this way passes
I feel like the C++ member function pointers are nearly useless in their current form. If the language supported the concept of a bound member function pointer, it would enable a lot of the nice things you can do in ObjC, and fairly efficiently.
if you have something like:
and want to pass my_foo->Bar(), the compiler should be able to output pretty much the same code as when it would actually generate a member function call, e.g., adjust the "this" pointer if neccesary, lookup the actual function address in the vtab, and then just store those two pointers. Actually calling through this "fat pointer" might even be faster than a regular virtual function call--just put the "this" part of the pointer into the appropriate register and then jump-to-subroutine-register on the function pointer (you could even load the "this" pointer in the branch delay slot on MIPS architectures). This would be incredibly useful, the main problem is coming up with a nice syntax that fits into the rest of the language. How about this one:This has always seemed to me like such an obvious, useful, and unobtrusive extension to the language, that I'm curious if there is some good reason why this hasn't been considered--e.g., is there some nasty case where this would be hard or impossible to implement, or is considered to violate some aesthetic principle of the language, or are what seem to me to be ugly workarounds considered acceptable by most people (and thus extending the language to support it would be "redundant")?I've been developing in Java exclusively for the last 4 years and haven't been following C/C++ at all.
Can anyone tell me what the following quote is talking about regarding enumerations?...
"Also, some 'random extensions' will slip through the net and become 'odd and isolated' features in the language (much as enumerations are in C and C++)."
No, he means it's whatever year it ends up actually being. 2005 was just an example, as was 06 which he also listed.
The enemies of Democracy are
More Libs? What about ACE and RogueWave and the so many C++ Libraries out ther for multithreading, logging etc. How about a Jave like 'interfac' keyword as a part of the language?
High level languages are built on top of other languages. After all, in which language are .NET or Java compilers written?
The good characteristic of C++ is that it's low level. It's the lowest-level language that is independent of hardware, except for plain C.
For this reason, C++ won't disappear. It will just evolve.
Of course, If C++ ends up being a compiler-only language (which is very probable), oh well. What can we do about it?
The largest problem with C++ is its complexity. It is not just too complicated, it is *unmanageably complicated.* Some of the symptoms are:
- The STL has inexplicable omissions. For example, there's no portable way to seed the built-in PRNG in the random_shuffle algorithm, rendering it useless.
- Guruhood isn't good enough. Consider the seemingly simple task of creating a stack that works correctly with exceptions. It's extraordinarily difficult even for a guru.
- Language features interact in nonintuitive ways, producing a combinatorial explosion. For example, if you overload a function in a class, you don't have to use the scope resolution operator, and if you override a function, you don't have to use it either - but if you do both, you DO have to use the scope resolution operator or else you get a compile error!
Insofar as the new C++ standard adds stuff, instead of simplifying, this will only get worse. Since it's unreasonable to expect a new standard to remove features, the problem is unfixable. The result will be that programmers carve out their separate comfort zones, compiler vendors will not implement all features, and the monolithic C++ language will fragment into a Venn diagram of sublanguages. More so than today.and Bjarne sounds as if he were rehearsing his pitch on the eve of a product launch. As if C++ needed to be re-launched! I wonder whether he does this because he fears people's reaction to the new standard. In any case, it seems he hopes to preempt a good deal of criticism by manipulating our view of the standard's gestation ahead of the release. We've seen this kind of thing before, haven't we?
Technique Before the launch, persuade clients to believe that the product's development was/is governed by core values they already hold. Result After the launch, clients are less likely to look at the product critically and dispassionately because they are already satisfied that it respects their core values.But maybe that's what a language creator ends up having to do if he wants changes to be widely accepted and (more importantly) adopted so that the language does not become stale. Yes, "the end justifies the means" and all that jazz. That might account for the delay in the delivery of Perl 6 and the endless series of Exegeses and Apocalypses and Ecclesiastes and whatnot.
What I don't fully understand, then, is why Bjarne spoils an otherwise excellent pamphlet by indulging in the pointless denunciation of enumerations as an "odd and isolated feature" born of or comparable to (it's not clear from the phrasing) a "random extension" that was included in the standard due to operational deficiencies in the standards process. Is this flamebait, tossed our way to draw attention to his article and to the standards process? Certainly, he isn't trying to discredit the process by acknowledging the inevitability of incorporating "random extensions" that would later become "odd and isolated" features, is he?
The list of languages above is a good start, but is actually pretty narrow - they're all mostly imperative and Algol-like. For real breadth, you should break out into one or more of:
Common Lisp, Scheme
Haskell, ML, ocaml
Smalltalk, ruby
Prolog
To a Lisp hacker, XML is S-expressions in drag.
THe one thing I've wanted forever is for it to allow multipel returns from one function. The idea of a function returning one variable comes from math. It doesn't really port well to CS. In CS, its frequently useful to get 2,3, or more pieces of data back. This forces us to one of several hacks- either return a class with all the fields, use input/output variables, or for error returns use an exception.
Something similar to the following is what I envision:
int,int foo();
int a,b;
a,b=foo();
Foo would *always* return 2 variables, and the type would always be known, so we don't lose type safety. But we would gain the ability to read 2 pieces of data.
I still have more fans than freaks. WTF is wrong with you people?
I write this as it is my personal experience:
I first learned Java and then C++.
Shortly after learning C++ I learned wxWidgets (it was named wxWindows then). To make a long history short, I only missed serialization from Java, almost everything else felt better in C++/wx than in Java, especially GUI stuff.
And one of the reasons for it is that wx doesn't use C++ templates at all. No bloated code. It's even simpler to use than Java.
Well the other thing that I miss from Java is JDBC. wxODBC is just ugly (looks like MFC code).
We are Turing O-Machines. The Oracle is out there.
I said it once... and say it again.
Why copy a bad API when there are better alternatives?
wxWidgets is to C++ like gas is to cars.
We are Turing O-Machines. The Oracle is out there.
The vast majority of "modern" languages are not compiled to machine code.
No, the vast majority of modern mainstream languages aren't compiled to machine code. Haskell, ML, Ocaml, Lisp, Mercury, etc. all compile to machine code.
For the moment, C++ is a good balance between the efficiency of C and the user-friendliness of higher-level languages.
That may be true if you equate "higher-level languages" with "Java, C#, Perl and Python," but that's not even close to the full spectrum.
It fills a niche (resource-gobbling 3D games, operating systems, compatibility with C/C++ libraries, etc) that no other language does.
Almost any language can interface with C libraries, because they're the de facto standard.
Do you know of C++ being used in the kernels of any mainstream operating systems (or even many non-mainstream ones)? C is still king here, as far as I know, because when people write operating systems, they want to be as close to the metal as possible, and don't want all the abstraction that C++ provides.
Please explain why you couldn't write 3D games in, say, Ocaml.
I've come for the woman, and your head.
...because Microsoft will put it everywhere for you! Think DirectX...OK, bad example.
As C++ programmer I always wanted to have a language that supported symbolism. I understand why Bjarne wants to call it C++0x but without some AI it whould be hard todo, if you get the point. Putting todo in a library is indeed the catch. To reuse or not to reuse... S++ ?
ngen dot exe
.NET code is interpreted by the Common Language Runtime Just-in-time compiler, and ngen can compile all necessary code to native binary. AFAIK, you'll still need the CLR on-site, since it doesn't package system libraries...yeah, it can be done.
All
--- What
More and more application will be writen in Java, on sourceforge the number of Java projects is just behind C++, just a few hundred. There are a lot of Java enabled cell phones, the game market for Java is currently not realy big but is growing and will grow more in the future when more tools come availible for Java game development.
There are a lot of other areas were Java shows up, realtime software, at NASA for ground-site control but in the future (2009) also on the mars rover. Or the unmanned aircraft (scaneagle) of boeing, parking tickets systems, in the Formula One, the Automotive Industry and healthcare.
It is just getting hard to find an industry (that uses software) where Java is not in.
There is still lot of code written in C++ but I think it will be hard to stay popular and most used computer language, but we will see that within the next 5 to ten years.
Any "rough corners" shaved off had better leave a syntax that resembles the subset most people bother to learn. It's always fun to watch obvious code change from plain and sincere to incomprehensible because some genius decided to wrap the grammar in an "obviously useful" abstraction layer. Whenever this happens, I thank gad (aka Bill Goats) for giant corporations who think of customers before lighting up in their ivory towers.
``Tension, apprehension & dissension have begun!'' - Duffy Wyg&, in Alfred Bester's _The Demolished Man_
I used to think C++ was the best general purpose programming language, until I met LISP. At first, I had difficulties understanding it, but after playing with LISP, I realized how much more powerful than C++ is.
I suggest everyone to read the material at lambda-the-ultimate. You will be surprised on how little you know on programming languages...it was a real eye opener for me.
This must be a troll.
... cough ...
Yeah it must.
Perl has an atrocious OO implementation.
Perl has multiple OO options ranging from "none whatsover" to "just a bit" to a whole lot more... which one were you talking about, or were you confusing a wealth of options with a single narrow minded single purpose.
No one is gonna code something in an interpreted language for what they would use a compiled language for.
No one ? Well as a pracitcing C++ person since 1990, I tend to use perl... sometimes... when it's appropriate (which is rather often, thank you).
Bang goes that argument.
You're full of it!
Hmmmm
Note I don't tell you what you will and won't do, please return the favour and don't try and tell the world what I will or won't do.
I spent a lot of money on booze, birds and fast cars. The rest I just squandered. - George Best
Java doesn't force you to use OO design and type introspection any more than C forces you to use a procedural design.
Karma: It's all a bunch of tree-huggin' hippy crap!
Well, some of us like maintaining our apps.
Besides, people complain about loser programmers with C++, wait til we give them perl and allow them to override $[.
I still have more fans than freaks. WTF is wrong with you people?
C++ has real-world applications now?
Ron dies in chapter 9 of book 7.
I apologize. I should have said "invented recently" rather than "modern".
Please explain why you couldn't write 3D games in, say, Ocaml.
Functional languages are neat, but most programmers are more comfortable designing a large system in an imperative, object-oriented language. Functional idioms can be rather unintuitive, even to those with decent CS educations.
LOAD "SIG",8,1
Functional languages are neat, but most programmers are more comfortable designing a large system in an imperative, object-oriented language. Functional idioms can be rather unintuitive, even to those with decent CS educations.
...." I don't find that sort of argument a compelling reason why people should continue using C++.
Perhaps, but I think that's largely a problem of education rather than some intrinsic difficulty that functional languages possess. Most programmers are trained to use imperative, object-oriented languages from the get go, so switching to functional languages is a significant shift from everything they've learned before. However, I don't see why functional programming would be significantly more difficult if people learned it from the start.
In essence, such an argument reduces to something like, "everyone knows C++ now, so it's easier to keep using C++ like languages, so everyone will continue to know C++,
Ocaml does have an object system, and you can write imperative code in it, so you could likely even write code that's rather similar to C++ in it, too, although that would not be the best way to solve most problems with it.
I've come for the woman, and your head.
Thank you for a thoughtful reply.
To an extent, I agree with your position: I don't favour all-encompassing libraries a la Java, and I do prefer somewhat centralised but community-driven framework's like Perl's CPAN or TeX's CTAN.
However, I think a certain amount of pragmatism is useful. To pick on the GUI library as an example, it's certainly true that many C++ programmers write GUI code, though many more do not. If you do, then whether you're using MFC or wxWidgets or Qt or Yet Another Clone Windowing Library, the basic concepts are very much the same.
In light of this, I believe that a standard library should provide a simplified framework of basic functionality in this sort of case, upon which more powerful non-standard extensions can build if they wish. There will always be platform-specific libraries, not least because not all platforms have the same capabilities, but the needless duplication of effort between all of the libraries I mentioned just above is an impediment to portability without benefit. Why not commoditise the common ground, and leave the specialist library guys to focus on the more powerful stuff in their respective fields, without that unnecessary duplication of effort, and without creating artificial barriers to portability?
For bonus points, this also provides useful basic features for the many applications that only use a simple GUI anyway. In addition, you reduce the learning curve for both the langauge and any libraries building on the standard framework, and make it easier to teach the language to beginners.
You can make much the same argument for many other fields, where a very large number of programmers do essentially the same basic thing, with different bells and whistles on top. C++ excels in providing tools for flexible, extensible, customisable code in libraries: classes, templates, overloading, RTTI, exceptions, and more. Of all the mainstream programming languages in use today, I think C++ is perhaps the most suitable to this framework-based approach. Over a million programmers are going to wind up using MFC or Qt or wxWidgets or whatever anyway, so it seems overly pedantic to restrict the scope of a standard library because a GUI component couldn't be used everywhere. After all, taken to the logical conclusion on that basis, you're not allowed any sort of file access, either, but I can't imagine any language hitting 3 million users if you had to download additional libraries just to open a file!
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
It's about time there were man pages for C++ the way there are for C.
Well, C++ does import C and C++ header files, but I don't think it addresses any other of these issues. Can I: o Change the binary representation of a string literal to something other than string-z? o Create a Container class which is implemented as a list, an array, or merely a sequence of statements depending on how it's actually used? o Control the way exceptions, inheritance, object construction/deletion, or memory management is implemented. o Completely ignore the differences between functionally identical data types with different implementations? o Write a memory management library that would automatically generate the propert "delete" statements for every "new" in a single threaded application. o Write "printf" like function which would check the syntax of its own format parameters at compile time. I don't think C++ can do any of this at the present. I really want a language which will allow me as a library designer to use the best implementation strategy for what the user is trying to do. That requires that I be able to analyze the user's code and even its runtime characteristics, and generate the most efficient implementation of any class with the least overhead. This requires that classes and methods be abstractions, not actual concrete representations as in C++/C#/or Java, that can be replaced by a variety of different concrete implementations at compile time.
I'm no C++ guru (I know enough to make mistakes), but I do know that the language gives as much or as little control as the programmer desires. Just like C and assembler.
After reading the posts in this thread, I can only derive that the most of the Python/Java/Perl/C#/PHP/Ruby crowd have no idea how thier interpreter of choice is built. All are built using C/C++ or a combination of both.
It's really disturbing that most of these programmers have no idea on how thier interpreter of choice interacts with the processor or the OS its running on.
It's downright stupid that most of the interpretive programmers blame the security issues on C/C++ and not the program vendor for shoddy code.
No flamewar intended. Food for thought.
Enjoy.
It's just the normal noises in here.
Congratulations, you've taken another step in the journey of learning to program. However, your conclusion is a little premature.
Some of us took that step a long time ago, lured in by the power and flexibility of functional programming languages, and the elegant simplicity of LISP in particular. And many of us came back, giving a polite nod to those languages, understanding some programming concepts a little more deeply than we used to, even wishing we could bring some of the neater stuff with us, and yet still returning to tools like C++ or Perl or Java for our serious work.
Why did we do this? The theoretical power of functional languages is undeniable, and for sure many of the current mainstream languages could learn more than a trick or two from them, but they tend to sacrifice practicality for purity. Lazy evaluation and side effects make ill bed-fellows, for example. In my universe, we frequently use side effects for I/O, and we do not consider monad-based techniques, however clever and theoretically pure, to be an adequate substitute when we're writing more than toy examples. Similarly, while LISP macros are awesomely powerful, for most jobs some well-thought-out and standardised syntactic sugar will offer more benefit.
It's perfectly possible to gain many of the advantages of functional languages in more mainstream alternatives, simply by adapting your programming practices: write in a more declarative style with liberal use of const, for example. However, at least in C++, you have a choice. In a strict functional language, you don't, and that's a deal-breaker for most programming jobs.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
OK, I'm a bit of a C++ fan (I like practical tools), but let's keep this in perspective.
The containers/iterators/algorithms parts of the C++ standard library are real.
They mostly work, aside from the glaring omissions (hash tables? circular lists?) and design blunders (vector<bool>? basic_string?).
They don't really rock. The containers are handicapped by the absence of corresponding literals, which even the practical monstrosity that is Perl can do. Many of the algorithms are crippled by the lack of first-order functions and the like, and look like a strange attempt at humour to anyone familiar with functional programming languages. Numerous articles have been written by clever people about how to get these C++ features to almost do something using a page of code that other languages can do in one line described in the first chapter of the book.
And the performance is OK, but since compilers still have to accept underlying aliasing concerns and the like, it's still somewhat held back compared to a more robust type system that didn't allow for things like pointer arithmetic.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
I know this is a bit off-topic, but I have always wanted to learn C++. I already know a tiny bit (real basic stuff, like "cin/cout", function declaring, and I've just scratched the surface of classes). Does anyone have any good C++ book tutorials/references?
It's either Plain Old C, or so full of hacks and obfuscation that it was unreadable (or at least unfollowable). I mean, when you see 'friend' everywhere, that can't be a good sign.
I learned C++ when the first affordable compilers became available for the PC, about 15 years ago. I even wrote a multitasking kernel using C++. Then I didn't use it for a long time. When I returned, it seemed Java had been developed and B.S. apparently revamped C++ to look more like Java.
Obviously you havent read anything about C++.
The mantra is "Don't pay for what you don't use" If you dont use virtual functions, you shouldnt pay for a pointer to a vtable. Simple.
C++ is died? Hmmm..., have you ever asked yourself which language Adobe, Microsoft, Macromedia, Mozilla, KDE, Opera (and many others) use to develop their flagship applications?
Someone told me that some C++ compilers or extensions added garbage collection, I was wondering if it had ever been added to the language definition.
Apparently, the C++ programmers here think that's a rude question, so I suppose the answer is "no".
TWW
"Encyclopedia" is to "Wikipedia" what "Library" is to "Some people at a bus stop"
(Yes, I know, that's not a particularly funny joke, but at least it's not Bjarne-yard humor.)
Those who sacrifice security to condemn liberty deserve to repeat history or something. - Benjamin Santayana
I do believe that it is impossible for recently designed automatic transmissions to be ripped to pieces by an engine. I've placed my car in drive to park on occasion (accidently) and it still works. The fact that there is no direct connect to the engine, and that the transmission works under hydrostatic pressure insulates it from a similar fate on a manual transmission of say, going from 5th gear to reverse (assuming the lockout broke).
And just about every recent automatic will cut off the engine once it red-lines. My plymouth voyager did, and my Mercury Sable do.
I know most game programming is still done in c++, but if the universities have moved on, the industry won't be far behind.
I think the universities have jumped the gun on this one. Yes, they've just about all moved to a java-centric syllabus. Mine only teaches Java and a functional language now -- not sure which one -- I was in the last year that was taught Pascal, C, Miranda, a bastardised version of Pascal with concurrent programming structures hacked in and C++: it's just Java and a functional language these days. I can understand why, too -- that was a lot of languages to teach people over 3 years. But, I learned important things:
* I learned how to learn languages quickly
* I learned a wide variety of different language styles
* I learned to use the best tool for the job (witness my final year project, which included a programming language interpreter written in C/flex/bison, with a GUI written in Java)
* I learned that low level programming is hard, but that when you work it out it is manageable
Current students are coming out with CS degrees and no idea how explicitly managed memory should work. That's just wrong: memory management is an important CS subject, if only because *somebody* has to write the memory managers.
It's getting hard to get that kind of degree today. I'd argue that language exposure isn't what makes CS CS though: it's learning the mathematical underpinnings that separates CS from Software Engineering courses. Complexity analysis, discrete maths, logic, semantics -- these are the courses that distinguish CS from other subjects.
It's complete enough to use for major projects right now. What more do you want?
If you were blocking sigs, you wouldn't have to read this.
The functional style simply does not fit every problem. If you want to print text onto the screen, the most obvious way is to do a
t ext-printed-onto-it'
print 'device' 'text'
and not a
print 'world' 'text' : returns 'new-world-where-the-screen-has-the-next-line-of-
After all, computers are executing code and somewhere you do have to start, your haskell
session starts by imperatively invoking your haskell interpreter/compiler/program!
I understand most of your wishlist. But how do you survive without copy constructors? Do we always default to bitcopy? What if there are pointers in the object?
For example?