Stroustrup Says C++ Education Needs To Improve
simoniker writes "Over at Dr. Dobb's, C++ creator Bjarne Stroustrup has given an in-depth interview dealing with, among other things, the upcoming C++0x programming standard, as well as his views on the past and future of C++. He comments in particular on some of the difficulties in educating people on C++: 'In the early days of C++, I worried a lot about "not being able to teach teachers fast enough." I had reason to worry because much of the obvious poor use of C++ can be traced to fundamental misunderstandings among educators. I obviously failed to articulate my ideals and principles sufficiently.' Stroustrup also notes, 'Given that the problems are not restricted to C++, I'm not alone in that. As far as I can see, every large programming community suffers, so the problem is one of scale.' We've discussed Stroustrup's views on C++ in the past."
When I attended college back in 1998 (Purdue), they decided to blindside everyone by teaching Visual J++ instead--Microsoft having "generously" donated the college discs containing the software. I'll never forget those fateful words from the professor: "I don't know this language myself, so I'll be learning it with you as we go." Let's not forget my favorite: "Java is the future of everything."
One semester later I dropped out and never looked back to computer science again as a career choice. In fact, though I bounced around between community colleges for a few years after, I never finished school.
Let me restate this: I'm just glad they're teaching C++ actively again. I wouldn't wish my experience on anyone.
I completely agree with Stroustrup. Too many people these days have little or no exposure to C++, and never learn how programming in the absence of garbage collection works. It is especially problematic in our research labs, where computationally complex problems must be solved with very fast code, but the people writing it get completely confused by pointers and memory management. Worse is when a proof-of-concept is distributed, with horrible bugs and completely incomprehensible code.
Palm trees and 8
Last time Bjarne changed C++, he broke the I/O libraries which gave many of us the thrill of having to go back through old code and rewrite it for no other reason that Bjarne wanted to change something. We got no value out of the changes. They just wasted a lot of people's time.
Bjarne: C++ should evolve, but there's a mass of C++ code already out there. Improve it please, but don't make us go back and rewrite existing code.
...is that C++ is a rather complex and brittle language. :-) ..bruce..
P.S. Feel free to flame away at me, but not only have I developed professionally in C++, I've actually rescued a C++ project by (among other things) drafting C++ coding standards and guidelines for the 30 or so developers working on it.
Bruce F. Webster (brucefwebster.com)
It's way too complex to be managable, resulting in unmaintainable (No IDE can fully go through all typedefs; and if you ever stepped through a program and went into every godam -> operator of boost, you're on my side), unreadable and unneccesary code ("Better declare a private but not implemented copy constructor just to be sure"). It tried to implement all possible paradigmas at once, while trying to be backward compatible at the same time. It's the worst language ever.
That may be so, but there's more to it. It's only been recently fully implemented and a few years ago Stroustrup himself commented that he's constantly surprised that some things (e.g. template recursion) are even possible in C++.
The language is overly complex. The key advice any C++ expert is "restrict yourself to a specific subset of C++". That's the bulk of the difficulty. If C++ were simplified to include only that subset, you'd have a lot less need for training,
I'm continually amazed that the CS majors at my major US accredited university can't program using pointers, object oriented techniques, or parallelism. I think that there is an attitude among the professors that this material is difficult, so it shouldn't be worth a lot of points. As a result, the students don't bother to learn it.
I work in another department and sadly, without formal CS experience, I'm a better programmer than many (if not most) of the CS department's graduates. I don't think, however, that this problem is unique to my school. I've visited other US universities where the situation is very similar.
In fact, I recently took an informal survey of about a dozen CS seniors and found that none (yes, none) of them knew what K&R, the "white book", or the "Art of Computer Programming" were.
I think COBOL and Fortran education needs to improve. Nobody knows how to use it nowadays. These kids and their OO languages... HEY! Get off my lawn.
My university course spent about half an hour on pointers in a 3 year course. Most of that half hour was factually wrong: the slides were full of code samples that wouldn't compile or would always crash.
They did, however, spend two terms teaching Hoare logic. Or rather, they spent one term teaching it, and then repeated the same material in another term with a different lecturer, because their communication was so poor they never realised they had duplicated their teching.
Friends at other universities reported similar stupidities, though not always on the same scale.
C++ is a rather complex language, but simplifying it won't help. The problem is that low quality education is rampant.
Where are they teaching it actively again? I'm a student on computer science at the moment and all they teach in any depth is Java. The only reason I know c++ is my desire to learn it, despite the fact that various parts of my course have recently required a fairly in depth knowledge of c++.
My favorite lecturer quote, "Oh, I don't really do any coding at all".
Who need's speling and grammar?
Maybe it's not the case everywhere, but here the problems it that the CS department teaches entirely theoretical computer science, expecting you to learn everything else when you get to industry.
This is a horrible attitude, as many students (including myself) are not going into software development. Now, I took the initiative, bought a bunch of books, read articles and practiced using all of the techniques/design patterns etc for both OO and procedural languages.
Of course, students can't be taught everything in school, but if you go and ask a classroom of students here what polymorphism is, you'll get a lot of blank looks. The same goes with memory management in C/C++. People just don't know how to do it.
It's a real problem here and I don't really know the right way to fix it.
"The standard will be finished in late 2008, but it takes forever to go through all the hoops of the ISO process."
...
They have a solution for that
C++ isn't going anywhere. Nearly all serious desktop software outside of Mac-land is written in it because the alternatives (Java? C#?) suck rocks. Large amounts of high performance code is written in C++. I don't know where you got the idea that people who care about performance use C from, that's flat wrong in my experience. I agree that D is a very nice language. It will make great strides in the next five yeras. However, maturity counts for a lot.
Disclaimer -- I'm a systems guy. I think I have a unique perspective though -- I get to deal with lousy software after it's been released.
.NET. Without super-fast computers, any programmer would shy away from compile-at-runtime software. The solution for making a program run faster these days is to throw a bigger box at it. I deal with this every day, trying to explain to project managers and CIOs why we need more money in the hardware budget again.
:-)
I came into IT through the back door. I was a science major in college, messed with computers all the time as I was growing up, and realized I could make a better living in IT than I could in science. So yes, I don't have a ton of programming experience. I have picked up a lot of information over the years on how operating systems actually work under the hood though.
If I'm given another internally-developed desktop application that does simple database calls requiring a dual-core processor and a minimum of 512 MB of RAM to run, I'm going to go crazy.
I agree with Stroustrup. There really isn't enough good computer science education these days. Computers have gotten so fast and powerful that there's no need to optimize code anymore. This explains why everyone's programming in Java and
And I agree with everyone who correctly points out that this isn't 1981. Sure, we don't have to squeeze an entire video game into a 4K Atari 2600 cartridge anymore. But I've seen stuff written internally that's just total garbage, and all of it could be solved by thinking a little bit before attacking the problem. Most of the stuff I deal with is straight from http://www.thedailywtf.com./ Think of massive switch() statements that check hundreds of possibilities, iterating over each entry in a million-row database query result, etc. Everyone in corporate-land has dealt with apps like these...click the Submit button and wait 3 minutes for a result.
Some of this can't be avoided. Most corporate IT departments don't understand the difference between good and bad applications. But I think that if we get people interested in embedded systems or something, things may fix themselves. I highly recommend not teaching CS students Java as their first language....
Lack of planning on your part does not constitute an emergency on mine.
C++ header files basically guarantee a slow build due to reparsing. Precompiled headers only help if you don't change a prototype.
If you could have C++ but pull class/function prototypes out of the object files like with Java or C# it would fix a lot of build time problems as you would never need to reparse a header.
http://gcc.gnu.org/wiki/IncrementalCompiler may be of use if you still hold out hope of faster C+ builds...
-- Thorin sits down and starts singing about gold.
There seems to be a direct relationship between level of abstraction meaning complexity required in application and the learning curve.
...
A trade off of higher learning curve for faster programming with more complex abstractions vs. lower learning curve for less abstract complex language application.
In the simplest example and using the basis of common computers:
When you mark a switch with a symbol of a "0" and a "1" what does it mean? On/Off or a variation inbetween these like standby, sleep, or any other thing besides on/off?
What is function overloading of this switch? How many users of computers don't know about the 5 second button push? Isn't the symbol consistant with its use on other devices like TV's
I just told my neighbor, who is retired and had been dealing with computers for a long time, how to shut the computer off by holding the switch/button in for five seconds.
There is a reason why C++ usage is what it is and its not due to failure to explain the way the designer was thinking, but rather that it is to abstract for the pace and change rate of today.
In other words, those who use it correctly have managed to learn to think like the designer. But not everyone thinks in the same way (i.e. some people think primarily in terms of words, others in terms of numbers and still others in terms of visual images or sounds.)
Arrogance is hard for one to see of themselves. A matter of inherent subjectivity. That is what he fails to see, Not what others fail to understand of his mindset.
Profs. Einstein and Hawking are upset that people don't know more phyiscs, James Gosling is upset that people don't code better Java, and Picasso is upset that more kids don't take art class.
stuff |
So let's see. While I will readily agree that C++ really needs a sane syntax, which would include having explicit the default, the real problem with the first program is poorly named functions and classes. Explicit would have saved you that time, but the poor naming would have killed you later anyway. The error in the second one is some programmer's inability to read warnings from the compiler, though again I agree that the default is a backwards. Yet, I have never been bitten by the either,eh, feature, though I have programmed C++ for some years now. (5? I forget).
So will C++ die? Someday, I hope. The problem is that very few languages support the features I need and want. I always forget some, but a short list would be
I do not think these requirements are unreasonable. Yet no language comes close to doing all of these. I've found C++ to be the closests match, but especially the LALR, reflection and lambda functions are sorely missing.
I'm always interested in hearing about languages who comes close to this ideal, btw :)
Religion is regarded by the common people as true, by the wise as false, and by rulers as useful.
Actually, one of the problems with Java is that not everything is an object. That's why I think Java will eventually be replaced by something much more Ruby-like (but with a bit more performance, please). But Java was written to replace C++ at the application level, and as such it does a tremendous job.
Does anyone still USE C++ any more? Seems the only ones around where I work who even know C++ are the old timers. Recently, the consulting company I work for had the opportunity to hire a number of C++ programmers for a legacy project - we had one guy on staff, and couldn't find ANYONE else with the necessary skills.
I will grant you that if you or the parents are shelling out the Purdue tuition, maybe their CS department should find a better professor for their intro course. I am sorry to hear that this experience dissuaded you from completing a CS degree, and there is probably a lot more to your personal story than can be shared on Slashdot.
But I would like to communicate to others out there that you will have a few good teachers in your educational career who are really inspiring, a vast group of average teachers, and a number of who you consider to be really, really bad teachers. The "bad" teachers are that way (in your opinion) for a number of reasons -- they may be "nice guys or gals" who don't have enough preparation or smarts to teach, they may have admitted to you gaps in their preparation that you have taken upon yourself to hold them in disrespect for, or maybe they assign too much HW and work you too hard.
If one is going to take a passive approach, show up to class and demand, "Here, educate me", that is a good way to fail at getting a degree and also to fail at every other opportunity that presents itself down the road. If one is going to take an active approach, working as hard as one can at learning from all teachers, the good and the bad, supplementing gaps in instruction with self-study, working coding jobs, group study, one is going to be successful at college and everything else.
To suggest that a person can have one "bad" prof means that they are on the street drinking methyl antifreeze out of a jar wrapped in a paper bag, this suggests a very passive approach to not just education but life in all its aspects.
C++ will continue to be used in very few specialized applications, but it popularity will decline. Like FORTRAN or COBOL, it will live on. Not like some languages that died a well deserved death (anybody remember APL?)
Everything is an exaggeration (Java isn't very big on low-level system/OS programming as far as I know), but on the application level, Java is the biggest, most succesful language ever, so he wasn't far off.
Visual J++ was an obvious dead end, however.
>> you can start with just functional programming to get the basis of what is variable/function/const
That's imperative programming.
You get functional programming with lisp, scheme, python, ocaml, haskell.
My bad. I meant to say procedural, I guess I haven't had enough coffee yet.
Lack of planning on your part does not constitute an emergency on mine.
C++ education needs to improve.
The best way to go about it is to stop teaching it. That would be a major improvement right there.
... even a basic one, non optimizing one, is an insane task (compared to a C one for instance). Around me, computer science students have to code a fully featured toolchain to reach for their diploma... and quite strangely, only C is able to make it... as soon as you talk C++ (not even its runtime library...), usually it is followed by "mentally ill" or "crazy" or "monstuous project" or ... well you get the idea.
The C++ (or any similar language/framework) price in term of toolchain complexity (I'm not talking about gcc complexity but the complexity of writing a full featured one from scratch) is, for many coders, unreasonably high.
The articles are:
- Sermon at the Soup Kitchen: On C++ Software Quality and Institutional Resistance to Change
- Pointers, References and Values: Passing Parameters, Returning Results, and Storing Member Variables with Musings on Good C++ Style
- On Refactoring C++ Code
- Pointers to C++ Member Functions
I'm no Stroustrup, but I've received quite a bit of praise for writing these.Request your free CD of my piano music.
I think you're having a "Tastes great / less filling" argument. Good education can somewhat prepare a person to learn and use an overly complex language. A bad education leaves a person less prepared to do so.
Having programmed in C++ for many years, and having lived through its evolution to include its nightmarish template system with its nearly incomprehensible error messages even for types as simple as strings, I'm ready to at least blame the language design. Feel free to also blame CS education if you've seen bad examples of it.
I'm full of errors today. I wasn't thinking of the primitives (double,int,char etc). I should have said something like 'first-time programmers have to use objects whereas C++ you can get away with keeping a procedural-oriented mindset. Therefore, you can limit what is introduced. Is that better? ;)
Lack of planning on your part does not constitute an emergency on mine.
"My favorite lecturer quote, "Oh, I don't really do any coding at all"." That's not a big deal. Computer Science is not about coding in particular, but understanding the practices to design and implement solutions to a problem. Computer Science is more about applied math then writing in language X. I learned some of the most important concepts in a class that was all done in pseudocode. Understanding how to approach a problem and solve it efficiently is more important then learning a language. In fact, once you know how most things are working, with a few basic concepts such as pointers or how a computer interpret an instruction listing, you should be able to pick up almost any language fairly easily. If you are not capable of learning things on your own without being handheld through a set of power point lectures, even if you knew C++ instead of Java you aren't going to be worthwhile in the real world anyways. You are destined to be a code monkey.
Hello Gentlemen,
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.
One of the reasons C++ will never die is that it is extremely useful to people who write highly specialized code. There are A LOT of people/groups who do this (and you will never believe this, but that's your problem). For some things, even doing quick proof-of-concepts in Python/Perl/C/Whateever would be a pain because representing basic objects is so complicated that they can only be expressed easily in certain languages. It seems to me that people who are turned off by C++ see its misuse in corporate environments, where any simple, general-purpose programming language will do. In other areas not as visible to the typical contract/corporate programmers, scientists and engineers need a language powerful enough to reasonably represent almost any concept they need. C++ is the best thing we have.
Keep in mind that Computer Science is *not* coding. It's a subfield of mathematics that deals with the theory of computation. The lecturer might have been a theorist.
There is more to science than physics!
www.iomalfunction.blogspot.com
When trying to point the blame, his pointers went everywhere, and his program terminated abruptly.
If you can read this, I forgot to post anonymously.
Too bad this was posted as AC, it deserved some funny mod points.
Fantasy: http://ferrisfantasy.blogspot.com/
At least with C++ you can start with just functional programming
I believe you mean to say "procedural or imperative". You can use this paradigm before you start true OO programming in C++. For a functional language, try ML.
-- Posted from my parent's basement
The big problem with C++ is Strostrup. He's in denial about the fact that the language is fundamentally broken. But he's still influential in C++ circles. Thus, no one else can fix the mess at the bottom.
The fundamental problem with C++ is that it has hiding ("abstraction") without memory safety. This is the cause of most of the world's buffer overflows. No other major language has that problem. C has neither hiding nor memory safety, so it is still vulnerable to buffer overflows, but they're to some extent visible at the place they occur. Pascal, Modula, Ada, Java, C#, and all the interpreted "scripting languages" have memory safety. C++ stands alone as a language where you can't see what's going on, and the compiler doesn't have enough information to check subscripts.
The reaction of the C++ standards committee has been to try to paper over the problems at the bottom with a template layer. That didn't work. The template classes just hide the mess underneath; they don't make the language memory safe. There are too many places that raw pointers leak out and break any protection provided by the templates. The template language itself is deeply flawed, and attempts to fix it have resulted in a collection of "l33t features" understood and used by few, and too dangerous to use in production code.
The fundamental cause of the trouble comes from C's "pointer=array" equivalence. That was a terrible mistake, borrowed from BCPL. The trouble is that the compiler knows neither which variables are arrays nor how big the arrays are. You can't even talk about arrays properly. I mean, of course,
int read(int fd, char* buf, size_t len);
That's just trouble waiting to happen. "read" has no information about how big "buf" is.
C++ added references to C, and should have added syntax like
int read(int fd, char& buf[len], size_t len);
to go along with it, so that arrays became first-class objects with sizes. But it didn't. There are some other things that have to be done to the language to make this concept work, but this is the general idea. This is the elephant in the living room of C++, and Strostrup is in denial about it.
Every time you have another crash from a buffer overflow, every time you install another patch to fix a buffer overflow, every time you have a security break-in from a buffer overflow, think of this.
Why? Market forces dictate demand for a skill or service, this is simply shameless promotion of his own language.
If we really DID need better/more C++ coders, then they would appear.
You feel sleepy. Close your eyes. The opinions stated above are yours. You cannot imagine why you ever felt otherwise.
Seeing as you're counting the STL in that list of features, I trust you do the same for Java or C# - how many do they have if you count the innumerable library features they support?
"Little does he know, but there is no 'I' in 'Idiot'!"
Granted, Engineering always went for things that CS considered "brain dead" -- Basic, PC's, DOS, Windows. But Matlab is more brain dead than most.
What happened is that a lot of the current generation of Engineering profs cut their teeth on FORTRAN -- their Intro to Programming was in FORTRAN, whatever industrial job they had before getting a PhD had them compute things in FORTRAN. Few of them were ever comfortable in it and most of them spent hours in the computing center debugging programs dumped to massive punch card decks.
When Matlab came around, it was numerical Nirvana. It had this massive numeric library that you didn't have to write your own Q-R linear equation solver or SVD subroutine, and you didn't have to go searching for this stuff either, it was all there. It had a command prompt to performed immediate execution along with reasonably friendly error messages. And it acquired a thoroughly feature-full graphics package.
Don't get me wrong, Matlab is a very capable numerical applications language and even turns out to be one of the better Java scripting languages of all things. But it really falls down in terms of extensibility of its type system, and as far as what Mathworks tacked on for object-oriented programming, fuggedaboutit. It is also the Swiss Army knife of software for a whole bunch of people, and forget about introducing them to a socket wrench and handle that can apply serious torque to a bolt when they think they can get by with the pliers tool.
While people who know what they are doing can benefit from the convenience of the numeric and graphics libraries, the immediate mode, the verbose error handling and rare instances of complete crashes, if you don't know what you are doing (i.e. you are just learning), it can lead to as many hour-gobbling skull-cracking debug sessions as anything else. Our required Numerical Methods course is in CS, it uses Matlab, our faculty is complaining that the students are complaining that they hate the course because they are spinning their wheels trying to get programs to run (in Matlab of all things), and we have guys in our department we want to teach Numerical Methods (in Matlab, of course), in the context of a watered-down Intro to Engineering offering.
What the community needs right now is a Python distro with enough of a numerics and graphics package rolled in to do 90 percent of what is in Matlab (Are the Python people still hashing out that Numerics/Numpy divide? Is there an engineering graphics library that is Numerics/Numpy compatible? 99 percent of what you do in Matlab is that you have a Leatherman Tool of a 2-D array type (Matlab, Matrix Lab) along with all of the libraries being compatible with that type.) CS departments could teach their Intro to Programming along with their Numerical Methods courses using that Python distro, and we can save a generation of engineers from brain damage.
Sometimes, when you want to prototype something quickly, being able to edit a test.cpp file with a basic int main( int argc, char *argv[] ) { } and compile it with a g++ test.cpp is the way to go. I would hate to forced to have to open up a IDE window, create a basic application, edit and register a couple of derived classes, a project build file, all to test something simple like some library functions.
Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
Python maybe? It's quite close to your spec I think.
Colorless green Cthulhu waits dreaming furiously.
It's a simple thing, really. I'm a university lecturer and I have explicit instructions to grant the degree to as many people as possible, 100% ideally -- and that's independent from their actual skill level, because some of them are barely able to understand simple questions or simple mathematics. The only solution is to lower down the expectations for the whole class -- and single out the brightest students to teach them more advanced topics whenever the mass is still trying to solve the easy exercises. Not very flattering, but then, I don't have much of a choice.
Agreed, others have already corrected me (see above) and I have acknowledged it. I have used some Lisp so I am (at least tiny bit) familiar with functional programming. Just a slip of the fingers :/
Lack of planning on your part does not constitute an emergency on mine.
This is an extremely important point. Use the right tool for the job. C++ is not the right tool for most jobs it's being used for. It's probably fine for low-level systems programming (the same stuff you'd use C for), but the only excuse to use it for large applications is if you're stuck in the late '80s and there's nothing better availlable. Now there are far superior languages availlable, so learn to pick the right one for the job.
Why does this compile? Because unless you put the word explicit before the constructor taking an int as an argument C++ automatically converts any int to a ThreadPool whenever given the choice. The C++ community generally blames these sort of errors on the user for not being an expert in the language. This is stupid. In a sane language the language should do the most obvious and least damaging thing by default and require explicit permission to do anything else. In this case the language does the most bizarre and stupid thing unless you explicitly tell it not to.
That's basic C++, not an expert topic by any means. The language would be a pain to use if it didn't do things like that. For an example in your integer conversion, if you're doing any sort of custom math class (say a Big Number class or a Fixed Point class), you really the compiler to automatically convert ints into the proper class. If you're working with strings, you want the compiler to promote a string literal into an std::string when necessary. You came up with a contrived example to explain your point. If you've got a case like that where the normal behavior doesn't make sense, then go ahead and use the explicit keyword, that's why it's there.
This code will call A's version of the doSomething method and the fail to call B's destructor. Why? because virtual functions have a (very) slight cost in memory and performance so C++ does the most efficient thing by default rather than the least stupid. If you want things to work correctly you the coder have to explicitly tell the compiler to make the destructor and method virtual with the virtual keyword.
I resisted C++ for a long time, as I thought not having virtual functions by default defeated the point of using classes. I'm still not thrilled with it, but I've learned to take it as it is. I think C++ is a terrible language for designing core libraries, but it is rather useful when designing applications. At that point you know if it makes sense or not for something to be virtual.
If everything was virtual, I'm not sure it would necessarily mean C++ was a better language, I think it would just change what projects people use it for. Right now it's a great middle ground for embedded and low end systems - you get to pick and choose what parts of OOP benefit your project. Again, going back to one of my examples before, if you wrote a Fixed Point math class and had everything virtual, that would significantly hurt your performance.
If you don't believe me take a look at mozilla.org's Portability Guide. I can sum it up for you if you'd like: if you have to write C++ please use as little of it as possible. Oh and another list of all the stupid reminders you have to continually provide to compiler to minimally reduce unexpected behavior. I actually work on embedded software at NASA and they have pretty much the same thing.
To be fair, a lot of that is due to Mozilla.org's desire to run on old Unix platforms. The big Unix developers stopped putting much effort into their compilers in the early to mid nineties, before a lot of the fancier stuff in C++ existed, let alone was standardized.
AoCP is excellent, but K&R is a overrated piece of shit. It's hard to learn from, for a decent book on C -- it should be "Pointers on C" by Kenneth Reek or something similiar.
K&R is fine once you actually know C, but to learn from it's a horribly terse non-self-explanatory PoS. I'm rather interested in how many people know the Unix Haters Handbook, as that is more worthwhile.
For quick prototyping, use Python or Ruby. Or even Perl, if you really can't help yourself.
Yes, the lack of top-level functions in Java is well-known criticism (at least from the Python/Ruby crowd), but personally I've never had any problems with that, mostly because I don't use Java for quick scripts. The constant need to cast everything is a much bigger problem, IMO.
Queen's University here in Kingston (Ontario, Canada) is dropping C++ from their 2nd year intro CS course this fall. It is Java only now. And the first year intro CS course is switching to from Java to Python.
I learned FORTRAN first semester of my freshman year, way back in 2003...
I think that all Bjorne has really done to the C language is cause more and more fragmentation, forking and division... He created fragmentation with C++, and he again created more fragmentation with "C++0x". This guy should be banned from creating languages. Instead of making new languages, why not improve on the C language standard? He doesn't want to do that, he wants to make a name for himself by creating all these different languages... I don't think what he has done has done anything to better the world of computer science.
It is annoying and slow, but the fact that you can't as easily just hack together a quick and dirty test makes writing a proper unit test comparatively less unattractive. Annoying, but perhaps not such a bad thing in the long run.
Chernobyl 'not a wildlife haven' - BBC News
I think you have some kind of language problem.
I can understand your difficulties. C++ is a mucher simpler and much more logical language than English, if you can't even master English, especially in Denmark where we have a mandatory 7 years of English education and everybody speaks and writes fluent English - No wonder you can't understand C++
Or maybe you just need to study harder.
For the record, I'm inclined to agree with Torvalds. The main problem with C++ is its insane levels of complexity and its unerring eye for adding subtle and difficult-to-diagnose problems once things like multiple inheritance get factored in.
Dog is my co-pilot.
Err, are you saying that you *have* to use an IDE to generate a class to run a Java app? The equivalent of your C++ main would be:
public class Test {
// ...
public static void main(String[] args) {
}
}
Why do you need an IDE to write that?
I feel your pain -- I don't agree with everything you've listed, but it seems most languages provide maybe half.
Let me try what I know -- Ruby does this:
So, by my count, 7 yes, 2 maybe, 1 no, and 1 I don't know at all.
I probably have a slightly longer list, but I am constantly frustrated by just these three:
I can occasionally get two. Ruby is #1 and #3. Squeak/Smalltalk seems to be #1 and #2. Java/C# might be #2 and #3. I write Ruby because I'm currently writing web apps, and I can actually just throw more servers at the problem to make it go away.
But I keep finding new ideas that I wish I had elsewhere -- Erlang's parallelism, though it isn't much, still contains features I find missing from most languages. Haskell's lazy evaluation shouldn't require a purely functional language.
But if I could ever find a language which supported all three of those core ideas, I'd happily implement the rest on top of it.
Don't thank God, thank a doctor!
Close (I prefer ruby, but they are very similar on this level). But it is sorely lacking in the static department (metaprogramming and typing and polymorphism). It also falls short on the performance target, though I can and do disregard that for many applications.
Religion is regarded by the common people as true, by the wise as false, and by rulers as useful.
We've seen this before.
Oh, and I kind of doubt Bjarne himself would've said that about MapReduce, given that MapReduce could be created in many other languages. For that matter, Google extensively uses Python. If C++ were good enough, why is Gmail written in Java? And so on...
Don't thank God, thank a doctor!
That's a very good move. Our Institute in the ATL did the same a few years ago. It is a good path to take. I feel Java (intro to OOP) & Python (intro to prog)are excellent introductory languages that ease newbies into building a pretty good solid starting foundation to programming. And I think the 1st intro is required for everyone irrelevant of their major, and the second is recommended.
I don't think a language or tool should ever be taught (if you must, leave that to post college overly expensive "seminars" and "workshops"), but the concepts behind their field should be embedded into students. The students should come out with a knowledge base and a thought process that can be used to gain specific insight into any language or tool on their own.
Of course, over here, once you get past the intros, the weed out classes start up with C, C++, assembly, and whatever the professor's flavor of the quarter is (sometimes, its left up to you)!! And although I feel for the students who need to go through this gauntlet; I can't think of a better way to do it.
I studied CS in academia and worked in industry for a while, and I don't know what the "white book" is either. I guess I'd better give up and become a lawyer. :-(
Or, just maybe, CS education is about more than name dropping...
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
For simple projects (or even complex, if you're a masochist), you can compile at the command line using javac. No need to fire up an IDE or make a build file.
R.Mo
Thank you (and everyone else) for suggestions. I have never seriously learned Haskell because it's OO support is so poor, and even though I forgot it on the list, this is also important. Is LISP stronger in this area?
Religion is regarded by the common people as true, by the wise as false, and by rulers as useful.
I wish I had mod points here. So many people get this wrong. Computer Science != Computer Engineering. I studied engineering and we build things to get things done. In Science you don't necessarily want to get things done, but want to understand why things get done and how they get done.
I always use the example of LaPlace transforms. Engineers devised them and used them to solve problems. The scientists at a later point in time figured out why they work.
Though I do take issue with the code monkey aspect because in essence that is what an engineer is. Nothing wrong with being a code monkey, though I don't think I would get a code monkey to devise a new relational database model.
"You can't make a race horse of a pig"
"No," said Samuel, "but you can make very fast pig"
Yeah but if we don't start coding in C# the theorists win!
I spent 2-1/2 years at MS and if it is one thing that disappointed me it is how indifferent most developers were about learning C++... which prevented them from writing great code. Afterwards, I worked with some *NIX snobs in a dotBomb and all they ever did was trash C++ (somehow Java was "great" though).
Few could tell you why you necessarily want to make your destructors virtual, why not doing "delete [] array" is not necessarily a memory leak, where must references be initialized, why it's good practice to use (at the time) the new cast notation... the list went on.
It's been a decade, I've started to forget all that material. I followed the ANSI committee, read most issues of "C++ Report" and wrote some of my best code during my days at MS. Unfortunately I can't say I found many people who could relate with verve for putting out great code. (All you trolls, this is about a programming language, not about any specific product or company, go outside, run 'til your heart feels like it's going to give out so your thoughts gravitate elsewhere... better yet, let it give out)
Sayonara C++,
-M
PS: C++ has become niche Bjarne.
The thing is that Java is extraordinarily similar to C++. If you are a competent C++ programmer, you can learn Java in an afternoon (or less). If you are a competent Java programmer, it will take you a little bit longer to learn C++. At least a few days by my estimation.
In fact, when I was an undergrad, our CS department transitioned from C++ to Java. I did about 30 minutes of reading on the internet, and was up and running in java. There was a document called something like java for C++ programmers, which had a list of about 20 language differences that you needed to be aware of. The rest was just poking around in the java SDK documentation to figure out the standard classes that ship with java.
Despite this relatively easy transition between java/c++, I am still a HUGE advocate of teaching C++ (and perhaps even a separate class specifically on C). It's hands down the most versatile language out there for most things, and a HUGE stepping stone in easily learning any other practical language. In fact, I see no real advantage in teaching Java over C++.
I do a lot of development in python, bash, php, and matlab, but still see C++ code on a monthly basis. In my field it's particularly useful for interfacing with hardware. My colleagues without a similar C++ background (but who are very competent programmers in other languages) just throw up their hands at the first sign of C++.
I look at your example and think, Huh? I used to code C++ (about 4 years ago) and since then shifted completely to C# and Java. And if I need some low level code I will write it in C.
I talked to another individual about C++ and what he hates with C++ is that you are taking too much time thinking about infrastructure and not solving problems. Whereas in Java you think more about solving problems and less about infrastructure.
"You can't make a race horse of a pig"
"No," said Samuel, "but you can make very fast pig"
You are labeled a troll, but you are talking straight talk here.
For example your garbage collection comment. I think it is only C++ and C that don't have garbage collection. Yet in Python, Perl, Ruby, Java, C#, etc, etc there is garbage collection. For crying out loud even D has garbage collection. This tells me that maybe C++ is missing the point.
I would prefer more people learn about C in combination with C# or Java.
"You can't make a race horse of a pig"
"No," said Samuel, "but you can make very fast pig"
Real Mike,
you have my full attention. Please, support your assertion that Java and C# suck rocks.
C++ can be fast at execution time but the development time is prohibitive in many applications where you need to be agile and actually ship code in a hurry. I try not to get hung up on all the esoteric points of different programming languages, although I am quite amused to read other's comments. Yet, I will hazard a post on this topic.
I learned C++, not all of it to be sure, but the portions 85% of us might need in a given project. It may be intellectually stimulating to code an app form a "purest perspective" but many of us have to earn a living and produce a lot of code in short order. C++ does not fit this bill. Most applications just have to work and work today, not next quarter. Then we have to extend the app after a few months. Since C++ is quite a bit harder to read and I have to learn code I did not write in short order to perform this maintenance, I enjoy Java and C# apps a lot more than ones coded in C++.
Please, tell me why Java and C# suck compared to C++ in the practical world. Nearly all of us are not writing low-level, time-critical code. Most of us write apps for business transactions. I happen to write business software that is widely distributed and the C++ performance boost is nullified by the latency of remote calls to distant servers.
Please, tell me the advantage of writing an app in a year vice 6 months.
There are many languages because there are many problem domains. C++ is not the best language. There is no best language, period.
Nearly all serious desktop software
Finally, it has been my observation most "serious" code is no longer constrained to the desktop.
-- Posted from my parent's basement
The problem with C++ is that this "purely structural thing" is so complex that no one person can hold it in their head. There are entirely too many surprises, bits of unnecessary complexity...
C has a performance-oriented level of interaction with the machine. It has some basic, primitive concepts, on top of which you can build an object-oriented program if you want, but you don't need C++ to do so. Just about any reason I can think of for using C++ is better served by some other language, and the performance/low-level considerations are best served by C, at least for now.
If you're working on a large enough program that you really need OOP baked into the language, there are other options than C++, most of them better. A favorite combination now seems to be a high-level, dynamic language like Ruby, Python, or Perl, with mechanisms to make it easy to extend in C.
Don't thank God, thank a doctor!
Surely, that title belongs to COBOL. Maybe Java wins in the the "Biggest, most successful, unreadable language" subcatagory. I'm not a COBOL programmer BTW. I'm not even sure that the term "Cobol Programmer" isn't an oxymoron as most of the "Cobol Programmers" I met back in the decades when it dominated the business world struck me as being somewhat on the not real swift side of confused.
I lack the patience to program in COBOL, but the couple of times I've needed to dig into a COBOL program to figure out what it was doing, I found it to be orders of magnitude more comprehensible than C, C++ or Java.
Seriously, I think the write-only nature of modern languages is a huge contributor to the dubious quality of software. Trying to scale programming languages that lead to baffling code at the toy/small program level to huge systems works about as well as one might expect -- Poorly. Frankly, I see virtually no progress on the big system side since the first non-assembler big systems I saw 40+ years ago written in Fortran and Jovial. In fact, some parts of OSS programs I've looked at written in C++ look to be a decided step backwards.
So I'm an old foggy who is stuck in the past? Perhaps. Probably even. But I do see significant progress in some areas. List programming is a step forward although I'm not that good at it. Same with Object Orientation. Perl is a vastly better tool for quick and dirty little programs than anything we had in the 1960s. Python is even better. I expect there are even better languages for many jobs.
But if you ask me, C sucks at least at many of the jobs it is being used for. Bad with object orientation pasted on is lipstick on a pig. It's still a pig and it's still bad. (I'd have thought that C might be OK for some simple embedded programming -- especially if the alternative is Intel's abominable assembly language. But embedded programmers have told me otherwise. Easier to code, but performance is deficient.)
I'll finish this rant with a quote from the Appendix B to the Unix Hater's Handbook (I use Slackware 12.0 BTW. It has it's moments, but for the most part I'm a Linux fan).
... we quickly added additional cryptic features and evolved into B, BCPL, and finally C. We stopped when we got a clean compile on the following syntax:
for(;P("\n"),R=;P("|"))for(e=C;e=P("_"+(*u++/ 8)%2))P("|"+(*u/4)%2);
To think that modern programmers would try to use a language that allowed such a statement was beyond our comprehension! We actually thought of selling this to the Soviets to set their computer science progress back 20 or more years. ... http://www.simson.net/ref/ugh.pdf
That's parody of course. But good parody is usually built on a kernel of truth.
You can't see ANYTHING from a car, You've got to get out of the goddamned contraption and walk...Edward Abbey
And this is what object pascal actually did right, it delivered the power of c++ without the weird syntax of c++, and all pascal code can be easily understood by anyone.
According to Wikipedia (well, the redirect for "the white book") it's a synonym for K&R. I didn't know what it was, despite owning it.
Chernobyl 'not a wildlife haven' - BBC News
The orientation is of little consequence. I will have to put it on my todo list, I see. Thanks!
Religion is regarded by the common people as true, by the wise as false, and by rulers as useful.
Really? I always thought the Laplace transform was invented by.. well.. Laplace? I'm pretty sure he was a mathematician, along with Euler, Fourier, and friends.
True. Some, however, are hideously worse than others.
Pointers are a powerful tool, in the very few cases where you actually need them. Otherwise, they're just a buffer overflow or segmentation fault waiting to happen. (And there are languages which can't have either.)
That is still useful, to some extent. However...
Really? In what way is that valuable? I can see how it would be interesting, but I can't imagine how it would make my programs better in any measurable way.
And slower to compile, for no good reason. And still might have some syntactical surprises. If you use 'C' constructs, why not just write C?
All programmers, good or not, do stupid things from time to time.
There was a study done once. I don't remember which languages were covered, but I do remember that some were very low-level, and some very high-level.
What they found is that the ratio of bugs to lines of code remained constant across all languages. Therefore, a higher-level language, which results in fewer lines of code to perform the same task, will likely result in a less buggy program -- not to mention a much more maintainable one.
Come back when you've done anything significant in LISP, or any language which supports closures.
Yes, especially in programming, it's better to focus on making things easier for an expert to use, rather than making the learning curve easier. Unfortunately, C++ is neither, and most experts will tell you to use a subset of the language. In today's world, the main place where C++ is invaluable is for code which must perform well, especially when you need enough of it that writing it all in assembly is out of the question. But as someone else posted, the proper subset of C++ to fill that role is C.
Don't thank God, thank a doctor!
Reading the threads, many people are discussing the relative merits of the other programming languages/environments - Java/C#/Python/etc - but what do all of those have that C++ does not have?
More complete environments.
When you install a C++ compiler, you get a C++ compiler and the standard library. When you install Java or C# or Python you get libraries to support simplified Networking, IO, Database access, GUIs, Memory Management, Threading and more.
Now it is possible to find all that for C++, but they are all separate components that the developer needs to decide on and download. And the number of choices for each is large. Do you use wxWidgets or FLTK or GTK+ for GUI, for example.
The other environments actually reduce your options, and for projects on a timeline the less time you spend on determining what you need to accomplish the task, the sooner you finish. Yes you can bring in replacement libraries in Java or Python or C#, but few people do. The folks that wrote those libraries did a pretty reasonable job on them, and since they are bundled with the standard installers, unless there are really specific needs, there's rarely a reason to replace them.
Look as an example of this at the Mono project. It is an attempt to provide the C#/.Net environment outside of Windows, but it does not have as much traction as .Net on Windows, why? in part because the .Net frameworks are more complete on Windows than in Mono. I not many .Net developers that use WindowsForms in every project. Without that piece of the eco-system already available, their project would take much longer. Mono basically provides C# for Linux, just another programming language.
I've watched over the years as some folks tried to assemble Java-like libraries for C++, but they didn't really take off.
This appears to me as why C++ has the reputation of being so hard to build applications in. The developer has to do so much extra work just to get to the point of assembling the program that the Java or Ruby or C# or Python crowd gets out of the box. Is this the fault of C++? Not the language, but perhaps it is something the steering committe should address. As someone pointed out in an earlier thread, the C++ standard group likes to make the comment that a particular given feature is not part of the language. Perhaps they should rethink that stand.
As point of background, I started working with C++ when it first appeared as a pre-processor that created C code that was compiled by a C compiler (when you had to use the keyword Overload). I later moved into Java and have made a good living doing Java development. Recently though I have gotten deep into programming in 3D graphics with OpenGL. I'm doing it both in Java (using jogl) and C++ (direct gl calls as well as engines). This is one area where there is not a clear choice for any platform, but because in the Java world I have the Networking and Threading, I was able to put a system together much quicker than I could in C++. Of course the Java approach has it's own problems because of the sheer volume of objects created/destroyed (imagine a 3D model made of Vector3D objects), so I end up using C++ approaches using float[] arrays (also an object, but only one).
Sorry for the ramble. Anyway, the point is, I personally think C++ would be more acceptable if it really was an eco-system and not just a programming language.
Most coding in the real world isn't writing performance critical distributed applications which are the cornerstone of multi-billion-dollar corporations. It's writing business apps and websites. For those, Java and C# shit all over C++, because they make not fucking up much, much easier.
Chernobyl 'not a wildlife haven' - BBC News
Ya, and I'm pretty sure it wasn't to solve engineering problems, but to analyze problems in probability theory that he wrote about. The use of using it, and it's closely related Fourier transform came only about in the 19th century for actual engineering problems.
Isn't the whole idea of a Computer Science education to learn the underlying concepts of programming, not just the syntax or semantics of a particular language? The programming language used is merely a vehicle for conveying those concepts. The professor who was "learning [J++] with you as we go" was referring to the specifics of the new programming language, not the concepts that he was going to teach in the course. Presumably (unless he was unfit for his position), he knew those concepts well and was able to convey them to the class using whatever syntax and semantics were thrown in front of him.
The quote I'll never forget came from one of my professors during an advising session: "I'll often get calls from IT managers asking if we have any graduating students who know COBOL. I always tell them that ANY of our graduates could know COBOL - and ask if they are hiring someone for their intellect and understanding of programming concepts, or for their knowledge of a particular language."
It should be the topic right after hello world. I once took a C++ class and it was a miserable experience for the other students who couldn't figure out how to get their programs right.
Any sufficiently unpopular but cohesive argument is indistinguishable from trolling.
Constant need to cast everything? It's been a couple of years since Java 1.5, came out with generics and autoboxing, you know. Unless you're perpetually instantiating objects using reflection, the need to cast is RARE.
Well, the GP's comment stated that the transforms themselves were devised by Engineers, which is not the case. The transforms were created by mathematicians, and applied by Engineers, and the theory as to why they work for those particular problems was later derived by science.
echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
.....that the C++ language needs to improve!
I've been programming since 1974 -- I started with a PDP 7 and an Altair 8800 and I'm currently writing code (C++, Java, Python) for Google. And I have a 4-digit slashdot ID, so get off my lawn! :-)
I guess I'm a pedantic fool, because it's obvious to me that C++ is a mess, and it's not the fault of programmers. It's not that it's impossible to write good C++. But compared to more modern languages it takes a lot more expertise, discipline, and especially time, so it's a lot more expensive than it should be. And, of course, there's always the temptation to cut the expense a little and then you have crappy code.
The problem is that C++ was initially a bit of a hack (remember cfront?) and then it was taken over by vast committees that used it as a vehicle to rationalize all their pet features. To see what can be done with a fresh start, take a look at the programming language D.
It's hemorrhage (US spelling) or haemorrhage (UK spelling) BTW.
echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
"Oh, I don't really do any coding at all"." That's not a big deal.
That is BS
It is ok for, I dunno, a discrete math prof., or maybe an algorythms professor not to code. It is NOT OK for a C++/JAVA/etc teacher NOT TO code.
It is ok if a cellular biology professor is not a practicing MD. It is NOT OK for a surgery professor to not know how to open people up and not to work with that (with the rare exception of 'I can't operate anymore with a bionic hand' kind of stuff).
how long until
I'm still astounded that a Computer Science curriculum includes any in-depth teaching of a programming language. Does the physics curriculum include courses on car repair? Does the biology curriculum include courses for the female students on how to land a good husband? Does the Literature curriculum include an in-depth study of calligraphy?
OK, I'm exaggerating a bit for effect, but seriously, most of computer science doesn't even require a computer, let alone an in-depth knowledge of any particular computer programming language. Some universities seem to have CS curriculum that would be more at home at DeVry's than at a university.
When you read Knuth, are you sitting in front of a computer? Gack, I bet that's what the kids nowadays do. The right way to read and study Knuth is sitting in a very fine leather chair, in front of a fireplace with fire, with a large dog sleeping at your feet, a drink in one hand, and classical music playing softly--and it should take along walk across a moor to reach the nearest computer.
And if you want to write a GUI in C++ wxWidgets is my toolkit of choice.
There are others but this is one of the best, and has the best license by far.
We are Turing O-Machines. The Oracle is out there.
Lack of planning on your part does not constitute an emergency on mine.
"they decided to blindside everyone by teaching Visual J++ instead--Microsoft having "generously" donated the college discs containing the software"
That seems to be their style, alright. When I was at Waterloo, the first programming course I ever took was in C++. That's the way they'd been doing it for a generation, and it was working quite well. Then along came Microsoft, carrying two big bags with dollar signs on them, and all of a sudden C++ wasn't good enough, the future was C#. I'm glad I squeaked through when I did.
Computer Science is more than just applied maths. It's applied maths and how it relates to systems design and programming.
As the OP noted, a lot of CS academics have little programming experience, and this has some rather disturbing consequences. A lot of CS research is unrelated to real-world problems, since the researchers have not had the occasion to develop intuitions that would allow them to feel what is relevant. A lot of CS teaching is cold and abstract, and fails to interest the students, because the lecturers do not have enough programming culture to make their lectures live.
The best CS academics are people who manage to combine a solid theoretical background with a moderate amount of practical experience.
True, but I'm still used to Java 1.4 collections (and some enterprise environments still require 1.4), and a lot of frameworks pass superclasses around when I know I'm receiving a more specific class.
Besides, this is rumoured to be one of the big reasons why dynamic languages are doing so well lately. Bruce Tate wrote some enlightening stuff about this.
I wish D becomes more popular. It allows the low level efficient coding without the craps of C++. it also borrow and improve many ideas found in java/C# such as javadoc-style documentation.
This is supposed to be funny, right? Java and C++ are vastly different languages. Java was designed to use a similar syntax to C++ and to (kind of) work when treated as a restricted subset of C++, but that was just for the sake of tricking extremely lazy and conservative corporate programmers into giving it a fair chance. Java programmers don't have to know about header files, macros, operators, the distinction between stack and heap objects, destructors, RAII, and techniques for managing heap objects in the absence of garbage collection. C++ programmers don't have to know about classloaders, type erasure, garbage collection, or introspection. The design skills for the two languages are also completely different, since they have different shortcomings.
On the contrary, they are very different approaches, each with advantages.
Java has two primary advantages: safety and simplicity. C++ has one big advantage: it's a much more flexible language that allows students to explore a much broader subset of computer science concepts.
Students can get up to speed pretty fast in Java. Java has a lot of features that only make sense in the context of industrial-scale programming, but students will learn not to ask why. If they get past that part, it doesn't take long to learn a useful subset of Java. A bright student can conceivably become a language expert in less than a year. Plus, programming in Java is extremely convenient. The debuggers are rich, the errors are informative, and the stack traces come in very handy. That means students can devote more of their brainpower to learning CS instead of struggling with the language. The downside is that Java can only express the very narrow range of concepts that were deemed necessary for mediocre programmers writing industrial-scale software. Java is intentionally restricted in its power and in its style, and those restrictions will be imprinted on the brains of students who are taught mostly in Java.
In C++, you have to deal with memory leaks, corrupted memory, unexplained segfaults, and other issues that sidetrack students for hours and days while they're supposed to be learning basic CS concepts. It's a bit of a lie to teach first-year students in C++ and pretend to be teaching them computer science. Mostly they're learning how to debug C++ programs. On the upside, you can go much farther in C++ than you can in Java. C++ was designed to empower programmers to express as many different ideas and styles of programming as possible while preserving C interoperability and the performance characteristics of C. C++ was designed on the assumption that even though it isn't safe to trust the judgment of the individual programmer, there is no better alternative. Java was designed around the opposite assumption: don't trust the taste of the programmer; shoehorn him into a single, neutered programming paradigm in which he can't do much harm. The design of Java ensures that powerful concepts cannot be expressed in Java by individual programmers but must be layered on top by framework designers.
C++ : Java :: English : a 1000-word subset of Esperanto
It's easy to fool yourself into thinking that students will learn more if they don't have to go through the excruciating process of learning a complex, crufty, logically flawed real-world language that evolved to accommodate the impulses of its users. It's wrong; it's an illusion. An artificially restricted language circumscribes your thinking. I've heard the complaint that teaching students in C++ gives an unfair advantage to those who had an earlier start in the languag
On an already ugly programming language, or at least one which is at best obsolescent from a technology perspective.
Having 25+ years of experience in the field my opinion is C++ is aweful. No amount of hacking around the edges of it is ever going to fix that. Due to the very nature of the language defect rates are exceedingly high. Even with modern development, test, and debugging tools building software in C++ is an endeavor which requires an inordinate amount of expertise, mostly in how to avoid doing most of the things the language allows you to do because 99% of them are bad ideas. Instead of learning to program well, most instruction in C++ has to be focused on how to work around its hodgepodge of misfeatures. Personally I wouldn't even consider allowing anyone with less than 5+ years of experience touch a commercial C++ application.
The whole stankin' mess should be retired. The sooner the better.
"Malo periculosam, libertatem quam quietam servitutem." -- Jefferson
The fact that it's possible to write overly complicated code in C++ does not make C++ overly complicated. I could write incomprehensible spaghetti in (insert your language of choice) too, but unless that language is INTERCAL then it's highly unlikely that that would be the language's fault.
Python (intro to prog)
No. Start with a functional language, mostly because it "looks like" math, which is something that students already know. Scheme, Lisp, whatever.
"You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
Not sure what you mean with application level, but I'm going to disagree anyway.
I've been a professional Java programmer for 2 years now, and the more I use it, the less I like it. Java behaves like an advanced scripting language, and it's great as long as the programming tasks stay reasonably simple. But beyond some hard-to-define point, where I'm right now, Java just doesn't cut it. Too many pitfalls, too many workarounds.
Adventure, Romance, MAD SCIENCE!
One thing to consider is that some languages are better suited to supporting good libraries than others. Early binding and the way templates are implemented makes C++ hard to design reusable versionable libraries for. Explicit message passing and late binding in scripting languages and in languages like Objective C make it easier to build and support good libraries.
Another is that once most of your program is written in canned libraries and components, the remaining glue doesn't really need the performance of compiled code and early binding.
So people are simply more likely to create good libraries in languages where you need them, and in languages where they flow naturally from the language design. In C++ you have to wait for standards committees.
Where are they teaching it actively again? I'm a student on computer science at the moment and all they teach in any depth is Java. The only reason I know c++ is my desire to learn it, despite the fact that various parts of my course have recently required a fairly in depth knowledge of c++.
As background, I have worked with Java, C, and C++. I've also dealt with functional languages (Lisp, Haskell), scripting languages (perl, php, python), and a bunch of other stuff. In all my experiences, my response to C++ is pfft, I can live without it. If I want to get into the guts of the operating system, muck with the kernel, or do something nasty by hand in memory, I'll use C, if I want to write an application I'll use Java. C++ is a terrible language for application development, it combines all the worst aspects of OOP with all the worst aspects of C style memory handling, but brings no advantage to the table!
I'm tired of all this chest beating of wanabe's complaining oh they teach me java, but I am such an uber geek I want to learn C++! Computer Science education doesn't teach you to program in JAVA, it teaches you computer science, in the course of that you learn to program, not to program in X, but to program. Any computer scientist worth their salt can program just as easily in one language as another, and can pick up any other language just as easily.
The only big mental shifts come between procedural languages vs oop languages vs functional languages, etc. Everything else is syntactic sugar. Choose the language which best fits the problem at hand.
I like your attitude towards reading Knuth. I would like to discuss the nature of the drink though. Could I have a cat instead of the dog? The moor you can get away with even though I almost had to accuse you of racism. Walking across the moor and back could help solve some of those exercises too, even without access to a computer, maybe the dog would be a better companion there. You could even talk to it and you might get more attention too.
This seems to be a somehow Victorian attitude to computing - some things are just timeless.
Je me souviens.
clisp. We only used it for about 1/2 a semester to get a small flavor of it. Therefore I doubt we hit many nuances of the difference between it and scheme. I could be wrong, I don't claim any mastery over it.
Lack of planning on your part does not constitute an emergency on mine.
I'm still astounded that a Computer Science curriculum includes any in-depth teaching of a programming language. Does the physics curriculum include courses on car repair?
No, but it better have hours and hours teaching how to use the lab facilities. Yes, Computers are to Computer Science what Telescopes are to Astrophysics, but except for most hardcore Astrophysics, the guys better know very well how to use their telescopes.It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
And C++ & Lisp are my two favorite languages.
We are Turing O-Machines. The Oracle is out there.
I've been programming since 1974 -- I started with a PDP 7 and an Altair 8800 and I'm currently writing code (C++, Java, Python) for Google. And I have a 4-digit slashdot ID, so get off my lawn! :-)
It's good to see that dinosaurs still roam.
I guess I'm a pedantic fool, because it's obvious to me that C++ is a mess
I never said it wasn't. It is far from perfect, of course.
It's not that it's impossible to write good C++. But compared to more modern languages it takes a lot more expertise, discipline, and especially time, so it's a lot more expensive than it should be. And, of course, there's always the temptation to cut the expense a little and then you have crappy code.
I have a very different perspective. A "good" programmer/developer will naturally want a more powerful language.
The problem is that C++ was initially a bit of a hack (remember cfront?) and then it was taken over by vast committees that used it as a vehicle to rationalize all their pet features. To see what can be done with a fresh start, take a look at the programming language D.
It is always tempting to let the problems on which you focus to distract you from the advantages you have, i.e. the grass is always greener on the other side of the fence.
rant: yep. in my university only the self tought programmers get further. the teachers (in my uni of course) nowadays just give an overview of topic X, without going into any detail (most the stuff you can read from wikipedia what they teach). for example: nobody in my class knew what a function pointer in C is, all they got was primitive assignements. to get into real programming, you teach it yourself and look elsewhere (think challenging programming assignments, like SICP thought at MiT).
Real science involves performing experiments to prove theories. I say this as someone who studied Astrophysics and had a disparaging attitude towards experiments at the time.
For those of you lucky enough, and arrogant enough, to have IQs above 200, then by all means just read the books and be content in your heavenly crystal palaces.
The rest of the human race will carry on making progress.
Stick Men
C++ is based on a concept known as Object Oriented Programming
That's actually a myth.
Or, as Alan Kay, the guy who invented object oriented programming, said: "When I invented OOP, I did not have C++ in mind."
(He was trying to be diplomatic.)
Hello Mr. n00b, you can fulfill agile requirements in any programming language. And, no, "shipping code in a hurry", as you put it, is not agile, absolutely not. It's more the Dilbert version of agile development.
A monkey is doing the real work for me.
I've spent a lot of time now with C++ and Python and been doing a lot of Java at uni lately as well as some ASM.
Java and Python are great for creating business apps where development needs to be rapid, results need to be decently polished and apps are simple enough not to require the full speed of compiled code. They're also great for teaching to non computer science majors who know their subject material really well and need to be able to get a computer to do their grunt work for them.
However, I really love computer science. ASM and C++ both let me code in a way that makes me feel like I'm actually interacting with a computer. Not like I'm scripting some abstract logic to be interpreted to the system for me by a program written by someone who actually interacted with the computer on my behalf.
Why C++ over ASM then? LOL, I still want to have a life outside code. ASM just takes too long to use for most app development.
Censorship is the opposite of education. If neo-darwinism were defensible, people would not need to try and censor ID.
Fanshawe College of Applied Arts and Technology, Computer Programmer Analyst 3 year course. At least when I was there 4 years ago they were teaching it. After that I went to university for software engineering and they don't teach you much about programming at all. It's all about how to design a software system and has practically nothing to do with programming. Most of the programming you have to learn on your own. There are many students in my 4th year ready to graduate who are completely terrible programmers. They did teach us 1 basic C course and Java course but it's not much in 4 years worth of university.
My last project for the FX desk (front office trading application) at a top American InvBank, was written by me in under 6 months using C#. It executes easy $500m+ a day in business across multiple exchanges. It integrates with custom keyboards (USB HID), contains plenty custom controls, is built using a pluginable/configurable architecture, deployed across the world, etc etc blah blah.. It was an absolute pleasure to write, it is extremely stable, and the development tools are excellent. I came from a long embedded C/C++/MFC background, and I would never turn back. I have a job to do, traders to keep happy and I consider C++ GUI dev to be completely outclassed by C# (I've even written non-trivial server side C# windows services which are currently performing perfectly).
In my experience there's no language that's more suitable for gigantic software projects with millions of dependencies than Java. Admittedly I don't have much experience with Python and Ruby yet, and while I see those two as advanced scripting languages, other people keep using them to build large software projects in less time than it takes in Java. But compared to C++, maintaining very large projects is much easier in Java.
If you can try to define your point, pitfalls and workarounds, perhaps someone here can give you some advice. On the other hand, all large, complex projects have their pittfalls and occasionally require workarounds. It simply comes with the software engineering territory.
Thick Client: C++ Enterprise Web Server-side: Java Web Client: xHTML/JavaScript/CSS/xForms Non-Enterprise Web Server-side: PHP/Ruby
Horns are really just a broken halo.
wxWidgets uses C macros to do function binding to controls, QT has a metacompiler extension to do the same and windows forms are restricted to one platform so I don't plan to use them. Mac counts.
QT is more mature and more commercial but doesn't use native controls in any platform. wxWidgets uses native controls but has ugly database classes.
For pure GUI related stuff wxWidgets has superb sizers that adjusts every control to your window/panel/container, while the others are more drag&drop oriented just like VisualBasic.
We are Turing O-Machines. The Oracle is out there.
Comment removed based on user account deletion
I teach freshmen an introductory class using a functional language (Objective Caml), but I do not think that the fact that it looks like math is of any help: they do not know anything worth in maths:-(
Why the hell should they? Is knowing the title of a C book that's out of date (OK, the second edition is better, but K&R usually refers to the original edition) important?
Perhaps you don't understand what CS is. CS isn't about C - in fact, it's not even about programming at all. CS is about the theory of computation. Things like programming language theory and computational complexity theory are subsets of CS.
CS doesn't include coding practices, use of source control, project/time management, or software testing. All of that is part of software engineering.
The problem is that people expect CS programs to produce functional software engineers. And while functional software engineers certainly need a strong grasp of theoretical concepts (such as a basic computational complexity theory and common algorithms), what they really need is software and systems engineering experience.
Yes, you can be as agile as in "any" programming language in C++ - after you have the whole dev team locked in a chamber for half a year and let them fight out the coding conventions and the language subset and standard libs to use and have written extentions to your CVS to enforce the decisions (because nobody will always remember everything from the 300 page book that was agreed on). But, well, that kinda defeats the purpose.
there are plenty of other compiled langauges that can produce fast code, some even faster than C or that bloated bolt-on crap to it Bjarne Stroustrup continues to shit out. He's an impediment to progress and should go the way of the dodo
I would agree with you, but the advertising for a CS degree is about becoming a programmer, not a researcher.
While its obviously important to develop people who are well versed in the mathematical and architectural aspects of programming, its rather useless to send them out in the world without at least a fair amount of experience in languages they're likely to end up using. Esoteric cs education burns a lot of kids who got into it in the first place thinking it was a path to being a code monkey.
It seems like a pretty big deal to me if a CS prof doesn't code - how can he or she possibly gauge the real world value or applicability of the knowledge s/he's teaching? I did a lot of music study earlier in my life, and while I don't expect music profs to know how to play any instrument, none would be a red flag. A lot of those profs never touched on anything regarding how to play a particular instrument - it'd be mostly theory and coaching. But if a music prof can't actually be bothered to be interested enough to actually play an instrument, they're unemployed. I understand the value of the science aspect of computer science, but it does bother me that people work in the field yet do not write software themselves.
"Old man yells at systemd"
Philosophically, C++ leans towards TMTOWTDI, which explains its unpopularity with the TOORWTDI crowd.
Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
Lack of planning on your part does not constitute an emergency on mine.
But he never actually mentioned what his lecturer was actually teaching. I would say that if you were in a Theory of Computation course then it wouldn't be such a surprise if the teacher doesn't actively do a lot of coding.
Agreed! C, C++ and similar languages promote brain lock! programmers spend too much time debugging the language and not enough time designing or engineering the application. Take a look at most OSS code and you can see this. Horrible.
Same here, since -67. Actually I think no language is really "bad" but how and where they are used is totally gone weird! C, not C++ or C#, is simple but only if you know what you are doing. Same could be said of many languages but the scope of knowledge is different. Take Simula, the first object language, very easy to write if you know what you want - C++ doesn't get even near to that (it isn't even an object oriented language in pure sense), you depend of language syntax instead trying to address the problem to solve. And I'm not a Cobol programmer but to solve a business problem where the calculations have to be correct, different from scientific problems, I would say Cobol is your language. And it is not wordy (where that came?) - with good copy libraries (not mixed with object libraries!) it comes very clean and short to write (and read.) Funny you mention list languages - for example LISP can be very powerful, one of the few languages which can bootstrap itself and endlessly expandable. In right hands it really is one of the most powerful of languages - just takes a little to get to the mindset, as do APL, Prolog, Erlang, etc. Now, showing my age, IBM BAL (basic assembly language) is still my favorite - all the benefits, easy to write, you are in control what and how, very clean and short (if you know what you are doing), commenting is easy, as efficient as any language can get, can interface any other languages and libraries, native threading (tasking) since when, and so on. I wouldn't use it for scientific or for some business tasks but when you need control and performance. Fortran - another undervalued language (as PL/I but let's forget it) - if you need scientific calculations based on tested and proven routines, then it is your language. There has been a long time conversions to C++ for libraries but the amount of code (with weird syntax, nothing to do with calculation itself) will be many times what is needed writing the same code in Fortran - weird again. And it is very easy to read and comment. All these languages have compilers to almost any platform so porting is easy, they report the accurate warning/error positions and don't give up in first error (my gripe with C - the real problem may be 1000 lines back in some include file defined third time over but try to find it sometimes!)
Yes, I agree with many of the comments, it is important today to know C++, Java, C#, scripting languages (REXX is my favorite - Python is great, AWK has it's place, Tk/Tcl, PERL, PHP, JavaScript, VBS, etc each have their use) but this only because the business selects languages by whoever screams loudest, not what is most suitable for the problem in hand.
Maybe the focus is too much on languages instead of the solutions? Languages are (relatively) easy. If they are used in business I would assume that company has a CM/SC and well tested libraries in place already so any standard and routine will work independent of the language or platform. In new development I would recommend starting from that, build standard, language independent, well tested code and object libraries first. That is the way what I have seen business working a long, long time - maybe that's why Cobol doesn't go away, it just works on whatever you throw against it, no new, fancy coding needed - maybe call your new XML parser instead of your old parser or change the runtime library reference but that's just one liner. And move it from 32 to 64 bit or from Intel to IBM G6 just by compiling and it still works. Try that in C++ especially with floating point (not defined yet) or endian changes or xxP64 standards or whatever - good luck!
C. C++ is just awful. Stroustrup is whining. This could never be his fault; of course not. C++ must be perfect, just look at what he has said about it! It must be wonderful. If most C++ code is unreadable, happens-to-work-once swill, it must be the fault of the teachers. Even the examples in his own books can't give a convincing reason to use it. Line up the "white book" on C, with any of the blue or grey books on C++. Its not just because K&R were great writers (they were); it is because they were great language designers.
:)
Of course, these are all implementation faults. The pure language, like any pure 'ism', is perfect, it just happens to be useless...
C++ isn't portable; not just across architectures or OSes, subsequent revisions of compilers typically involve a 'port' of your code to the latest redefinition. Binary compatibility is non-existant (unless you spec all your interfaces as extern "C"
C++ stinks for systems level programming. Trust me; done lots. The quickest solution when faced with C++ low level software is to quickly re-write it in C. Nice thing is, it usually ends up more concise, more reliable, and more maintainable.
C++ may be ok for application programming that don't require portability. Not really sure of the point.
C++ stinks for libraries - again, poor version control, dubious infrastructure, poorly specified system environment.
Absolutely correct - ((C++ says)) I don't leak, you leak! If the programmer can't keep track of the memory, it is time to get more experience (or forget the programming!) No programming language with GC can fix what you don't know or understand. Sorry - just fixed a horrible C# system slowly running out of the memory and not even talking how the "perfect" thread pools were used!
The problem with the C code is obvious, and easily caught by code review. C++, on the other hand has hidden the bug so well, only those with an intimate understanding of the class interfaces have a hope of catching it. Code is meant for reading; for everything else there is APL.
Wrong, and wrong.
Java was designed to support the execution of code from an untrusted source, such as from over a network. That was the main design criterion, and it permeates the language.
It was not written to replace C++ in the places where C++ works, and it's actually a very poor substitute. But then, C++ is also a poor substitute for Java.
sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
This is what interfaces and overrideable stubs in the base class are for.
"We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
If I had meant the people, not the habitat type, I would have said moop, not moor.
As said, readily solved with Java 1.5, unless you are casting between basic types. And within the Eclipse IDE (e.g.) you can use quick fix if you have a casting problem. Having weak typing is a much bigger problem, IMO.
Mod the parent Funny, Seinfeld fans!
Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
ROTFL. I've been coding for 34 years (actually, I can make arguments back to 1971 or even back to 1969, but I'll go for consecutive years). Do you know how often I have heard the "programming is dead/program generators will do it all" mantra? (Here's on clue, an article from 27 years ago about "The Last One", as in "the last program that anyone will ever need to write".) This is a canard that gets dragged out every decade or so, and then is quietly put away again.
As for evolutionary computation -- for which I actually hold out great long-term hopes -- let me know when you can 'evolve', say, a word processor or a mission-critical corporate business application.
And since COBOL and Fortran still aren't 'obsolete' and still run a sizable percentage of the world's applications, I'm not sure how soon C and C++ will become 'obsolete'.
Bruce F. Webster (brucefwebster.com)
One major benefit that most functional languages provide is automatic parallelization. C++ can't support that, even if you are programming in a functional style, unless you use a framework like OpenMP.
What is a "red Ford car steering wheel quick left turn" and what was the last time you used one?
The Tao of math: The numbers you can count are not the real numbers.
Yes, the grass is always greener. The pony express was good enough, but then they invented the telegraph, then they insisted we needed telephones, and then email, and now the web and IM. Think how great the pony express would be if we had just concentrated on perfecting it instead of getting all distracted by new-fangled innovations?
On the contrary! If you are quite knowledgeable in C++, it will only take you a few years to learn C++.
Yes, the grass is always greener. The pony express was good enough, but then they invented the telegraph, then they insisted we needed telephones, and then email, and now the web and IM. Think how great the pony express would be if we had just concentrated on perfecting it instead of getting all distracted by new-fangled innovations?
It is an absurd strawman argument. *All* progress is not good and *all* progress is not bad. The merits of "good" vs "bad" progress is based on fact and reason. The mere fact that you try to invoke this sort of nonsensical argument means you have no real factual argument to support your opinion.
Is HDMI better than DVI? Of course not, it only serves *AA interests. Is margarine better than butter? No. Is Monosodium glutimate better than salt? I's hydrogenated oil better than natural oil? Is ".NET" better than "java?" many of these "progress" issues are never really or clearly obvious and are often much more complex.
When you can articulate an opinion that means something, come back and post again little boy.
Yes, clearly that was the problem—you failed to articulate bad ideas sufficiently. Not that they were overarticulated and everyone has 50 different ways to do the same thing.
I'm a Java programmer myself, after struggling with idiocies of C and C++ for a long time (#include, anyone? care to chase down this header for me?). Java has shown when you start with better principles, you get a better language...and then eventually foul that up, too.
It boggles me that there are still people trying to breathe life into C++. If you are a university student at this very moment, do yourself a favor: realize that if you learn C++, and decide to base a career on knowing it, you will be doing legacy programming until you lose your job and there is no other. Legacy programming means that you will be mostly working on maintaining and occasionally extending bad ideas poorly written. This has only marginally to do with the language itself, but there it is. If you decide Java is your thing, then after you've worked about another 5 years, you'll find yourself in the same state, because I give Java until about 2013 the way things are going. Then again, maybe we'll move at "Internet speed" and it'll only be 2010 until people are wondering if Java's worth anything any more.
(The harbinger of evil on Java was marked by the introduction of varargs in Java 5, if you're wondering. I can think of no better way to say, Hey, let's do something pointless that will make it tough to resolve which method is getting called! And slow too, can we make it slow? Oh and also we should say we're doing this so you only have to write one method instead of a bunch, but actually you should have to write a bunch of methods when you only wanted to write one!...just check out that ugly-ass of() method. Of course, now I think about it we did really need it...after all there's no other way that already existed to accomplish the same thing -ahemcoughcougharraycoughcollectionscough-. I'm sure there are lots of good reasons that are sound design for a developer to shroud a method prototype in a could of mystery.)
So if you're a uni student, learn Java, b/c god knows you'll need it for that first job out of college. But do yourself a big favor and start preparing for the inevitable gigacore processors that will be all the rage by 2015...learn Haskell and LISP. Go write something that runs on a Beowulf cluster (yea, I said it). Figure out how to make an AJAX call to a Java servlet that farms out jobs to an Erlang ring. You'll be glad you did.
but have you considered the following argument: shut up.
We needed to know how macros in the assembler worked.
Really? In what way is that valuable? I can see how it would be interesting, but I can't imagine how it would make my programs better in any measurable way.
Well, in those days, with absurdly small limits on program size, you absolutely needed to know how many bytes your function would take. It sometimes meant being more than the 2K eprom. That requirement of knowledge make for better engineers, IMHO.
C++ has its flaws, absolutely. However, if you use "C" constructs, it is as efficient and as readable as C.
And slower to compile, for no good reason. And still might have some syntactical surprises. If you use 'C' constructs, why not just write C?
Well, C++ has some programming advantages that C does not have. Better type semantics and checking, default parameter values, etc. If it is as efficient and is as predictable in implementation as C, but has additional features that help you write code, why not use it? The C++ compiler can actually make "C" type programming safer with no cost.
Unfortunately, C++ is neither, and most experts will tell you to use a subset of the language. In today's world, the main place where C++ is invaluable is for code which must perform well, especially when you need enough of it that writing it all in assembly is out of the question. But as someone else posted, the proper subset of C++ to fill that role is C.
"C" isn't a proper subset of C++. The "class" construct makes all the difference. Using classes to represent logical hierarchies is very important to good software design.
Having been around for some years on this technocratic Earth, and having experience programming in pretty much all the standard (and some exotic) languages, I can say this: no matter which programming language a person might use, that programming language ultimately executes in machine code. Having said that, the most efficient way of writing code is in assembly.
What drives the wedge between pragmatists and idealists is development time. I could probably optimize my projects at work by dumping PHP and writing CGI programs in assembly - but - at what cost? Rather than spend $10k on development time, it's a better utilization of resources to lease a dual Xeon server for an entire year to meet performance requirements of the system. Not efficient on code level, but absolutely makes sense on a business level. Similarly, I could have employed C for previous data acquisition projects but LabView and G code allowed the project to be completed in two weeks instead of two months. During that time difference, numerous graduate students managed to put the system to good work. Time does matter.
Even assembly is not straight forward. You must be aware of all opcodes for your code to be efficient, and that means knowing which hardware you're developing a program for. Who has that amount of time to learn engineering specs of processors? Even C and C++ compilers aren't entirely efficient when it comes to generating programs. For amusement, see this classic piece:
http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
This guy spends hours optimizing a program so to reduce its executable size from 3998 bytes to 45 bytes. In this process, it's not just the storage size of the program but also the number of instructions the program goes through. A great achievement in its own right, but, not worth the trouble for larger programs. After all, isn't point of programs to basically do a job? In other words, it's more efficient to write the program once (even if it's inefficient) and leave it be -- rather than rewrite it continuously until it's absurdly efficient.
There is a reason why R.A.D. has been given an acronym and everything. I'm afraid that in this hodge-podge of processors, operating systems, hardware, etc, the wisest course of action is to shoot for completing a task if the outcome is correct. It's ridiculous to expect today's programmers to stick to a single language and learn it intimately: that's just not how things work in the real world.
Now, I'm not endorsing Vista's inefficiencies or anything - just talking about day-to-day programming.
You are conflating computer science and computer engineering, just like almost everyone. A "C++ teacher" is not teaching computer science, but computer engineering, whereas an algorithms professor is teacher computer science, but not computer engineering.
Any class that requires the instructor to know actual coding is, on its face, a computer engineering class (though it may also be a computer science one.) Ugh.
In the hard sciences, labs and lectures are often separate classes with different instructors and grades. I think computer science departments need to create the same separation.
In that case, why are you studying CS? It's like studying physics and complaining that you won't need all that quantum mechanics at the engineering job you plan to get. The answer of course is, if you are just interested in engineering, you should study engineering instead.
The Tao of math: The numbers you can count are not the real numbers.
As a C++ programmer, aircraft enthusiast and a resident of a country set to buy the Joint Strike Fighter (JSF) I clicked on Stroustrup's link to his 'JSF++: Joint Strike Fighter Air Vehicle Coding Standards PDF' http://www.research.att.com/~bs/JSF-AV-rules.pdf but it was completely broken.
Given the JSF has gone through all sorts of delays and stuffups, it just seemed so poignantly ironic.
You make a really good point here, and the it's odd how many people get computer programming confused with computer science. I own a company that develops software for fairly mission-critical systems, and the last people I need to hire are scientists; I'm not in the business of solving confounding scientific problems, I'm just in the business of building reliable software for my clients. It's even weirder that they actually use the word "science" in the degree - how many freaking CS graduates would most of you consider to be real scientists? I've met about a thousand or more CS people over the course of the years, and the only time I ever met any that were actual scientists was when I visited a research institute to talk with some guys about licensing a technology they were developing...
Anyway, to the previous poster's point - I would be more in favor of some universities dropping their CS program entirely and replacing it with one focused on pure software development. This isn't to say that CS should go away, but I think that universities should make a stronger distinction between the scientific and vocational aspects of the field - have a software development degree and have a computer science degree. Leave the contemporary programming languages out of the CS degree, and leave the intense math, etc. out of the software development side of the house. I can't imagine how excited I would be about being able to hire candidates with a four-year degree in "Commercial Software Development" rather than having to look at the same old crap resumes from CS graduates - "I took a lot of advanced math classes, and wrote a logging program in C." Sigh...
Anyway, the whole point of technology is to make things easier for us, not harder. The "real" computer scientists have done great things and made life very easy for people like me (who just like to build applications software), so why don't we show them the respect that they deserve and stop using CS as a catch-all for anything related to computer software?!?
>I'm a student on computer science at the moment and all they teach in any depth is Java.
//signature
My school does the same thing, and I recommend that. Java is a relatively simple language, good for explaining fundamental data structures and algorithms issues in. When you move into upper division courses you will probably end up doing a lot of C and C++. After all, there's no way to teach an operating systems course in Java, and graphics courses and graphics industry jobs are C++ oriented.
That said, I think the problem you see in school's is that students learn Java, Scheme, or Python or some such relatively simple language as an introductory measure, and then when they get into upper division courses they are thrown head first into C and C++ without a lot of prep, and I think that is the problem that Stroustrup runs into a lot.
Both C and C++ require a lot of idioms related to memory management and the nature of how C++ compiles things, that don't exist in other programming language. Even something as trivial as returning large objects from a function, which you do like this in Java
String method(String input);
String myString = obj.method("asdf");
Doesn't work the same in C++! In C++ there are no fewer than 3 ways to return an object from a function.
By value (a bad idea for potentially large objects like strings):
std::string my_string = func("asdf");
By pointer (potentially a bad idea because it requires you to answer the question, who is responsible for deallocating this pointer?):
std::string* my_string_ptr = func("asdf");
And, what is usually the correct answer (is efficient and has the least headaches associated with it), by output parameters:
std::string my_input_str;
std::string my_ouput_str;
func(my_input_str, &my_output_str);
Output parameters are technically possible in java, but not used nearly as often. However, in C++ they are probably the most common idiom, depending on the quality of the code base.
Issues like this are difficult to teach because they require a level of concern over areas like efficiency and code readability that may be common in industry, but which academics concerned with research rarely have cause to exercise. They also require in dept knowledge of the language in way that is rarely necessary in Java.
I learned some of the most important concepts in a class that was all done in pseudocode...You are destined to be a code monkey.
which is preferable to being a pseudocode monkey like you.
rd
I'll bet just about every CS major can do one of those things... just not all three. And I'd add "understand algorithmic complexity" to the list, and suggest that the best you could hope for from all but the most exceptional students is two out of four.
"[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz
This practice was created to deal with the lack of return type covariance prior to Java 1.5. Before Java 1.5, a method returning ISelection could not be overridden by a method returning IStructuredSelection, even though IStructuredSelection is a subtype of ISelection. Many valuable libraries and frameworks date back to before the fix. and there are probably still lots of Java coders who keep coding the old way out of ignorance. Therefore, rampant casting will be a fact of life in Java for years to come.
I used to share that opinion, but now that even Java fans like Bruce Tate are cheering the advantages of dynamic typing, I'm not so sure anymore. I'm not about to give up Java yet, but it won't hurt to keep eyes and mind open.
Most C++ work on embedded systems uses a subset. There are some attempts to formalize this: Embedded C++.
so. This is how MS does it. :-)
You misread my post. I said that for desktop applications Java and C# suck rocks. Name me one popular retail desktop application written in Java, that isn't actually related to Java programming in some way. I can't think of any. I quite agree that Java and C# are excellent languages, the right tool for certain domains. But trying to write any serious desktop app in Java is an exercise in pain. The IBM guys managed it with Eclipse, but only by writing a replacement for the entire Java widget toolkit - and it still has "issues" with memory management.
My CS teacher used to say "If the future of AI is going to be on the Internet, not in robots, then the future language of AI is going to be the one that can open and parse a URL most easily."
There are many possible choices for that language. C++ is not one of them.
Similarly, the future of solving business problems for most people is taking a small set of data from a big honking set of data, doing some business logic on it of trivial complexity relative to one's computational capacity, and displaying it in a comprehensible form to the user. There are probably languages less suited to this task than C++, but I'd have difficulty coming up with one off the top of my head.
I want to see someone do the Ruby on Rails "15 minutes to a weblog" demonstration in C++. Take however much time you need. Use whatever framework floats your boat. And take a screen recording while doing itShow us how easy it is to create a fairly typical, conceptually trivial application in your favorite tool.
My guess if I tried it? Somewhere around the 4 hour mark after hitting ANOTHER seg fault I'd commit suicide. Or start reimplimenting it in Perl. Which is really just more violent suicide -- there is more than one way to do yourself in!
Help poke pirates in the eyepatch, arr.
- and all that. I remember the GIER machine he talks about; those were the days.
One of the things that strike me is the colossal difference between Stroustrup's vision of C++ and the way it has been put to use; which I suppose is the point he makes in the interview. Having seen abominations like MFC - which isn't atypical of how C++ has been used - you realise that people just use it like any other programming language, making things up as they go along. Stroustrup's assumption, however, was that you work out all your theoretical concepts and models before you start coding anything - in which case C++ has all the features you need.
The problem is, of course, that very few businesses have the patience or indeed the skills required to work out a good, theoretical model for their products; I certainly haven't been in one in my nearly 30 years in computing.
The difference between C++ and most OOP languages is that C++ is basically a procedural programming language which has support for classes and objects integrated into it.
Alan Kay didn't criticize C++ for being multi-paradigm or for being low-level. Alan Kay criticized C++ because C++ classes and the C++ type system are so mind-numbingly limited and poorly designed. No duck typing. No "become". No reflection. No meta-programming. Instead, you get a tar pit of source code dependency management, potential memory management errors, and other traps.
Can we please learn from this?
Well, you certainly could stand to learn a lot, but I suspect that you won't bother.
The problem I see with C++ is this. I know it has been recounted over and over again above, but allow me to distill it to what I think is the crux of it: if I wanted to make a C compiler (which I don't) then I would know how to make one. Same goes for java, LISP, or even BASIC. I know C quite well, and java too, but I know only what needs to be known about the other two (that is, I've written some stuff in it). My point is that the languages are simple; the 'old testament' is about two hundred pages thick using a large font and a lot of whitespace. These languages, irrespective of how well you know them or how long ago you used them, fit in your head. Granted, there would be a few lookups here and there, but all in all, given a few days of extra time, access to a web-browser, lex and yacc (or the natural language-specific variety thereof), you could build a compiler or interpreter for them. And not only do they 'fit in your head', they also have an aura around them, a 'homely feeling', or a 'scent' of sorts. You'd know what extensions to the language would be natural for it and which wouldn't be.
Not so for C++. I know some of it; I know almost all of C, but the mind just boggles trying to fit all of that behemoth into one coherent picture. It just can't be done. Not only that, but I can't even begin to define what belongs to the 'scent' of C++ and what doesn't. And that's important, because real compiler builders and standard API watchdogs must also have this feeling. For languages with a super-human scale must also have super-human compiler-makers and standard API watchdogs. And not only that, but also programmers who can say, with some pride, 'I know quite a lot, if not all of C++'. The latter thing being impossible is not a good thing - it is a flaw.
Religion is what happens when nature strikes and groupthink goes wrong.
Managing projects is an issue with developers, culture and diligence. I have been on small java projects that were a mess and on many hige C++ projects that were great to work on. Java allows weak developers to write code without knowing how things work underneath which is unfortuante because it is much harder to find good developers in the java world, I interview too many people who don't even understand basic data structures yet claim to be enterprise level engineers.
Even though I do a lot of java (industry fad?!), I miss the fine grained control over memory and os resources that C++ offers and hope to someday do a lot more C++.
What are you, gay?
Gödels incompleteness theorem adapted for computer languages: Any programming language which is complete (i.e. usable) must be inconsistent (i.e. unusable).
I hope you seen that the obvious advantage here is that Java programmers don't have to know about the implementation of underlying datastructures. There's a huge standard library with well defined interfaces, and I can rely on that. Ofcourse I can figure out how exactly HashMap or TreeSet is implemented, but why should I? That time is much better used to do something useful with them. All I have to know is what they're good for and what they aren't good for.
That fact that Java allows programmers to write effective code without knowing how things work underneath is an advantage, not a disadvantage. A language or framework that requires you to know every little detail about its implementation is bad, because it's hard to use and hard to learn.
(Ofcourse that doesn't change the fact that good programmers should have a good understanding of basic datastructures, but they should also understand the importance of transparency, interfaces and APIs.)
There are, nevertheless, certain things that computer scientists know better how to do then computer engineers.
Example: I'm an engineer, and I had a job to do that required parsing C header files. Parsers, compilers, loaders, virtual memory, and all that good stuff just never appears in engineering degrees. Too theoretical. Troubles is, I needed that stuff to make a virtual machine implementation actually usable in the real world. I then had to spend three months learning how to write compilers from textbooks, because my company ONLY has engineers, no scientists.
A practical understanding of programming can only get you so far. When you need to do something truly exceptional with computers, you need the theory to back it up.
There's no way to teach C++ effectively in a university setting, because there's so goddamn much of it. It would be like having a major in "Science". You have a language that's been around for a quarter-century and its creator still doesn't fully understand it. Well, maybe he does understand it, but we'll never know because the language is too goddamn complex to say for sure. It's taken forever just to get compilers that implement (as far as anyone knows, anyway) the language completely (and now they want to make a new version that will be even harder to understand.
I think the first step in teaching good C++ is to sit down and figure out which portion of C++ is actually useful, and then standardize and implement that. Call it C+, or C++,++ or something.
I'd argue the only real reason it did is that it filtered out the people who couldn't grasp those concepts. I don't believe that knowledge is useful today, except applied in the same context -- filtering out people who have no skill.
That's a LOT of assumptions in one sentence. Let me enumerate them:
And why not to use it? Because the language is much more complex, has many hidden surprises, and the compiler is slower. If you are using mostly C-like structures anyway, I don't think it's worth it, especially when there are many people out there developing C. You'd be stuck between two communities -- those who use C, and those who use C++.
Which has nothing to do with it being a subset or not.
Besides, while I'd agree object-oriented programming is important, you don't need C++ classes to do it, or even anything vaguely resembling C++ classes. The logical hierarchies you're talking about don't need to be rigidly applied as a language feature.
Don't thank God, thank a doctor!
We actually stared off w/ other options. I got hit w/ Pseudo code (read: fake programming in English for those who can't spell). For a guy coming from C programming, this was absolute pointless torture (you don't know how many time I scanned a piece of paper and thought of doing Ctrl-F). They went back to Scheme. Later switched to Python and Matlab.
Scheme isn't too bad as a starting language, but I consider it horrible when you are trying to teach people to write clean, maintainable code. It is far too easy to write cryptic stuff. Python is very clean and clear (read: in grading, you can easily tell when a person went out of their way in making it cryptic). This is the same reason I don't want them to use Perl, php, or javascript. On the plus side, Python has real world applications and lets your imagination run wild. And it has a very large useful library with interfaces to other software.
At our school, people come from a multitude of fields (every major has to take this class). Some are expert assembly/C/C++ coders! They shouldn't even take this class, they should just get the damn A. Like me and Pseudo code, you will piss us off to the point where we want to beat the crap out of the TAs. Python will add the most real world value to all of us (unless you are a python expert).
So overall, Python with its emphasis and philosophy is the better option... IMHO.
That requirement of knowledge make for better engineers, IMHO.
I'd argue the only real reason it did is that it filtered out the people who couldn't grasp those concepts. I don't believe that knowledge is useful today, except applied in the same context -- filtering out people who have no skill.
You may think that, but that is an opinion about knowledge based on ignorance. Even today, there are times when various old bits of knowledge come in handy for explaining why certain things happen that are not immediately obvious.
If it is as efficient and is as predictable in implementation as C, but has additional features that help you write code, why not use it?
That's a LOT of assumptions in one sentence. Let me enumerate them:
* If it is as efficient
* and is as predictable in implementation
* but has additional features that help you write code
* features that help you write code are desirable (as opposed to features that help you write better code, or help you write more efficiently)
* Or, alternately, the features C++ adds help you write better code, or help you write it more efficiently.
If you compile code written as basically "C" code in C++ and make use of default parameters and the stronger type checking, it is as efficient, is is as predictable, does have the features that help (default parameters, type checking), it does make code better.
You should dump out the assembler to prove it to yourself. Oh, wait, isn't that one of those knowledge things you say you don't need?
Besides, while I'd agree object-oriented programming is important, you don't need C++ classes to do it, or even anything vaguely resembling C++ classes. The logical hierarchies you're talking about don't need to be rigidly applied as a language feature.
No thanks, I've done my time, in the '80s, hacking out structure based object oriented frameworks in C. C++ is far better and more efficient and allows the compiler to do "early binding" and be more efficient.
I thought Java was designed to be run on set top boxes and other such environments. It wasn't until later that it was released as a general purpose language.
I read the internet for the articles.
Heh, I know you're exaggerating for effect, but it seems to me that a great many CS programs are in fact training kids to be CS professors (I guess professors in general tend to teach what they know) instead of instilling lots of job skills that would be useful in the real world. I spent half of my senior year in college learning different ways to prove algorithms correct. In my job, I have never been asked to make a single inductive proof or any kind of proof. I doubt many people do in the real world (it's wildly difficult to do for non-trivial problems and doesn't really mean much of anything most of the time). A lot of the skills I learned are great for writing an academic paper, but pretty much useless for architecting a large project.
I read the internet for the articles.
Too bad if your generic was returned from a method that's in a class in a .jar file, you're back to casting. Generics are pretty much useless unless you're recompiling everything from source. Feel like recompiling Hibernate every time you hit F5?
Done with slashdot, done with nerds, getting a life.
You're missing the fact that the Pony Express could carry packages, which none of the other technologies you mention were or are capable of. The modern equivalents of the Pony Express are therefore the likes of DHL and UPS, who still transport physical things around, and will continue to do so until somebody comes up with a way of replicating matter at a distance.
NB: American Express, who ran the pony express, are still around, and doing very well for themselves, although they aren't in the transport business anymore.
I'm not going to change your sheets again, Mr. Hastings.
Oh, you think? CS has nothing to do with job skills.
I spent half of my senior year in college learning different ways to prove algorithms correct. In my job, I have never been asked to make a single inductive proof or any kind of proof.I do it all the time. Maybe not formally, but I definitely spend a lot of time convincing myself that functions cannot return unexpected values given any inputs they receive. Sure, it takes me longer to write a single function, but my boss likes that I can turns things out to production rapidly without major problems and that I don't spend all my time rewriting code.
Dewey, what part of this looks like authorities should be involved?
Visual Basic is widely regarded as totally Night of the Living Dead zombified and is held in disdane by anyone who considers themselves a professional programmer, especially by anyone with any C/C++ experience. But what ol' Joel does is he hires who he considers to be the best C++/MFC programmers he can get, and he puts them to work using VB.
Why does he do this? Because VB, at least for things Joel is interested in, is by leaps and bounds more productive than C++/MFC. Just as you are leaps and bounds more productive using Matlab than the FORTRAN you might have started out with. But why subject C++ programmers to VB when they hate VB? A lot of the reason these dudes hate C++ is they have been told by PHBs to fix someone elses spaghetti VB app, but if you take C++ coders, i.e. people who know the rudiments of programming, the are absolute maestros with VB compared to some financial analyst type hacking together a mess of a VB program.
I am not contradicting anything you are saying. If you had any kind of background in FORTRAN or whatever the equivalent, Matlab is like the pleasure of taking off shoes that pinch. But if you haven't had that equivalent programming background, Matlab can be like any other programming language to a newbie -- endless debugging to get anything right.
Why gin up a Matlab substitute for undergrad teaching? One reason is that Python is FOSS while Matlab is not. I am not one of these hyper-partisan FOSS advocates, but on the other hand, I see a kind of conflict of interest situation for turning engineering colleges at public universities into wholly owned subsidiaries of anyone, whether it is Microsoft or Mathworks or whomever.
A second reason is that Python is a reasonable teaching language regarding OO, data structures, functional programming (to a limited extent) of what are the modern foundations of programming and programming languages and outside the numerical programming domain, Matlab is a dog's breakfast. Someone trained on Python can go off in your direction and be comfortable doing numeric calculations in Matlab or go off in another direction and write C code for an embedded computer system, based on learning some basic concepts that Python supports and Matlab does not.
And Computer Engineering != Computer Programming (Software Engineering)
Computer Engineering is designing and building Computers.
Computer Programming is contained within, but is not all of Computer Science.
--
JimFive
Please stop using the word theory when you mean hypothesis.
I was thinking of MFC/.NET. If you want to compile a simple executable, you would have to through all this hassle. If you are in Linux you can just use your favorite editor, edit the file, and very possibly run the compiler from inside the editor.
Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
Python will add the most real world value to all of us (unless you are a python expert).
If you're worried about learning a language in a school, you're in the wrong place. That's not the point of a university. If you're looking for that, you belong in a technical college.
Scheme teaches valuable skills that you simply don't get with something like Python. Functional programming is the logical starting point for teaching programming. "But I already know C, I don't need this" is ridiculous. Lisp/Scheme teach a very valuable paradigm that you will not get with Python or C, and its lessons can be applied to imperative languages once they are learned later.
"You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
Any enterprise still using Java 1.4 is putting themselves at risk. Java 1.4 end-of-life support from Sun ended ages ago, and Java 5 enters end-of-life support this summer when Java 7 is released.
Your framework observation is a failure of those frameworks. They should be passing objects by different interfaces that describe the functionality. Generally you should not be relying on instanceof/casting within code - it is ugly and inefficient and suggests a nasty design.
Um, maybe you're just thinking of MFC, because in .Net you do that the same way as the other poster suggested for Java.
No, that would be useful. That's not what CS proofs entail. It's more like proving rigorously that function x will always be larger than function y for all positive integers. Or that there is a solution for f(x) for all possible real values of x. Validating inputs has nothing to do with it, even though it kinda sounds similar on the surface.
I read the internet for the articles.
Minor thing, but all the cool kids use Avalon/WPF now; Windows Forms is pretty much dead and gone.
...doesn't change your statement about cross platformness, sadly; it'd be cool if Mono implemented WPF, but I don't see that happening.
They did, however, spend two terms teaching Hoare logic. Or rather, they spent one term teaching it, and then repeated the same material in another term with a different lecturer, because their communication was so poor they never realised they had duplicated their teching. They did a "Hoare"-bble job. Couldn't resist. ;-)
Ya, and I'm pretty sure it wasn't to solve engineering problems, but to analyze problems in probability theory that he wrote about. The use of using it, and it's closely related Fourier transform came only about in the 19th century for actual engineering problems.
That's like saying Rev. Thomas Bayes created an algorithm in 1763 to filter spam...
"Good, Fast, Cheap: Pick any two" -- RFC 1925
I like to write code from assembly to cobol to Ruby or python
Likewise, I had a few professors who didn't write any code. I never took them seriously because they couldn't take their knowledge and apply it to any real situations.
I remember spending 7 weeks on regular expressions, but never understanding the class because we never actually tried using regular expressions on a text file.
I remember spending 7 weeks on databases, but finding many of the concepts elusive because the instructor was incapable of using a REAL database.
A core part of Computer Science is learning how to apply knowledge. Likewise, many parts of Computer Science are best learned by "doing". Teaching any part of Computer Science without being able to implement it is just as bad as teaching a mathematical theory without being able to prove it!
No, I will not work for your startup
This is literally the pot calling the kettle black. Stroustrup is absolutely horrible at teaching C++ to beginners. So much so, that at Texas A&M, where he is a professor, he is not allowed to teach lower level classes on his own, because all of his students leave unprepared for the next courses. He claimed to fear not being able to teach the teachers fast enough, In reality, teachers learning the language makes them a better teacher. He has no clue what its like to learn the language, because he never learned it. I say this having learned a language from a teacher who was learning it at the same time. If the teacher is willing to actively learn it, it works. And just because you know it better than anyone Bjarne, doesn't mean you can teach worth a damn.
I really don't think a programming language can be considered functional if it doesn't have closures. I believe C++0x is slated to get closures, but until then, C++ is not functional IMO.
You don't need to do that to start a C++ project. I don't know where you have that kind of prejudice or stereotype, but in all the C++ projects that I was involved in, such things never were an issue. In theory, such issues would probably come up with basically every programming language, but in practice (at least in my experience), people are mature enough to stop behaving like some programming.reddit.com pussies, and simply get things done.
A monkey is doing the real work for me.
I think the exponential rate of the advancement in technology puts huge demands on current CS programs. Unlike more traditional academia, I feel CS more than any other field is under constant pressure to make sure their students are familiar with the relevant language, design pattern, etc. I feel this causes the programs to drift away from the important foundations of problem solving, mathematical proficiency and ability to break down large problems into manageable pieces. I feel these skills are what I profited most from in pursuing my degree. This also means students will graduate with little practical experience but sharpened analytical skills. There's just not enough time to teach everything!
And now for my rant for you already in the industry:
I feel there is a disconnect between employer expectations and what knowledge a graduating possesses. I see so often in this forum people fuming that a new graduate dosen't know this technology or hasn't heard of this protocol, or their coding style is inferior. It takes time for programming skill to mature and there is no one path to becoming successful with a CS degree. Instead of doing surveys about what books people read why don't you try and convince them of the benefits of reading such a book instead of snickering and feeling superior. (I haven't heard of the K&R white book either)
Maybe I'm just another one of those dumb cs students being churned out by your run of the mill university. Its true I wasn't confronted with pointers until me junior year but I was able to grasp it.
Is it protected or private? Is it virtual or pure virtual? That declaration makes no sense, and I'd shoot anyone who used it.
"We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
I tried to find a PM button to address you directly, but anyway:
I often have trouble with containers, to pick a specific issue. Since they store Object:s, I can never be sure what they contain, and after retrieving an element it has to be casted. I've seen someone mention that this can be solved with reflection, and there's supposed to be a template mechanism, like Vector<MyClass> for instance. I haven't been able to make good of any of those though, and I have never seen any existing code making use of those mechanisms.
Another problem for me is element manipulation. The only way I've been able to alter a container elemenent is extracting it and deleting it from the container, make the changes and then putting it back. Which is fine for smaller structures, but when the container has tens of thousands of elements of a few hundred bytes each, and each needs to be changed, then the problems start.
If you have any pointers to share, I'd be happy to get them.
Adventure, Romance, MAD SCIENCE!
My university's introductory C.S. course is Java, but it's extremely basic, just offering knowledge on functions, and such.
So far, every programming class after that has been in C, and with the exception of the introductory class, use of Java in any class is purely an elective course.
Learn something new.
Funny, I've just picked up a copy of TAOCP to read on the train. I think I'll bring K&R instead, now.
At my school JAVA is the main language used, especially at the lower levels, but there are required courses in C, UNIX (part of the C course) and MIPS assembly. One of the elective courses is C++.
I know I could have done without a lecture on the role of woman in a phallocentric order during a film course to satisfy art & diversity requirements.