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,
Would that (1) I had moderator points and (2) I could apply all of them to one article.
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.
EXCERPT from my blog (I don't want to be slashdotted)
... ... ... //oops...
From my blog you may notice I am an inveterate C++ coder. It was the first language I taught myself after pascal and my preferred language for compact, fast code.The downfall of C++ may not be news to many, but often it is written by opponents of the language rather than those who love it and all of its quirks. So from a fan, C++, the prognosis is poor. I could write a book on this, but I tried to distill it down to article size.
Principle of Least Surprise
The first reason is that C++ violates the Principle of Least Surprise regularly and with malice of forethought. What do I mean by this? This compiles:
class ThreadPool{
public:
ThreadPool(int thread_count);
};
int compute_bleah(int i){
}
int compute_blah(ThreadPool pool){
}
int main(){
compute_blah(5);
};
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.
This is not an isolated example. If you are a seasoned C++ programmer you probably still run into something like this once every couple of years you hadn't heard of before. In fact, the language does this so much that people created whole careers around coming up with new examples of C++ code that does something stupid and then explaining why.
Efficiency by default
This is really more of problem #1, but it deserves its own section because although C++ often does non-obvious things because it hates you occasionally it does stupid and non-obvious things because it is trying to save you memory and/or processing power. A classic example of this is:
class A{
public:
~A();
void doSomething();
};
class B:public A{
~B();
void doSomething();
};
void clean_up(A *a){
a->doSomething();
delete a;
}
void main(){
A *b_as_a = new B();
clean_up(b_as_a);
}
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.
Now, don't get me wrong. I know why this is. When C++ came out everyone in the C community was convinced that:
1. Object oriented code could not be effecient
2. noone should ever have or need more than 256K of RAM
As it turns out the C weenies were not convinced on #1 anyway and we all know about #2. Unfortunately this causes a long-term problem for C++: Those who want efficiency have stuck with C regardless (embedded world, GNU UNIX, BSD, etc, etc) and those who don't need efficiency but want and OO language (more and more every year) just use a modern language without all the cruft.
I would guess that some of those C weenies are looking at this and feeling pretty good about themselves now so let me just interject that if C++ is like the worst kind of coworker that does a lot for you but so poorly you wish they hadn't, C is the coworker who can be relied upon to do nothing for you at all. Yes, C has less of the annoying issues in terms of au
I do believe that most people who learned C++ did not do so in an academic environment. It was more on the job training. When I interview a candidate, one question is "How do you rate yourself as a C++ programmer on a scale of 1 to 10?" It is amazing how many of them in the 8-10 range cannot explain the difference between a reference and a pointer, and how you initialize a reference in a class. Or what mutable means, or what templates are, or even what the three key elements of object oriented programing. C++ is a very (too?) rich language. I think many of the features will become less and less used and atrophy like our appendixes. Eventually C++ will be come the next FORTRAN.
BTW I've worked with C++ since 1992, but not any more. I can be 5 times more productive in C#. I actually dread having to go back into C++ code to fix a problem. 90% of the code that was done in C++ can now be done in C#.
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.
Bjarne, du lukker lort ud igen. Dit sprog er så godt som ubrugeligt. Hvad med at starte på en frisk uden al det gylle, du har lukket ud om C i alle de år?
Det ville også klæde dig, hvis du lærte noget C, før du begynder på at "forbedre" det.
På forhånd tak.
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?
It's that way because programmers insist on using features they don't have to just because it's there. They read Meyers, and think, "that's cool! I'll do that" I'm guilty of that one.
I am with Bjarne on this one.
..What would the world be like without Google?... Only C++ can allow you to create applications as powerful as MapReduce which allows them to create fast searches.
Bjarne Stroustrup, creator of the C++ programming language, claims that C++ is experiencing a revival and
that there is a backlash against newer programming languages such as Java and C#. "C++ is bigger than ever.
There are more than three million C++ programmers. Everywhere I look there has been an uprising
- more and more projects are using C++. A lot of teaching was going to Java, but more are teaching C++ again.
There has been a backlash.", said Stroustrup.
He continues..
I totally agree. If Java ( or Pyhton etc. for that matter ) were fast enough why did Google choose C++ to build their insanely fast search engine. MapReduce rocks.. No Java solution can even come close.
I rest my case.
I've seen the same thing at my university, except my skill lies in C rather than C++ (I code ASM and C on a daily basis). Pointers are your best friend when you know how to use them.
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
After reading numerous articles from this guy it is clear to me that Bjarne Stroustrup has no idea what he is talking about in regards to C++.
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....
http://reddit.com/r/programming/info/6dkxn/comments/
Perhaps I should have made sure to include some HTML code in there...something like...oh...I dunno...
The fact is that, in C++, OOP is purely a structural thing, not a conceptual thing that goes through the environment.
With this freedom, you have to device enormous amounts of information just to cooperate with other programmers, and just so people can begin to do the work.
OOP hasn't been slow, however, the earliest implementations of this concept was dynamic, and was done in virtual environments, so that would explain slowness.
C++ is basically the assembly language of today, with its performance-oriented level of interaction with the machine. Throwing more concepts on this platform is not going to improve it, HOWEVER, if you give it at least 20+ years, when people aren't taught the other paradigms from the start, a behemoth framework is has been tacked on it, so it's basically #include and start coding. C++ is basically Windows on MS-DOS.
I know, I've been programming in C++ for eight years now, and assembly language before that.
-Ray
Lack of planning on your part does not constitute an emergency on mine.
Dear Bjarne,
Your language is broken. It was broken very early on, but at least it could be described in 200 pages of densely printed text. Now it has grown to insane proportions in ever more elaborate attempts to add feature upon feature in an effort to satisfy every possible programmers syntactic fetish. Until it is at the point where anyone attempting to use the language spends more time trying to master the tool, rather than using the tool to create the end result.
Because of the absurd feature set, it has become nearly impossible to master the full breadth of the language. This manifests itself in the worst way when you have a group of coders each knowing different features of the language, with only a small subset that makes up the intersection of every coders C++ skill. The end result is that programmer A spends half his/her time trying to figure out what programmer B did with the language, rather than the what problem the code was trying to solve.
The most important thing to teach about C++ is how not to use it. By that I mean teachers should be telling their students, "This language has a 1000 features (or is it 5000 now I lost count), you should only learn about 100." The key is which 100. It is great for low level coding, an improvement over C if used judiciously. If used to construct complex object systems it is a horrible choice. Higher level dynamic languages are the way to go.
Bjarne if C++ is to continue to be used, you need to stop dumping more garbage into the putrid landfill that C++ has become. Instead it should be stopped in its tracks, and the programming community should restart a new C extension that takes some of the useful ideas of C++, simplifies them, and carefully limits any attempt to add features without any real value. In short do what you completely failed to do.
Oh and Bjarne your language deity status is here by revoked due to abuse of power.
For me it's typical "too little too less" syndrome. C++ played its important role years ago. Since then world has hanged dramatically. Current buzzowords dynamic languages, lambda expressions, clsoures and all this stuff and nobody cares if it makes sense or not. Sure - having known C or C++ it gives a lot advantages - You understand difference between heap, stack and pointers memory management - and gives You *real* understanding what, for example, closure is. But, on the other hand - who cares nowadays, except some really specialized areas like system development (actulally done in C), game development (partially) or HPC development (also partially). Actually nobody. That's said. Noody cares about C++0x or whatever it's named... Having 10+ years of core C++ development I actually even don't wanna read this spec. Word's going forward, languages going forward and nobody cares nowadays about unicodes support build in language or huge and convenient standard library (oh, maybe Ruby still do, last time I checked Ruby lacked unicode support also...). So far well C++ but don't expect people be excited now.
lima
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.
I think that most poor use of C++ can be traced to the use of C++. C++ was about the fifth or sixth language I worked with professionally and without a doubt it was the biggest load of crap out I've ever had the misfortune to come across. Things like "friends" which enabled muppets on the project to complete subvert the principles of the project. The brain dead syntax (inherited from C like Java and C#) which values keystrokes over clarity. Unlike PHP or Perl where only the clinically insane would use them on a large scale (30+ developer) project C++ was habitually used on just that sort of development.
C++ education should be short and sharp....
If you want speed do C or assembler.
If you want OO do Eiffel or Smalltalk
If you want a job do C# or Java
Don't do C++.
An Eye for an Eye will make the whole world blind - Gandhi
You wrote:
"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."
This is a nonsense survey. I happen to know what K&R, the 'white book,' and the 'Art of Computer Programming are, but I don't currently know how to program. In fact, I've read the white book several times and read parts of the Art of Computer Programming.
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 |
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.
The paradigm is changing.
People define problems.
Computers develop code.
Evolutionary computation trumps computer language development.
If you want to be a star in the next decades "obsolete skills",
then waste your time learning C or C++ or . . . .
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.
I fail to see how Visual J++ was a dead end. Although they don't call it Visual J++ -- it is now called Visual Studio .NET C#. I had looked at Visual J++, and it is .NET version 0.8 in so many ways.
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.
At Texas A&M University (where Stroustup is), the professor who "teaches" C++ could use a lot of improvement. I took it several years ago, and it was mainly just Dr so-and-so rambling on about general topics to programming and trying his best to ensure there is not a moment of silence in the room.
.cpp files, no error reporting whatsoever, no clear pattern of which parameters are input vs output, etc., in other words a code style that I would have been physically beaten for using in the Real World.
The half-dozen assignments were mostly to make small changes to an existing program that took maybe 3-4 hours to complete in TOTAL. And the program itself was badly factored, with a mismash of header files that did not match the
The prof has such a low bar that anyone with two neurons can get an A, so naturally his ratings at pick-a-prof and whatnot are very high.
I have been programming computers since 1976, and back then it was BASIC on a PDP-8e. Depending on your perspective, that either makes me experienced or a dinosaur. Keep your opinions, and enjoy them. Unless tragedy strikes, you too will hopefully gain some experience in life and be forced to listen to those who don't know 1/10th of what you do, and be forced to look back on your own behavior and wince about things you've said and thought to be right that were actually misinformed.
.net vs c++ arguments. With the [java | .net] proponents focusing on ambiguities in C++ or (gasp) pointers.
OK, "off my lawn" speech over.
IMHO everyone who complains about C++ is a pedantic fool. Nothing is perfect, no language, no computer, nothing. I loved what Stroustrup said in the article about becoming "language lawyers," rather than programmers. I am frequently amused about java vs c++ or
I come from a more renaissance period of computer science. Practitioners found it both necessary and valuable to know and understand "how" their programs actually worked. We needed to know how macros in the assembler worked. How addresses in labels got fixed up by the linker. How machine instruction permutations were constructed based on the assembler instructions. How to write an efficient "divide" function because the processor only added and subtracted. Forget floating point. Not to mention the mathematical efficiency of algorithms and so forth. Most of this stuff is black magic to most programmers today.
C++ has its flaws, absolutely. However, if you use "C" constructs, it is as efficient and as readable as C. If you conceptualize the logical constructs of your application as a hierarchy of objects, it can do that too. You can even easily and efficiently use assembler and pure C functions.
The root cause of bad C++ is bad C++ programmers. It is not COBOL and it will not protect you from doing something stupid. Just because you can do something syntactically correct, doesn't mean it is logically correct. A good rule of thumb to think about is this: If you don't understand how it will work, don't do it.
The argument that some features shouldn't be in C++ because of these problems sort of misses the point. A bicycle falls over without training wheels but is useless for serious riding with them. C++ without the features that can be misused would merely be a bicycle with training wheels.
Stop wanting everything to be "easier" to learn, some things become "easier" with learning.
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.
"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
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.
I agreed with you up until you complained that people didn't know K&R or Knuth. There are a ton of books out there now - why should people favor the oldest ones? The most important problems in computer programming have changed a lot in the last twenty or thirty years. K&R? Why use a C book to teach C++ when you could use a C++ book? Knuth? It was esoteric beyond belief even when it came out (there's a reason it's 4 volumes long), and it's even more so now.
Yes, yes, I get it. You want students to learn "real" programming, not wishy-washy stuff. But uh, a modern book can cover pointers too. And K&R or Knuth is not where to turn for object-oriented programming.
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.
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 simil
I don't doubt that at all. The best programmers always came from physics departments and other disciplines. The CS department spends way too much of their time masturbating to their own topics that matter once or twice in a career.
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.
And with C++. That is actually a good point in favor of C++, you can start with imperative, go to object oriented and have some functional programming in between. Allthough it lacks most syntactic features that make functionall programming in a language like haskell easy.
But that might be the main problem of C++. To use C++ effectively you should have used other languages that are more specialized to a single programming paradigm.
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...
Stroustrup really seems to have changed his views on this. In a suppressed interview to IEEE's "Computer" magazine from 1998, Soustrup said "Actually, I was thinking about those days, just before you arrived. Do you remember? Everyone was writing 'C' and, the trouble was, they were pretty damn good at it. Universities got pretty good at teaching it, too. They were turning out competent - I stress the word 'competent' - graduates at a phenomenal rate. That's what caused the problem." The rest of the interview has not yet made wikileaks but can be found at http://www.netfunny.com/rhf/jokes/98/May/stroustrup.html.
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
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!
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
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"
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
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.
C++ programmers do indeed need education, as do Java programmers. Best Stroustrup sentence, that sums most of what is wrong with today 'OOP programmers' (Stroustrup is right of course in case I'm not clear), is how, when you are doing OOP, implementation is a detail:
I have consistently pointed out that one of the major ways of writing classes in C++ is without any state, that is, just an interface.
And note that in Java you can greatly simply development by getting rid of abstract classes and both the 'abstract' and 'protected' keywords (in Java the equivalent of a C++ 'pure abstract classes' is an 'interface').
However I don't expect 3GL languages programmers and 'OO' programmers using 3GL languages to understand any time soon why this is a Good Thing (TM).
Using interfaces [aka C++ 'pure abstract classes' as Stroustrup calls them] is the only way to do clean OOA -> OOD -> OOP.
Remember kids, implementation is a detail in the grand scheme of OO. And, no, "code reuse - oh my god it's too hard and to verbose to use composition and delegation" is not an excuse. Implementation is a detail. Get over it.
Interview of Stroustrup on the subject at Artima by Bill Venners for anyone wanting to find enlightenment. It's from 2003 already and I don't expect people to understand that before another two decades or so, just as I don't expect people 'teaching Java' to realize that James Gosling screwed up big times by allowing the 'abstract' and 'protected' keywords in Java (btw you can find an interview from Java's "father" on Artima too, where he says he regrets not having gone the 'pure interface' way).
Listen to language creators kids, both Stroustrup and Gosling agree on this one: interfaces / 'pure abstract classes' are a Good Thing (TM). That is the single most important point educated C++ and Java programmers should know about.
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.
(1) Find Microsoft-platform programmers.
(2) Reach over their shoulder and close the Microslop Visual Kindergarten Playschool Point-n-Drool IDE.
(3) Spin their chair around to face you and say, "Are you listening now? Programming involves CODING - ACTUAL TYPING WITH YOUR FINGERS ON THE KEYBOARD!!! You cannot "klink 'n' build" 1337 pr0gramzez!"
I guarantee you'd raise the collective IQ of the programming world by 75%. But seriously, C++ is dead of the same thing that killed Java - too many suits and not enough engineers.
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!
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
More importantly I would not allow anyone else to write code
without GC because none of them were capable of doing it right.
Would you look at that ? Poor guy is completely surrounded by high-grade morons. Perhaps the problem is not with the language, but with his own company.
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.
C++ is a great language if you want to go hang yourself, but what most people really want is an object-oriented C. I'm convinced most of C++'s more esoteric features are basically designed to enable three different goals: RAII-style programming, templates, and operator overloading. While these make for "clean" code, they often make for obtuse code. They really seem more designed to allow library makers to create APIs that look pretty to use, by hiding resource management, types, and syntax; meanwhile, no C++ programmer who's been burned in the past is ever going to assume they can just "+" two types without reading the documentation, because it could mean anything.
What I'd like to see is a "restricted subset" of C++ that would be completely compatible with the full language, but would be restricted to a minimal, Java-like subset of features that everyone uses and understands (classes, basically). Then you would be able to declare (perhaps with a #pragma or something) that your C++ code only uses this restricted subset. It would be more verbose and C-like than what the C++ theorists would like, but it would eliminate the problem of subtle interactions that require you to language lawyer to understand. Meanwhile, those who want to use the full C++ language would still be free to do so.
Essentially, I'm proposing an ISO standard set of programming "guidelines" that would be enforced by the C++ compiler. One of the most important parts of programming in C++ in anything larger than groups of one is to state, up front, what features of the language will and will not be used by the team. This seems pretty broken for a standard language if most people are only expected to understand potentially non-overlapping subsets of it.
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.
Always was a scam, always will be.
"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.
Yeah we (particle physicists) learnt that the hard way. We as a rule suck at programming, so we thought hey we should get some outside help. Being scientists, we walked across the building to the comp sci dept and asked if they could help us out. Big mistake. Now instead of having crappy software that doesnt work, we now have crappy software which not only still doesnt work, but now nobody can understand what its suppose to do and what would actually happen if it did work. But for some reason we now get the reassuring feeling it doesnt achieve anything in the theoretically most efficient manner :)
I'm really happy to hear that as it means more C++ work in the future for me - Imagine how difficult it would be trying to find a job with a skill requirement that everyone else has.
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.
C++ should be banned - I've been using C and assembler for 25 years, also Java, C#, VB, and PHP. Nobody has been more honest about C++ than Tom Cargill, C++ Journal, Fall 1990 and I qoute from the book "Expert C Programming - Deep C Secrets" by Peter Van Der Lindin arguably more knowledgable than Barnes will ever hope to be:
If you think C++ is not overly complicated, just what is a "protected abstract virtual base pure virtual private destructor; and when was the last time you used one?"
And I might add who the hell cares? Someone that would invent a language as C++ should be sent to Sibera.
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.
it wasn't original: http://adequacy.org/stories/2002.5.10.153857.142.html
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
(Still better imperative than C++, because imperative with garbage collection is always going to be better than imperative with unsafe memory management...)
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.
If Wayne Dykstra's Intro to CS was too much for you, it's probably good that you dropped out.
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
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.)
Yeah, well... you Engineer's always were a bit weird... doing your fancy pants "Strength of Materials" labs and Destructive testing... us Artsies have the theory down pat
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.
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
True, if by "almost any language" you mean "any language other than C++ and Perl".
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.
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
Serpentmage was presumably talking about the Heaviside operational calculus (http://en.wikipedia.org/wiki/Operational%20calculus) rather than Laplace transforms as such.
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.
I graduated purdue in 07. They were teaching java as the intro course to cs, but besides that the rest of my CS degree was in C. The data structure course was in C++, but really we only used it to implement templates (the rest of that course was theoretical in nature). The graphics course I took had C++ as the language of choice, but we were given a lot of code already (and no C++ concepts were taught). The compiler course was in java.
Purdue doesnt really focus on software engineering or programming. They focus on theoretical computer science. I didnt learn very much about programming in any given language (not even C), but I did get a lot of crazy stuff thrown into my brain. Having my brain stretched in several very uncomfortable ways made it relatively easy to learn new languages and programming methodologies literally on the job.
On the contrary! If you are quite knowledgeable in C++, it will only take you a few years to learn C++.
But for some reason we now get the reassuring feeling it doesnt achieve anything in the theoretically most efficient manner.
That's good for you! Our CS people came back saying that unless NP!=P (or whatever), we can't even efficiently approximate not achieving anything.
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.
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
Now that would be C, wouldn't it?
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.
Lunacy might as well be a crime too.
Good design always trumps choice of language.
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.
I concur. Your post is both funny and insightful. One time I complained to faculty about the reading material in an operating system class (at a university which I will not mention here), and was basically told that the reason the material was factually incorrect was because things change so often in the CS world. I argued that there were plenty of books written decades ago that were still completely relevant. I was told that those books were few and far between - which is true, but irrelevant AFAICT. I dropped this line of questioning, got an A in the class, and remained frustrated about the ineffectiveness (and in some cases outright falseness) of our assigned reading material.
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. :-)
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.
It seems to me that the problem with learning C++ is closely coupled with the mental attitude of the learning person.
There seem to be to problematic attitudes: "Learning resistance" and "lacking curiosity".
There are developers out there, which for example just won't see the advantage of using exceptions for error handling: "Return codes have always worked for me, thank you very much."
And then there are the people, who just manage to grasp a minimal feature set of C++ which enables them to solve their problems, however inefficient and error prone the solution may turn out. "Yes, I heard about templates, but I really don't know what they're for."
And - of course - beeing a bad programmer is a language independent "feature". I've never seen a bad C++ programmer who wrote good, clean Java code. This might be enhanced by C++ since the language enables you to solve any problem in almost any possible way - including the exceedingly stupid one.
One can argue, that C++ is a complicated language with many pits and trapfalls, but learning how to build a java enterprise application with JSF, Spring, Hibernate has an equally unpleasent learning curve. (Done this for the last 3 years.)
Are you talking about Dave Ellison by any chance? I only ask because he said the same thing to my class at university and your username leads me to believe that you may be from the same area ;-)
- 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).
"My research shows that this language is one of the oldest languages in existence, pre-dating even assembly!"
You are right, of course, but you got the dates wrong. C++ was developed around 100 million years ago, around the Cretaceous age. As the most computationally competent biological components at that time were the dinosaurs, the language acquired a "programming in the large" philosophy.
It is known that developing in C++ gives you short term gains. However, as systems get more sophisticated, it places huge cognitive stress on its users. This was known to most dinosaur philosophers and as such, was used as a method of punishment for baby dinosaurs in infant academies, for those who do not learn their geometry. At least until the public opinion became against it, swayed by such philosophers as Socrataurs who classified it as child abuse.
It was still used by grown adults, until a major volcano stack overflow in the Volcanoes CT (Cretaceous-Tertiary) operating system resulted in the destruction of known civilization..
I guess you were taught bad practices to do Java development if you think you need to do all that for a quick and dirty Java program. I personally fire up a text editor, type in the basic class and write all my test code in the main function itself, compile it on command line and run it from command line. I don't see how this is different from your scenario for a c++ program.
Now, for my enterprise applications which are done on massive scale, I will use my Eclipse IDE. Please don't blame your lack of knowledge on the language itself.
-Anon.
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.
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.
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.
Whoosh.
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.
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.
I thought C++ developers were aware of the D Language: http://www.digitalmars.com/d/
BCPL -> B -> C -> C++ -> D
and it's closely related
"its".
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.