Home > Programming > The ‘Anti-Java’ Professor and the Jobless Programmers

The ‘Anti-Java’ Professor and the Jobless Programmers

James Maguire’s article raises some interesting questions as to why teaching Java to first year CS / IT students is a bad idea. The article mentions both Ada and Pascal – neither of which really “took off” outside of the States, with the former being used mainly by contractors of the US Dept. of Defense.

This is my own, personal, extension to the article – which I agree with – and why first year students should be taught C in first year. I’m biased though, I learned C as my first language and extensively use C or C++ in projects.

Java is a very high level language that has interesting features that make it easier for programmers. The two main points, that I like about Java, are libraries (although libraries exist for C / C++ ) and memory management.


Libraries are fantastic. They offer an API and abstract a metric fuck tonne of work that a programmer doesn’t care about. I don’t care how the library works inside, just that I have a way of putting in input and getting expected output (see my post on abstraction). I’ve extensively used libraries, even this week, for audio codec decoding. Libraries mean not reinventing the wheel and reusing code (something students are discouraged from doing, as it’s plagiarism, yet in the real world you are rewarded). Again, starting with C means that you appreciate the libraries more.

Memory Management

Managing your programs memory manually is a pain in the hole. We all know this after spending countless hours finding memory leaks in our programs. Java’s inbuilt memory management tool is great – it saves me from having to do it. However, if I had have learned Java first, I would assume (for a short amount of time) that all languages managed memory for you or that all languages were shite compared to Java because they don’t manage memory for you. Going from a “lesser” language like C to Java makes you appreciate the memory manager

What’s so great about C?

In the context of a first language to teach students, C is perfect. C is

  • Relatively simple
  • Procedural
  • Lacks OOP features, which confuse freshers
  • Low level
  • Fast
  • Imperative
  • Weakly typed
  • Easy to get bugs

Java is a complex language that will spoil a first year student. However, as noted, CS / IT courses need to keep student retention rates high. As an example, my first year class was about 60 people, final year was 8. There are ways to keep students, possibly with other, easier, languages in the second semester of first year – so that students don’t hate the subject when choosing the next years subject post exams.

Conversely, I could say that you should teach Java in first year and expand on more difficult languages like C or assembler (which should be taught side by side, in my mind) later down the line – keeping retention high in the initial years, and drilling down with each successive semester to more systems level programming.

There’s a time and place for Java, which I believe is third year or final year. This will keep Java fresh in the students mind while they are going job hunting after leaving the bosom of academia. This will give them a good head start, as most companies are Java houses in Ireland.

  • You left out a vital part of this – students in CS101 first year course, after learning java – will take the Garbage collector and managed memory (handled by java itself), for granted and expect that if and when the dose of reality hits home later on in their life in the workplace, expected to dive straight into C and C++, and not having a clue a lá “WTF, what is this pointer crap”, leaving the senior programmer deluged with “whines and requests for help/tutorials from them”…. I pity the poor foo!

  • Niall O’Connor

    C is not a good language to teach with. You may learn a bit about memory and memory management but in every other language pointers are hidden from you, so that skill is of not much use to you any more.

    Prolog, Lisp or Erlang are better suited to teach students how to mathematically describe a problem. It teaches you to solve problems using recursion and how to define the base case or end to a problem.

    After you have learned to accurately describe problems you should learn about patterns. Most problems have been well solved and in the process we have determined what pattern best solves it.

    After that you should turn your hand to learning a language because at this point you have the ability to describe a problem, come up with a solution and recognize a pattern. The code you begin to write will be a lot better structured than the gibberish graduates currently produce.

    In the context of a first language to teach students, C is probably the worst choice. C is probably the worst starting point to making a good software engineer. And I love C.

  • Ryan Hackett

    “C is not a good language to teach with. You may learn a bit about
    memory and memory management but in every other language pointers are
    hidden from you, so that skill is of not much use to you any more.”

    This attitude seems very much based on learning to program only to get paid. Call me naive, but what ever happened to the guys who are actually interested in how computers work, how computers are designed and how they’re programmed? It’s disappointing to see such shallow opinions.

  • Pingback: Java | INFOENERGY()

  • Pingback: Object oriented Programming, OOP. – Programming Objects, Structures; Control Microcontrollers and the Rest()