The Case For Replacing Java With Python In Education
Around 2003 all of the colleges and high schools in the United States switched from teaching Computer Science courses in C++ to teaching them in Java. The intention was to make it easier for students to pick up programming. Schools were finding that many students were struggling to cope with low level tasks in C++ like manual memory management and pointer references. Instead of learning algorithms, data structures and object oriented programming, students were stuck for hours trying to track down incorrect pointer references.
About four years after the education system made the switch to Java from C++, the whole software industry started complaining about the degrading quality of the Computer Science graduates in the US; which is a topic I explored recently. Ultimately, schools have made the switch away from C++, and they are unlikely to go back, nor do I think they should. Instead, what I want to discuss is why did we have to replace C++ with Java? I can see that at the time, it may have seemed the obvious choice, but looking around the language landscape now there are several choices that I think are better suited for the task. Namely, Python.
Java > Python How???
First, I want to really think about what advantage does learning programming with Java have over using a modern scripting language like Python? Python equally hides the things that make programming in C++ laborious and has many of the nice features that the JVM provides like garbage collection, unicode strings, and threads. The difference is Java is miserable for web programming (Java EE) and equally overly complex for building GUIs (Swing). As a scripting language, Python is far easier to pick and learn.
What CS students would lose from switching from Java to Python
- Static Typing – The difference between an Integer and a Float is harder to understand when you do not have to declare variable types.
- Compilation – In my opinion this is not a big deal. They are still going to learn how to debug runtime errors which is where the substance is. Advanced IDEs like Eclipse are making dealing with compiler errors almost a thing of the past in Java. Additionally, the upper division compilers class will still be there to teach them the ins and outs of compilers.
- Performance – This is a moot point. I only put it down because it is what most people think of first but very rarely do the projects assigned in a classroom require serious computation. I would also wager that even the ones that do can be solved in a satisfactory manor with Python. If anything it will force students to be more creative about their solutions instead of just relying on brute force.
What CS students will gain from switching from Java to Python
- Dynamic Typing – There are tradeoffs to both approaches but as nearly everyone who programs dynamically typed language for a while finds out that the type safety provided by static typing is unnecessary and more often gets in your way than it helps you (ex. Casting).
- Interpretation – Becoming familiar with interpretation is just as important as compilation. Interpretation opens several doors for you when programming and is becoming more common. In addition it gives you helpful tools like an interactive console.
Overall, there is no big loss in Computer Science concepts when moving from Java to Python like there was when we moved away from C++. You trade static typing for dynamic typing and compilation for interpretation but everything else is just about the same and you gain Python’s simplicity.
One of the real problems with Java is that many students do not like to use it when programming for fun. Since the majority of students only become competent in Java, they only code they write is for their homework assignments. These are type A CS students. There is a second, type B, group of CS students. Type B students pick up another language like PHP, Python, Ruby, Clojure, etc. and are ones who spend time coding and creating cool things outside of their schoolwork. These students find programming on the side to be the most enriching and also the most educational. Employers often cite type B students, the self starters, as the ones they are most interested in hiring. If the only programming a student does while attending school is for their class projects, it is more than likely that they will continue this practice once leaving school, only writing code for their job. By making the switch away from Java in education, more type B CS students would emerge from American universities; enormously benefiting the software industry.
My ICS Video Profile
The communications/media team within the Bren School of Information and Computer Sciences put together this great video that showcases how my education at UC Irvine has benefited me. It features the hITEC product development competition, my involvement in student government, and my internship at TechCrunch. Props to Eric Kowalik and Bobby Farmer for doing an exceptional job with the video.
The UCI Study Center Shuffle
Roughly every 5 weeks I enter into a period of my life that I don’t like to talk about very much. That is, midterm and final week. Several big, grade dominating, exams within a period of one week means that I am going to be spending a lot of nights in the library. And by nights, I mean the whole night. Usually something like 9pm-6am.
After three years of hellish finals weeks I’ve developed what I call, the UCI Study Center Shuffle. The Study Center Shuffle came about because UCI has a variety of study centers and libraries of varying quality and with differing hours. I like to spend my time at the most pleasant, and best equipped, study centers. However, the best ones close the earliest. Forcing me to migrate from study center to study center.
The following is my typical Study Center Shuffle and my thought process behind it.
Science Library: 9pm-11pm
The UCI Science Library is a wonderful building. It’s a outstanding 50 million dollar, six story library but all the students really just use it as a glorified study center because 1) libraries aren’t very useful anymore and 2) it’s a really nice building. Alas, it closes early at 11pm. There is a small study center on the first floor that is open till 2am but I do not like going in there because it is too cramped and often full. At 11pm I pack up and walk a third of the way around Ring Road to the Engineering Gateway.
Engineering Gateway: 11pm-2am
The Engineering Gateway is a great study center. The students in there always seem really dedicated and I’m regularly been able to get serious about studying in there. There are lots of computers to use which is nice and for some reason not too distracting when I do need to use one. Probably because they are not my distraction prone Macbook. Normally the Engineering Gateway is open 24 hours, however, on Tuesday’s and Saturday’s the Engineering Gateway closes from 2-4am forcing me to vacate the premises.
Gateway Study Center: 2am-whenever
If the Engineering Gateway is closed the only option left on campus is the dreaded Gateway Study Center. It is another third of the way around Ring Road to get to Gateway Study Center from Engineering Gateway, a calm, yet eerie walk at 2am. Gateway is my last choice because it is generally the nosiest of the study centers, impossible to find an electrical outlet for my laptop, and the desktop computers setup there are beyond obsolete. In short, Gateway is the study center ghetto at UCI. The only benefit is that it is the closest to food that does not come out of a vending machine, which at this time is only Jack In The Box but its better than nothing.
After a solid night of studying, I now have to walk back to my car which is probably parked no where near the Gateway Study Center forcing another middle of the night hike.
UPDATE (02/03/09): Not long after I wrote this post, the Gateway Study Center underwent a complete renovation. They replaced everything. The desks, chairs, computers, carpet, and even electrical outlets were upgraded. I can now say it is a comfortable place to study. Sadly, it is still very crowded.
