Save over 40% when you secure your tickets today to TNW Conference 💥 Prices will increase on November 22 →

This article was published on April 24, 2017

Universities finally realize that Java is a bad introductory programming language


Universities finally realize that Java is a bad introductory programming language

CS 106A is Stanford University’s introductory programming course. The module – which is also available to view on YouTube – introduces the fundamentals of coding in an accessible way, and lays the foundations for future growth.

Throughout its existence, the course was taught using the Java programing language. Java is popular, certainly, but it’s also extremely clunky and syntactically bloated.

But a new version of the course, CS 106J is based on JavaScript.

According to the University website, “[CS 106J] covers the same material as CS 106A but does so using JavaScript, the most common language for implementing interactive web pages, instead of Java.”

The decision to ditch Java is a laudable one. While there’s a lot to like about it, Java is perhaps the harshest language you can learn as a beginner. In fact, in this respect, it’s straight-up awful.

Let’s just take a look at perhaps the first Java program you’ll write, hello world.

class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}

Put yourselves in the shoes someone learning to code for the very first time. There’s a lot of scary shit here.

“What does ‘class’ mean? And what does ‘public static void’ do? Am I supposed to know what this all means? Programing is harder than I thought!”

This is all stuff I’ve seen first hand. When I studied for a Computing degree, I had several classmates who were studying for a combined honors in Information Technology and teaching, and were completely put off by the bloat of Java.

Now, let’s compare that to the JavaScript equivalent.

alert('Hello, world!');

It’s a lot more digestible, isn’t it? Just by looking it, you can figure out what it does, even if you’ve never written a line of code in your life.

You’re not immediately burdened with shit that, realistically, should come into play after your first lesson. Things like static typing, functions, and object oriented programming.

Because, here’s the thing. Programming is fun – or at least, it should be. It shouldn’t be scary, but rather a fundamentally creative endeavor that can lead to an amazing career.

By teaching Java, you risk associating programming with something tedious and difficult in the minds of beginners, and run the risk of them switching to something less arduous.

I’d actually be really interested in finding out how the switch to JavaScript influences student retention. Obviously, with the course only being a few weeks old, it’s too early to tell.

But one thing is clear. Although Java thrives in the real world, it’s dying as an introductory programming language.

In 2005, Bernard Chalk, an academic at London South Bank University, and Karen Fraser, from the University of Ulster surveyed several higher education institutions on their choice of introductory programming language.

Almost 60 percent of institutions surveyed reported using Java as an introductory language. C++ trailed it, with nearly 10 percent of institutions using it. Only three percent of institutions used Python.

But things are changing. Java is no longer the introductory language of choice.

According to research published by Philip Guo on the ACM (Association for Computing Machinery) website in 2014, Python is now the most popular language for teaching introductory computer science in the United States.

Eight of the top 10 U.S. computer science departments, and 27 of the top 39 (69 percent) use the language to teach the fundamentals of Computer Science.

Other languages that made the list include MATLAB, C and C++, Scheme, Scratch, and yes, Java.

Sad to say, bad ideas often die hard.

Get the TNW newsletter

Get the most important tech news in your inbox each week.