Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Possible Duplicate:
Why do we study Java at university?

This is a question I've wondered a lot as a young developer that just graduated from college. Why do schools teach Java in-depth vs something like C? A lot of my co-workers complain that there are no good C programmers anymore because schools no longer teach C in any real form.

For example, my first 6-8 undergrad CS courses were all in Java. Then I had exactly 2 courses in upper division that used C and C++, and the rest were in Java. That was it. A lot of students had to retake the C/C++ classes because nobody had introduced us to C/C++ or any concepts in C/C++. We were just expected to somehow program instantly in C/C++. Now you could say that once you learn a language, everything other language is more or less the same but a lot of my classmates had problems with pointers and memory allocation. I think I honestly spent half the quarter understanding pointers and memory allocation before I sort of understood it and even now I am not confident enough to say I truly understand it.

So why do schools do this? I've heard many developers say that going from C/C++ as a first language to Java is easy, but the reverse is much more difficult (This is also my sentiment). So why not do C/C++ first?

share|improve this question

marked as duplicate by Jerry Coffin, Mark Trapp Sep 15 '11 at 20:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
I doubt if it isn't closed –  Pankaj Upadhyay Sep 15 '11 at 19:10

5 Answers 5

up vote 9 down vote accepted

Joel Spolsky hit this in his post The Perils of JavaSchools.

Years of whinging by lazy CS undergrads like me, combined with complaints from industry about how few CS majors are graduating from American universities, have taken a toll, and in the last decade a large number of otherwise perfectly good schools have gone 100% Java. It's hip, the recruiters who use "grep" to evaluate resumes seem to like it, and, best of all, there's nothing hard enough about Java to really weed out the programmers without the part of the brain that does pointers or recursion, so the drop-out rates are lower, and the computer science departments have more students, and bigger budgets, and all is well.

The entire article is well worth a read as he analyzes what this means from the perspective of students who enter the workforce after graduating from JavaSchools and of the employers who wind up hiring them.

share|improve this answer
    
That was an excellent read, thank you! –  congalong Sep 15 '11 at 19:14
    
I am sadly one of these graduates from a "JavaSchool". Do you have any recommendations for becoming more better at C and C concepts such as pointers and recursion? Books, online lectures, etc that you'd particularly recommend? Thanks again! –  congalong Sep 15 '11 at 19:20
3  
I'm not sure why He says that recursion in Java is easier than in C. –  FrustratedWithFormsDesigner Sep 15 '11 at 19:34
    
@soulesschild cprogramming.com/tutorial.html is a good start. –  Brandon Moretz Sep 15 '11 at 19:42

It's the result of an unusual agreement between two antagonistic schools of thought.

The academic, or ivory tower approach, is that students enroll in computer science because they want to learn computer science. Languages come and go, but the foundations of computer science last for decades. The time we spend teaching the syntax of any language is time we loose for actually teaching the computer science concepts. Therefore we should choose languages that are sufficiently powerful to represent the techniques we want to teach, but have a simple syntax, so we don't spend all of our time being language lawyers. We tried using functional languages, but there seems to be a large number of students who struggle with functional programming. We've tied ADA and C++, but both have complicated syntax to support multiple paradigms, and they take too long to teach. Let's go with Java as a reasonably powerful language with simple syntax. Java syntax has gotten more complex, but this trend started back in the 90s.

The pragmatic, or trade school approach, is that students enroll in computer science because they want training for jobs as computer programmers. We should teach them a language in widespread commercial use. Java is one of the most popular languages for commercial development. It can be used for classical desktop apps, web apps, and server apps and supports multiple platforms. C# might have been considered too, but wasn't yet omnipresent, and was even more dependent on a single vendor than Java.

They might not have been able to agree on anything else in the curriculum, but both groups saw some value to using Java as a language of instruction.

share|improve this answer

Because the smart students dropped out and learned C on their own?

share|improve this answer
    
What if a student learnt C before going to school? –  rightfold Sep 15 '11 at 21:41

Java is an engineering masterpiece. It was created from the ground up to represent the current ideas of software engineering (in the 90s). It focused on theory and consistency over such silly notions of practicality, and it tends to be extremely tedious and wordy. So naturally, university professors loved it. So they taught it.

There was also a lot of, imo, derangement against anything related to Microsoft at the time. So when a new language for this 'new' interweb thing came to the forefront from a company that wasnt Microsoft, a lot of people jumped onto its bandwagon. And they jumped like mad. The uptake of Java was incredibly and (again, imo) unnaturally fast given its early state. The anti-MS sentiment was particularly strong in academia, which also helped in Java's adoption in universities.

share|improve this answer
    
I love this answer! –  cmorse Sep 16 '13 at 19:14

When I was in School (circa 1993) all Engineers learned Fortran and CS Majors learned C and Assembler until Junior year when they migrated to C++. This was at a top Engineering School and from what I can tell with new hires just out of school, allot still teach in a similar manner.

The only problem with this is that a new CS grad from an old school school has very little knowledge of current technologies like C#, etc... However, they do understand the complete architecture of an x86 chip and are capable of making Othello in Assembler.

So I suspect teaching Java is to better prepare CS grads for work with line of business and web apps.

share|improve this answer
    
Sounds like where I went to school, only as a EE we got to use Pascal instead of Fortran. –  Bill Leeper Sep 15 '11 at 20:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.