The choice of Java as a first programming language in computer science courses is undermining good programming practice, according to two leading academics. In a withering attack on those responsible for setting the curriculum for computer science courses, doctors Robert Dewar and Edmond Schonberg of New York University (and …
Bias of Academics Against Commercial Uses
The bias of the "good doctors" is that they are allowing themselves to be distracted by Java's uses and how it is being taught, rather than anything about the language in particular.
Java is being used everywhere, not just in Web apps.
Critics Also Praise Java
If you follow the link to their company's website, you will find this quote about ADA:
"A major improvement [to ADA] is that Java-like interfaces are introduced thereby permitting simple multiple inheritance; null procedures have also been introduced as a category of operation."
He's right about Basic programmers...
'Edsger Dijkstra described those exposed to Basic as "mentally mutilated beyond hope of regeneration"'.
I'd say it goes double for ASP numpties... :-)
More seriously, though, it isn't just the choice of language or how the language is taught. It has a lot more to do with the curiculum as a whole. How much and what quality of Maths are they taught. Do they get taught these subjects (Discrete Maths, Computer Electronics and Programming) in isolation, or are they taught in a way that shows how each afects the other.
Un fourtunately, in many schools, the Maths department teaches maths as though no other subject exists and the Computing Departments and Electronics departments are guilty of the same.
"While the good doctors acknowledge that "real programmers can write in any language", they specifically laud the virtues of C, C++, Lisp and Ada.
All of which makes the criticism of Java somewhat odd. Java syntax is derived from C++ ..."
Actually, no, it doesn't make the criticism odd unless the criticism was specifically about syntax and I sincerely doubt that. You do realize that there's slightly more to programming languages than syntax, don't you? And that beyond syntax Java and C are about as far apart from each other than two imperative languages can be?
Now they love C eh?
Back when I was in uni those profs lambasted C while extolling the virtues of Pascal/Modula 2.
I would have expected them to at least praise something like Haskell.
Consumer software runs on the web these days
It's funny to criticise Java for working so well on the web. Most applications are run on the web these days - Google, Ebay, Amazon, Facebook, Myspace, Wikipedia (can I mention that here?). Modern JITs are efficient enough to allow even the most challenging of applications - real time video editing and playback.
Software is there for its consumers, not its programmers. So let's get away from purism and observe that, in the real world, if you want real time safe, secure and accessible software, Java works best.
And now that I actually bothered to read the original article...
Christ, it's spot on. The list of "languages that matter" - nothing missing, in the right order, on the list for the right reasons. You can hate academics all you want but the author of this particular critique seems to have a valid point to make. And yes there's something unique about C as the layer between the machine and the programmer/compiler designer. I never cease to amaze at the foresight (or luck) of those two guys working for AT&T in the mid-seventies.
But what do I know, I just design instruction set architectures, implement them with pipelining, multithreading and support for loosely-coupled memory interconnects, supervise compiler projects serving them and finally write a simple operating system and play a game of tetris running in VHDL simulation once all the pieces are there. And yes I'm even being paid for all that. :-)
I kid you not we have just had a 12 week course on... Haskell.
Talk about a massive waste of tuition fees.
Java considered bad for learning?
The main criticisms of Java in this article would seem to be a mixture of unfamiliarity with the language and poor teaching material.
The two statements:
- Students found it hard to write programs that did not have a graphic interface
- its restricted use in the development of web applications
are mutually contradictory since web applications typically run on servers and never have a graphical interface.
Poor teaching material
If students don't understand the relationship between the source program and what code is generated or can't write command line utilities they simply haven't been taught properly.
It seems to me that Java is a nearly ideal first language since it gives excellent training in creating modular, well structured programs. This can be carried forward into other languages. In addition, it has such a rich set of standard classes that non-trivial assignments can be written much faster than would be possible in, say, C.
Teach Java first, then C or Ada and leave C++ for last. If you want students to understand the hardware, then teach them assembler right after C.
Back to Fortran (which is what I'm using at this very moment).
Yes, java is terrible. So is (IMHO) C++.
People should learn all about command line interfaces before doing much else. Leave that GUI stuff to silly artist types.
I can see the point
I've worked as tech support at a dev base for the HBOS - building of two to three hundred programmers and developers meant I didn't get any software calls as they dealt with them their selves (where feasible, access restrictions do get in the way but those calls I was merely there to type in the password ;) ) but the hardware fault list went through the roof as most of these programmers didn't know the basics of how a computer ran - which always bemused me how the can write efficient clean code if they didn't know how the system works?
But then again I'm just a box swapper and don't code :D
History keeps on keeping on...
To me the lambasting that keeps on keeping on is more to do with the dilemma of how much a college should be making its students "commercially ready" and how much they should be getting into the nitty gritty computer science. This sort of rant from college people happens on a somewhat regular cycle.
That being said, note that these people have their own language bias towards ADA.
As far as BASIC goes,
it was the first language I ever learned, on a ZX81. I followed it up with BBC BASIC and 6502 assembly language.
I currently work as both a web developer (using multiple scripting languages) and as an Oracle certified developer, having previously worked with IBM Assembly Language and COBOL on IBM mainframes.
Yep. BASIC sure screwed up my chances of being an IT professional.
Prepare for some fanboyism...
What a load of utter crap. What they're saying is, programmers aren't as hardcore and uber-nerdy about piddly little details as they used to be, and these old-timers don't like it.
So what they're really saying is, someone's made a decent language where you don't HAVE to care about that shite, and that's a bad thing. Well, sorry lads, some of us got bored of having to worry about constant pointer issues and memory leaks.
I've used many many languages over the years, starting with BASIC and Pascal, moving on through web languages like PHP to C++ and finally to Java (via a gazillion others). And of them all, Java is the one that impresses me the most. Contrary to the opinions of these morons, it's flexible beyond belief. Want an app for a mobile phone? Perhaps your wristwatch? A website? Or maybe you'd like to code up a scalable enterprise banking system instead?
Sure, you don't get down to the really hardcore stuff as much, but that's kind of the point of Java - why the hell would you want to when someone's written a perfectly good library already? With the wonders of proper OO, you can just drop in a free-licence library and save yourself a ton of time and effort. How can that not be brilliant?
And how can using a very well structured, strongly typed, flexible language undermine good practice? If you don't follow good practice in Java, your program's likely to be crap. Or not even compile, for that matter.
I'm sorry, but their remarks are nonsense. Especially the one about "not knowing how to build programs without a graphical interface." That one made me laugh. On my University course they taught us how to code servlets and the like before they taught us how to code with Swing.
Truth is, take any student that has sat a "programming course," having never done programming before or outside the course, and they will still know sod all about programming in most languages when they come out. There's only so much you can teach, and there's such a vast amount to learn. Of course they don't know everything - that comes with experience. And obviously the course tutors are going to settle on a language that a) they like, and b) will be useful to the students in the future. And that's Java. (No matter how a certain over-enthusiastic lecturer at Leeds Uni wishes it was Python. Don't worry, we're getting him treatment.)
I wouldn't mind them teaching C++. Really, I wouldn't. It's not a crap language. It's just that...well...Java's better. By miles.
Right, rant over. Back to fiddling with PHP 4 and wishing it was PHP 5.
Snobs, bigots, and venal professors
Edsger Dijkstra was (is? He's dead to me) a narrow-minded, bigoted specialist.
My second programming language was BASIC (Tiny-BASIC, to be precise). Hardware constraints forced me to teach myself assembly language, and, since no compiler available would fit in the memory I had available (this was the Z80 era, 4K RAM was expensive and 16K was luxury beyond belief), I also had to hand-compile it. Prior to that, I had learned enough FORTRAN to make it through my local community college's CompSci 101 course (all programs to be punched on lovely cards, sorted, and run through numerous torture devices before they could be submitted to the High Priests who determined exactly what was to be run, and what was to be discarded, presumably by reading the entrails of a freshman).
I later learned C, PowerBASIC (a lovely compiled BASIC that rivaled C for final code execution speed), C++, and several other "languages" which are Web-related and which I therefor consider less qualified to be called "programming" languages. I've been published, worked in Intel's Network Products Division as a build engineer, and moved on to enjoying the fruits of others' programming rather than writing much more than bash scripts these days.
The leeches deprecating Java are not wholly incorrect, but they have placed emphasis on the language which they prefer for venal reasons, rather than logical ones. Students should learn to program in pseudo-code, hand-compile, and run the results, before they are ever "taught" a high-level language such as Fortran, BASIC, or Java - or Ada. I wasn't fortunate enough to go that route myself, but I was sensible enough to go seek out the knowledge I needed when I needed it. I know from my experience as a supervisor that not everyone will do that.
Naturally, I don't post with my real name.
An over hyped heap of p**h
At last ... java should 'av been char broiled years ago.
OOOh pointer arithmetic is error prone ... lets not doo that!!! but the OS is mostly assembly & C, so are most of the third party apps ARRRGHHHH ... quick JNI to the rescue. That whole pointer thing is a joke, most of optimised assembly code I wrote is not even reentrant.
Wot's happening in the JVM ... who noze??? Lets instrument ... but you'll have to write some C++ to get the full (alleged) benefits of JVM TI ... rubbish!!!
Have a look at the Hot Spot JVM source code ... when I started as a low grade C++ code pee'er I would have been thrown out of the window for writing that kind of code.
Virtual Machine is not new and some I used (Smaltalk & Forté 4GL) were said to be slow ... lightning fast compared with the Gosling T21somic child, they started that crap in the early 90's.
I'll shut up the day a Doom/Quake like game written entirely in Java will perform the same on the same machine. If it's not fit for a million dollar game how can it be for a billion dollar bank app?
Good experiment but please Ditch the stuff!
Read it again Phil!
Very poor form Phil! If you read the article again, it does not attack Java at all. It simply states the fact, obvious to anyone who has tried to hire fresh young programmers with sparkling new degrees, that Java is not a great language to teach the fundamentals in (flamers note: the fundamentals). Neither is COBOL for that matter.
It's not academic snootiness but a simple fact of life. I have found to my cost that trying to alter the mindset of Java-only programmers is likely to be a very expensive re-training exercise.
By the way, neither of the two best programmers I have ever worked with had formal qualifications of any sort and were entirely self-taught. One ended up as the principal partner of one of the most specialised software companies in the Old Dart. This may say something about formal education.
Your characterisation of Tony Hoare as an ivory tower egghead is so far off the mark that I must assume that "you are making with the little jokes, si?". A more practical minded guru there never was.
But keep up the good work writing about languages. It's always interesting.
Sure, Ada, Lisp, what else?
The way basic CS courses are taught are more important than the language itself. On the other hand it is quite hard to motivate students to learn languages such as ADA, Lisp, Prolog and such.
Yet another case of "I hate it, refuse to learn it therefore it is crap"?
Oh, PL-1, wherefore art thou?
I happen to agree
Based on personal experience working with "new graduates", those who went through the theoretical programming courses (ie, basics of OS, memory management, set theory) where more useful than those who simply picked up a language where all the "dirty work" (garbage collection, memory handling, etc) was done for them. The first group, being cognisant of the "theory" of programming could pick up new languages in a very short time (all programming follows certain basic patterns). Those in the first group were lost once they were asked to move outside of the language they were taught.
And that's the problem: the first group were taught to programme, the second group were taught Java/.Net/etc... Big difference.
Don't get me wrong - Java (for example) is a great language *if you already know the theory of programming*. I remember recoiling in horror when I attended a Java class (i needed a couple of credits to finish my post-grad) and a student asked why Java arrays start at 0... and the lecturer could not answer! Going straight into Java, .Net and their ilk produces a generation of "button pushers" who have no idea of what is actually going on inside the HW (even virtually) and are totally lost once they have to think "outside the IDE".
As far as I'm concerned, don't let *anyone* near 3.5G language until they've learnt the theory...
Those who can, do, those who can't, pontificate
"restricted use in the development of web applications".
I can only think that they are talking about the core language and not the profusion of APIs and framework that have sprung up around it to simplify web development.
However, learning LISP and ADA are hardly going to help putting graduates in a good position to apply for technical positions on leaving education. Learning a well adopted language in the business sector such as C++, Java and C# will.
And what is wrong with the console for feedback anyway?
I've been saying this for absolutely ages.
I grew up with Commodore BASIC, and learned 6502, 68000 and some ARM and 8086 assembler, before even starting to learn C. So far, I've managed to avoid touching Java too much ... and despite its exposure to several strains of BASIC, my brain is still quite healthy (actually, it made learning Perl a lot easier for me than for my fiancée, who had never touched BASIC).
The real point here is that few computer scientists who now come out of university really understand anything deep about computers and the operating systems that run on them. I know several people who have CS degrees, yet couldn't understand terms like cache coherency, spin locks, endianism or semaphores (nor could they spot the odd one out in that list without having to resort to guessing). Many more have never ever understood interrupts, let alone written code that makes use of them. And we wonder why skills in *really* high-level tasks (like multithreaded programming) is sorely lacking, these days?
If you *really* want to learn computer programming these days, you could do a lot worse than finding a C64 and 1541 disk drive, some blank floppies, a few copies of Input magazine - all on eBay or your favourite auction site - and start coding. I was annoying my A-level Computer Science teacher with advanced answers to system hardware questions, long before I met people coming out of University with CS degrees who didn't even know this stuff. Sorry if I come across as slightly arrogant, but I believe that if you go to University to learn a subject, you should learn about it in depth. Why else would you go to Uni?
Ivory towers or not, these guys are right. It's not just University professors bitching about course content these days, either: Companies have long hated the fact that the average CS graduate comes out of University completely unprepared for the real world (and of course, they have to pay to re-train them). This is partly why graduates from India and China are taking our jobs: They're willing to learn the skills - I can bet you *they* aren't sitting around on their bums all day learning just about Java.
Damned for popularity
They're attacking Java because it's what all the universities teach; if they taught C#, VB or Python I'm sure those would be under fire. And rightly so: CS students should learn the basics and the basics start with console applications written on *nix in C, using the standard libraries.
Back to your towers, guys.
OK, so they complain of "the lack of mathematical rigor and formal techniques" and then propose C over Java? Remind me never to bother with any papers from these guys. Oh hang on, I've NEVER come across any papers from these guys before.
Your comment about their criticism of Java's "close association" to web applications is spot on. I'm a strong advocate of Java as a language for teaching computer science, and we never see a single GUI window in our class.
Juxtaposing these guys with Dijkstra and Hoare is an insult to computer scientists everywhere :)
Similarity of syntax misses the point
While the syntax of Java is derived from C++, the semantics are very different, and I expect that that is what the two academics are uncomfortable with.
There's nothing wrong with teaching Java - I consider it a good programming language, with a good set of class libraries. But it is a much higher-level language than C, C++ and Lisp (I don't know Ada), in the sense that the language constructs do not map closely to operations in a typical physical machine. Java is designed to run in a virtual machine with complex semantics; a lack of understanding of lower-level concepts would make it hard to understand how this virtual machine can in principle be implemented on common hardware, and thus what the cost in time and space of Java constructs is likely to be.
One of the best books I read at university (early 90s) was 'Structured Computer Organisation' by Andrew Tanenbaum, which presented logic circuits, microcode, several assembly languages, and then C-like languages, showing how each level of abstraction could be built on an implementation in the level immediately below. Java could usefully be taught once these lower-level abstractions are understood. The student would then be equipped to understand which problems are suitable for tackling in a Java-like language, and which would be better implemented in something more like C++, or even machine code.
So, Java is a bad teaching language, but C++ is ok? Or Ada?
If the kiddies are learning bad programming with a lack of rigor, meybe they ought to teach good, rigorous programming. Java is a perfectly fine language for this purpose. If their courses are too narrowly focused on web apps, maybe they ought to change the content of their courses, what they themmselves designed and are teaching. If you get my drift.
The problem is not with java. It is with sausage-factory "higher education" which is nothing but vocational training. Take their money, teach 'em just enough so they can pursue a career, and to hell with learning.
Yes, it all comes down to money, and to the way universities really work these days.
IMO: programming-for-money ought to be taught in technical colleges. It is a trade - you are building something.
All high-level languages are fallacies
Joke: Assembler is the only true language! All hail assembly!
Not joke: BASIC was my first language, as the first computer I used was a PET 2001-N. Then I tried learning 6502 machine language, but it was too difficult without a book.
What is being missed is that the students are not taught design. They have no concept of design, so they blindly write something that kind of fits the language.
Of course basic computer use is essential. Microsoft routinely hires people who can't type, can't use a command prompt, don't know how to use Windows, and can't even hook the computer up to a KVM. This means that their productivity is nearly nil, and constantly complain that tasks are "too hard."
I chatted recently with a fellow who had a professor who taught Java. The prof in question was a Java-worshiper, who was completely dismissive of any language which could access a pointer. These instructors are damaging the students. The real power of a computer is only realized when you get close to the hardware. Everything else eats away at the full power of the system, especially throwing away CPU cycles to a virtual machine.
All languages have good parts and bad parts. What needs to come back into use is domain-specific languages. C and C++ are horrible for GUI work. Java is absolutely the wrong choice for writing a device driver. COBOL would be horrific for sending a man to the moon. Use the language that is appropriate for the problem at hand.
It's not really a withering attack, is it? Not on those responsible for the curriculum, and not even on Java. And I don't think that you'e chosen terribly good examples of ivory tower academics.
The argument that the authors put forward might seem a little out of date - or perhaps it's too positive about Ada, and not positive enough about Java - but the concerns are real enough.
Syntax isn't everything
They didn't slag off Java's syntax so why do you mention its similarity to the C/C++ syntax? Their complaint seems to be that Java hides what the actual machine is doing, pointers and so on, which is completely true, and that students don't seem to understand anything other than GUI programs (which seems unfair on the face of it; Java can write bad command-line apps as well as it can write terrible GUI apps).
Syntax is a very small part of languages, and just because Java gets it right by using a good syntax doesn't mean everything else is right with the language.
If you don't like academics in their ivory towers, read what Joel Spolsky said about Java, which seems to be along similar lines to what these two academics have said.
(At university I was taught functional programming followed by C, and then Java on a course that most would consider excellent. I already knew assembler so I guess I didn't need teaching about hardware and pointers but I'd say that, at the time at least, Java probably made sense as a teaching language for certain things, but certainly not everything. Any course which only uses one language is stupid if you ask me, but at the same time I would say that, these days, I'm not sure Java makes sense for anything as there are better langauges with a superset of its features and no relative downsides.)
Pointers? Sheer bloddy luxury!
When I were a lad, we wrote our programs using strange three-letter words and the occasional number. If we wanted a variable we 'ad to go diggin' through the stack. And we thought we were lucky!
Words? With letters? You were lucky! I 'ad to punch 'oles in little pieces of card and line up behind ten thousand other programmers to put the cards in the room-sized machine. And we thought we were lucky!
And you try and tell the young people of today that ... they won't believe you.
Well most of us hate Java :)
java was designed for multimedia TVs not web, it just keeps trying to reinvent itself.
java is a bit like the ugly girl at the dance, wearing one of those pink princess dresses, and unlike a fairytale there is no Godmother to wipe away those blemishes, it is permanent acne.
IMO Python is probably the best language to start on, and to use day to day. C should still be taught, as should C++. The shells are useful at least one should be known. Haskell for the functional. O'Caml is quite interesting, and of course Assembler should still be taught at degree level if not earlier. Ada is worth looking at; good programming practice can be drawn from that language.
The ugly sisters are things like Coldfusion, gopher, and modula, they have very little application, and if you do find someone specializing in them they have either never had an academic grounding in computer science or have never left academia.
I must admit I rather like Perl, but it is a connoisseur language like Lisp, unlike Lisp though a lot of people pick Perl up who perhaps need to start with something else.
PHP is popular but of course the language is not really academic, it is a quick hack really trying to up its respectability, but of course that is the language most ISPs include with their free web space, so there are quite a few younguns who grew up with it. PHP will always be Personal Home Page to me. :)
java is just a verbose mess, at least there exists Jython for those who cannot convince the 'powers that be' that the Java platform is not a smart move. It is especially seen in development life cycle; you could probably fit in three comparable Perl projects to one comparable java one. Python you will probably be looking at 2.5 projects but then at least you can revisit with a bit more ease. If you are developing using java you are probably actually coning the client a bit.
"Wherefore Art, Thou" by Larry Wall of Perl fame, does a good of job of describing the differences between some languages; java is muzak and that is a generous description of it. :)
Greg my dear boy, anyone who gets so worked up about a computer language has to be a great programmer and I’m sure you have built some terrific software in your time. But, psst…, I’ll let you in on a little secret. You know the mobile phone and the wristwatch, which you think you can program so well. You may not believe this - at any rate you tell us emphatically that you don’t care - but some poor sod who actually understands the hardware and all the other “piddly little details” of the device, wrote some nerdy embedded stuff which makes it possible for you and other programmers working at your elevated level to think that you are in control of the thing.
If he or she was good at their work and virtualised the underlying levels well enough, you may never ever have to think about the piddles yourself. But eventually something will come and bite you and when that happens you won’t have the foggiest clue what to do. You know why? Because by your own admission you can’t really program a computer at all. Not really really. You need at least six layers of other people’s work between you and that “sub ax,ax”.
Now, that does not mean that you are stupid or incompetent or in any way inferior. It means that whatever you do, and probably do well, relies on the competence and hard work of many, many other people, most of whom would certainly acknowledge and admire your efforts. Maybe you should return the complement or just think of them sometimes.
And another whisper: the guy who understands what “sub ax,ax” means (and implies) can probably change places with you and write some pretty good Java if he sets his mind to it. Can you do his work as well!?
Teaching novice programmers
Speaking as a one-time IT lecturer, I have to say that NO one language is suitable for teaching programming to beginners. All languages have their quirks and the last thing novice students need is to get bogged down in syntax before they've even had the chance to learn the basics.
Back when I was lecturing, I developed a curriculum module for entry-level students called "The Robot's Kitchen". The premise was simple: given a gridded map of a kitchen, with all the ingredients and equipment in specified locations and a recipe for chocolate cake, get a robot to make the cake. The robot can only understand simple commands, like MOVEFORWARD, TURNLEFT, TURNRIGHT, PICKUP etc. as well as IF/ELSE/ENDIF and DO/WHILE/UNTIL for repetitive task optimisation. In this way, I was able to impart the essential principles of programming - complex problem breakdown, function calls, conditional branching, looping and process flow - without the students having to learn the syntax of a specific language or writing a single line of code. Most of the students were amazed at how a half-page cake recipe turned into a twenty-page assignment, but as I explained to them, that's exactly what programming is all about - taking a complex problem and breaking it down into simple, single-action steps.
This paid dividends to the students in the second term, when I started teaching them actual programming, using Pascal to begin with, then C - NOT C++! Because I'd primed the students with programming methods in the Robot's Kitchen assignment, they had far fewer problems getting their heads around the principles of programming than students in other classes. While I don't want to sound like I'm blowing my own trumpet, I should point out that my class consistently had the highest pass rate in the faculty, and that by my second year, new students who had friends in my previous year's classes were asking specifically to be in my class at enrolment.
As to programmers not needing to know about machine micromanagement (memory allocation/deallocation, managing the stack and so on), I have to disagree. As a programmer, you are taking complete control of the machine, and if you don't understand how the machine works, you have no hope of controlling it. Even if you end up as a DBA or frontend developer, you should still know about memory management, stack size and clock cycles because you still need to optimise your code for security, speed and efficiency - and you can't do that if you don't know what makes a computer tick. All programmers, even 3GL programmers, should be able to think in binary and hexadecimal and know the powers of two at least to 65536. They should know about the limitations of stack size and the importance of memory management - the famous buffer overflow exploit is a prime example of what happens when programmers don't understand these basics. That's like needing to know your alphabet before you can read Shakespeare.
Finally, C is probably the best language to teach once your students have a good grounding - not at entry-level. Nearly all other 3GLs are based on C and use its syntax, so if you can program in C, you can easily learn any other language. I don't like C++ because it takes too many shortcuts and is too idiosyncratic. But C enforces good programming practice and forms a solid foundation for the student to build their programming career on.
"Students found it hard to write programs that did not have a graphic interface"
Are they for real? What's easier than System.out.printing to console? Have you ever tried to write GUI code from scratch? Sure, drag-and-drop GUI-building tools tend to come built-in to Java IDEs these days, but it's not a feature of the Java language. Considering how many GUI-building Java tools there are available, and how bloody hard it sometimes is to write Swing code that works, I'd rather say it's more a feature of Java to /obfuscate/ GUI operations!
"had no feeling for the relationship between the source program and what the hardware would actually do"
Well, isn't that the point of Java? "Write once, run anywhere"? I hear that writing generally portable Java code is not always possible in practice, but, as long as the porgram is doing what thought I told it to, I'd rather not care what the hardware is up to, thankyouverymuch! If you wanna get in touch with the hardware, write in C or assembly!
"(most damaging) did not understand the semantics of pointers at all, which made the use of C in systems programming very challenging"
C can't express everyting that assembly code can, but it gives the option to call assembly code from its functions. Similarly, methods in Java may be decalred 'native'; that is, they are implemented in C.
Shock-horror: Java-learned folks come to C and understand nothing of the semantic's of C's pointers (shocking, conisidering Java deliberately abstracts such things), which makes the use of C is systems programming very challenging. Great, why not teach them C then,if the point is to program systems in C?
Java is a different language for a different purpose, and Java can't be blamed for not being able to express the concepts of a language of a lower level than itself.
Oh the choice of languages...
C? Yes its one of those perfect languages.
(COBOL too could be considered a perfect language of its generation.)
But C++? Hmmm no. (See my rant below. ;-)
If you're going to look at a good OO language, Objective C would get my vote. (Think a blend of small talk and C.)
We're talking practical languages here. Not just something to teach you theory.
But I'd still take Java over C++. Have you ever had to debug C++ written by someone who doesn't understand languages? The issue in the real world is that you're required to turn concepts in to reality quickly and for a lowest cost possible. Java is very portable and you can find "cheap" labor to write something that "runs". Think of it as the AK-47 of the programming languages. Think of C as an M1A1 and C++ as an early M-16.
Its not to say that C++ is a *bad* language, but that its harder to support or find good support and frankly you could pretty much write the solution in C that is more maintainable and less prone to errors.
And everyone who has ever programmed will have their favorite language.
@ Brian Miller
"Joke: Assembler is the only true language! All hail assembly!"
I think you may be confusing symbolic machine language with assembler language.
Certainly the IBM System 360 Assembler (and it's presumable Nth generation descendants) was a devil of a lot more complicated than mere machine language. On the one hand, you had to worry about making sure the hardware environment was suitable (all those lovely base registers -- anybody else remember those?) and on the other hand you had a macro facility that was an invention of Satan himself.
[Let me annoy the moderator by discoursing at some greater length on the topic, how to teach programming.]
It seems to me that it's a mistake to think that teaching any one language is "teaching programming." All that does is churn out graduates with a single skill and very little understanding, especially if the one-and-only language is a very high level one. There's no particular virtue in suffering, but exposure to the hardware guts of a computer and to a selection of languages of varying levels of abstraction is really The Thing To Do. (If I use caps like that, can I use the Man from Mars icon?)
The point of doing so is to teach not gruesome details of syntax but rather, and much more importantly, underlying principles. The successful student would be able to relate the rather simple structure of classical procedural languages (Algol, Fortran, Cobol) to all sorts of wild and wooly derivatives: OO programming environments, Lisp, Ada, Python, Java, you name it.
With the right selection of languages taught, the student is then able to get his head around whatever turns up next a lot faster than the poor doofus who thought learning one language was "learning programming."
I've been out of touch with the field for so long I can't begin to even speculate what selection of progamming languages would be optimal for teaching, but I think readers will understand my point.
[Hey, what happened to the Man From Mars icon???? Guess PH will have to do in lieu.]
So why the maths?
I am not a programmer, I am a lowly systems admin. But can anyone tell me what high-level mathematics has to do with computer science? Boolean logic, yes. Binary, of course. Anything else? (Not at the physics level of little chunks of electricity and circuits)
Java is the best language to teach
Java is the best language to teach students - not only is it good for learning concepts gradually, but in the end you've been trained in a language that has very solid commercial prospects. You can use it for web applications, GUI applications, command-line applications, database stored procedures, business logic, mobile applications, and even Blu-ray interactive stuff.
Languages like C still have their place, of course, but it's a much smaller place - low-level stuff like drivers, kernels etc. I'd include it in a later stage of programming tuition.
Personally, one of the things I hated about C++ is that if I wrote a program using Borland C++, and later had to switch to MS-C++, all the dependencies on the Borland libraries didn't work any more. Oh, and forget about switching to a different platform like Unix. Anything beyond some fairly basic standard libraries is different in each brand of compiler. The shift nowadays is for the language to include a substantial library of classes/routines which is always present whichever compiler or platform you use. So, whether it's Java or C# or PHP, you're not so tied down to one brand. Java is tops in that regard.
It's good for programmers to have at least some knowledge of what goes on behind the scenes when they make use of a library, but on the other hand it's nice to be able to just call a function to read an HTTP connection without having to learn all the details about how to handle proxies, redirect status codes, and all the other nitty gritty.
Professionals versus tradesmen
There are 2 sorts of computer staff.
1. Professionals who understand the theory of what they are doing and are capable of independently learning new skills, and who are capable of making a wide variety of decisions on IT and related fields.
2. Technicians/trades people who understand a language or two and a few specific tools. They are generally better at using those specific tools than the professionals, but their limited range of knowledge limits the range of tasks they can safely do.
Our industry has not recognized these 2 categories yet. But this is similar to accounting, engineering, and medicine.
Yes a professional might use Java. But also a professional will know the theory of what is going on behind the scenes, which you don't learn or think about when you learn Java. Of course you could learn just the C part of Java, and then you could learn behind the scenes, but then you would be learning C not Java.
It's not just about languages
I believe students should learn the ideas behind the languages, for example by getting an intro into one language of each group. As most languages can be learned in 2 weeks (there are exceptions like C and C++) it shouldn't be a problem.
I'd start with the classical "spaghetti-code" languages like old BASIC or some assembler. It gives the student understanding of the basic way of how computers work.
Then I'd teach stack-based languages. (like Forth) The shock is rather small and gives much understanding for the next group.
Algol-like languages. (Pascal, C) Unfortunately those are now preety much the onĺy thing in use.
Symbolic languages: Since they are so small I'd teach both LISP and Prolog
Object Orientated languages (Smalltalk, Ruby, etc) to show people how object orientated languages work.
Pseudo OOP-languages: Like C++, to show how you are not supposed to do object orientation.
It's definitely a bad idea to throw students into C or C++. In my opinion C++ is dangerous to your mental health.
Hear, Hear! Teach programming not programming languages is the gist of what you and the article quoted by Phil Manchester are saying, I think.
By the way, my old Computer Machinery lecturer (may he rest in peace) used knitting patterns from the Womans Weekly for the same purpose that you used the kitchen and cake with your students. (I think I just gave my age away. In those days women's magazines dealt with knitting and crocheting, not with nooking and crotches.) Eventually, as an assignment we had to describe the knitting language grammar in BNF. Ah, the good old days! But what I would have given for the PC I'm pecking this on!!!
Teaching programming BASICS
I have taught programming basics both in pascal and more recently java. The main reason we deprecated pascal at our department is that the version we had available at that point (an older gpc) did not do good run-time checking. Given that pascal's strong type checking and good run-time checking in the previous incarnation (HP pascal under HP-UX (especially bounds checking (buffer overflow errors anyone))) are extremely helpful to the novice programmer, one of the main reasons for using pascal was lost. A novice might deal with an error message along the line:
Array index out of bounds at line ....
but not with
which C would produce (if you were lucky). The problem we face teaching imperative programming in Java is that many students treat the problem of progamming as a "cut and paste" excercise. Too often they just look up a suitable class/method and cludge together a program which does sort an array as required, but they have not understood ANYTHING about the algorithms or data structures behind sorting. This is unacceptable. In practice, it is an important skill to use available classes etc, but a programmer, and certainly a computer scientist must be able to develop NEW algorithms as well. This requires a thorough understanding of existing algorithms and data structures. I have actually just developed a new algorithm which performs an image filtering in O(N) rather than O(N^2), and it is hugely satisfying to see computing time drop from 4 - 10 minutes to less than a second on a 3 megapixel image. This may be developed in an "ivory tower" environment, but it will be used (hopefully) in real-world applications. Without a thorough grounding in the basics of programming, including complexity analysis, I could not have developed this algorithm.
I think the auhtors of the paper raise a valid point: we need something which allows us to focus on teaching people the basics of algorithms and data structures. I could imagine using first C and then going on to C++/C#/Java. But only if we can get C to give our students sensible error messages, etc. Of course industry needs people who know their way around the vast number of available classes and methods of, e.g., Java, and it is very nicely portable, but industry also needs people who can develop new algorithms.
" most applications are run on the web " ... well a lot anyway
however most of these applications are not written in Java!.
Outside the "gated community" of the Fortune 500 web applications are written in Perl, PHP, C, C++ in fact were you to name any programming language of the last 20 years there is a 50/50 chance I could point you to a site implmented in that language.
As for the list you give:-
Google -- Mostly C/C++
Ebay -- Java
Amazon -- almost everything that can run on a windows box
Facebook -- PHP
Myspace -- Cold Fusion
So one "Java" site out of 6. I suppose you could argue "ColdFusion" is really Java.
Anyway what did these acedemics ever do for us?
Computer Science gets less and less relevent as the technoligy improves. Its as if music was taught as "Resonance Sciences" and aspiring violinists had to do a paper in "String Science" before they were given a violin.
Currently on "Joel on Software" there is an artical advocating that there should be a Bacholer of Arts course in programming and application design where students would spend most of there time programming in the same way that film school students spend most of thier time filming.
Robert Dewar and Edmond Schonberg of New York University are clearly fools. Everyone is taught as they learn Java that it is ia severely limited language in some respects. As people that claim they are academics they are doing nothing to further the cause of students who have moved across disciplines to Java and have found it any easy route into learning development skills.
Such elitist nonsense is typical these days. I am a science grad who is retraining in development- Java has been an easy starting point for me. On my own I have gone on to fill in the holes in my geometry, algebra and low level language skils.
These people are clearly thinking only of furthering their own cause by promoting their own languages of choice. Unfortunately other people listen to them.
My experience is...
people will defend to the hilt the langauges that they were educated with. Personally, I started coding when I was about 8 in BASIC, and only made the leap to C++ about 4 years later. I've done a game coding course and a course in Java since, but I was always a C++ advocate, until recently. It was only very recently that I started using C#, but I really love it. Anyway, that's by the by, since the real issue is NOT if Java is a better language than others, but should it be used as a teaching tool? Personally, Java has an important part to play, however much you like or dislike the language itself, and I have to say that Java has my favourite IDEs over those available to other languages.
Yes, it might be portable, and you might be able to get "cheap" labor to code it, but the truth is that a lot of corporate companies have legacy code in C++ or C, and companies that code in the games sector will more than likely have a very high percentage of code in C++. This would not in itself be a problem, but the techniques that are involved in C++ are easily transferrable to Java. My own experience of this is that I learnt to use Java reasonably well within two weeks or so, and part of this is because I already understood fundamentals of programming at a lower level. I don't think that it would be so smooth the other way around.
Using Java in education is a shortcut, it means that you can skip all those difficult sections on pointers, stacks and heaps, and concentrate on the other difficult concepts such as the basics of O-O coding. Having known people who learnt Java as a first language, I know that a lot of them didn't get O-O, and would write procedural code inside a few objects.
Personally, I think that everyone should learn C first. Not because I think it's a better language, but because without a knowledge of C, you can't possibly understand why a language is needed, or where it fits into the heirarchy or C-style languages, you need to learn concepts in a backwards fashion (such as how parameters are passed internally, and why that int isn't changing outside your function), and also because I think you need a knowledge of procedural before you move to O-O, so that you know exactly what the difference is. After you learn C, and the principals of O-O, it should be reasonably easy to pick up other languages (especially if you start with C++). A lot of languages have a lot of different features, but C++ has pretty much all the features that other languages have in some form or other (pointers, templates/generics, namespaces, almost all forms of inheritance, ability to slip into assembler, include files) and once you have a good understanding of the aspects of C++ you will have a grounding that cannot be matched. Of course, with the advent of C++0x, which supports garbage collection and many other important new features, in the next few years, the face of programming could easily change again.
Do I think that pointers are a good thing? Not necessarily, but the theory behind them makes for intelligent and well-versed programming.
This is computer science, not development
Folks, this isn't about which language is best for production development; it's about which is best for illustrating the core principles of Computer Science. Java is great for certain kinds of high-level development, largely because of the scope of the libraries and development platforms that come with it.
If you actually want to understand what's under the hood, though - which is what Computer Scientists are supposed to do - you'd be better off trying to implement a JVM or JIT in C or C++. And if you _really_ want to understand what's happening, you need to implement a kernel, which can only be done in C with small bits of assembler.
(CS degree, former assembler & C programmer, now using C++ *and* Java *and* PHP, for different jobs)
"no feeling for the relationship between the source program and what the hardware would actually do"
Too true. There are way to many people around today who have no clue what's happening underneath, and who leave cr@p everywhere because the underlying implementation will clean up their garbage for them so they don't have to care.
It's not the language that's the problem, it's the sloppy practices it encourages by hiding the programmers from the consequences. That's why we end up with monstrostities like Windows Vista that won't run in less than 1GB of RAM. My home file server has 32MB (and no Java) and even that seems extravagant... Now where did I leave that Fortran compiler?
Like many people born at the beginning of the 70s', my first exposure to computers was through Basic. But *not* the brain damaged basic from microsoft which couldn't even get its arithmetics right, rather a CBASIC dialect from DRI. In many respects, Java is simply a grand-son from that particular kind of basics, with regard to the pseudo-code / VM part of the thing. I had much fun with it, doing some relatively complex things, but I have to say that I really got a feeling of programming only years later. At that time I had already decided to pursue another career path than becoming an IT professional, but I was still hanging with nerdy friends (all were beginning their CS degree). So I self taught myself C and x86 asm just to be able to do their assignements as a challenge. There, I met pointers and my life changed forever. Once you can imagine your pointers dancing in front of you, you can program anything in any language : you're sure to beat the cr*p out of any high-level programmer, in terms of performance of course, but also in terms of internal logic ; your programs are sure to be of a *much* better quality.
I understand the rant of the two professors : java hides the pointers, and it's the worst trick you can play on a wannabe programmer. If you can't tell a value from a reference, you can only produce substandard code. Maybe java is right for seasoned professionals, to help them meet their goal quickly, but seasoned professional intuitively knows what the language is really doing from the look of it. So they feel if a method is actually using a value or a pointer, and pick the right one accordingly. A beginner can't make a good choice while he doesn't knows there is a difference. C is an extremely good language to teach pointers because if you mess with them, they bite you hard.
Today ? I'm still not part of the IT crowd, but I like to occasionaly toy with programming. While I can do decent C, and a few other languages, I've reverted to my old Basic friend since I've met Gambas under Linux. This language despite its quirks can produce amazing results (think of it as java semantics with a basic syntax). The interpreter/VM is not polished yet, but its main author is working hard on it, and it already works extremely well on a 32 bits linux-intel box (next step : 64 bits cleanup).
Students should learn to program in pseudo-code, hand-compile, and run the results, before they are ever "taught" a high-level language...
This is the most sensible thing that has been said and is also the method by which I was taught. I would venture to say that language is completely irrelevant when learning to program. What makes a good programmer is the ability to solve problems. You can take any language you like but when it comes down to it all you ever do is move things from one place to another and use some basic mathematical functions, this requires sod all so called programming skill and can be done in any language. You will constantly hear, at least I have, that the best programmers have physics degrees and the worst computer science ones. The former discipline lends itself well to encouraging problem solving. As far as I've ever seen all the latter teaches you is how add up using two digits.
In general programmers are an elitist bunch with their heads so far stuck up their own backside that they can't see past their own pet language. They have perpetuated the myth that what they do requires immense skill so much so that they actually believe it themselves. Utter twaddle, any fool can program in any language.
Courses in problem solving is what's needed not a specific language. After all, the Java of today will be the COBOL of tomorrow and programs will still be adding, subtracting and moving bits about.
- Review Is it an iPad? Is it a MacBook Air? No, it's a Surface Pro 3
- Microsoft refuses to nip 'Windows 9' unzip lip slip
- US Copyright Office rules that monkeys CAN'T claim copyright over their selfies
- Tesla: YES – We'll build a network of free Superchargers in Oz
- True fact: 1 in 4 Brits are now TERRORISTS