Should Python Overthrow the Java Tyrant in APCS?
Traditionally in Keystone and in other schools, AP Computer Science (APCS) has been taught in Java, an extremely verbose language based in Object-Oriented Programming. Despite Java’s popularity, as a programmer who knows Java as well as other languages, I believe that APCS students would benefit more from Python than Java.
First, what exactly makes programming language different from each other? Both Java and Python are considered high-level languages, or are more reader-friendly than computer-friendly. (Through a process called compiling or interpreting, the reader-friendly content turns into computer-friendly content.) Python is almost English; it is considered to be one of the easiest programming languages to learn. Java, on the other hand, is verbose with a rigid structure. In Python, one can write in functional programming as well as object-oriented, whereas Java only uses object-oriented. Finally, Java is typically faster than Python. I believe that every language has different uses, and the uses of Python generally outweigh those of Java for learning and applications.
The fundamental objective of APCS is to learn the basics of computer science. For many people taking the class, it’s their first time programming and a language like Java can be intimidating, as it has a lot of foreign words. Typically, in the first few weeks of APCS, students can’t create their own program by scratch, as the headers with a lot of words that are not easily explainable. Python, by contrast, is an easier introduction to APCS and can teach students the basics with students understanding every line of code. The language is a beginner-friendly language (which is the entire point of APCS—an introduction to CS!) Even for the simple task of printing the word “hello,” Python proves to be simpler and more concise:
Python:
print(“hello”)
Java:
public class Hello {
public static void main(String[] args) {
System.out.println(“hello”);
}
}
In terms of practical uses, Java is used primarily in Minecraft, Android Studios (creating Android applications), and in APCS. Java can also be found on some websites, though many websites are transitioning to JavaScript (a language completely different from Java) due to Java’s security issues. Java has its uses, yes, and due to its past popularity, it will most likely stay in our system for quite some time before being completely erased. However, Java is the language of the past, and APCS should be able to adapt to the changing times. Python, in contrast to Java, is used more for research and industry. Python is known for its application in Machine Learning, Deep Learning, and Data Science, and it’s even making its way into Quantum Computing. Python is the language of the future, and it is critical that students are exposed and can understand the upcoming technology. In addition, Python is a popular choice for game development, through mediums such as PyGames. Recently, in a Stack Overflow survey, Python beat Java as the most popular language.
Of course, to make this change from Java to Python, one must look at precedents. I’m not the only one supportive of Python: in other high schools, the Computer Science III students learn how to program in Python, learning important skills such as web scraping and deep learning. AP Computer Science Principles is taught in Python. In addition, most universities will offer classes in Python if one wishes to pursue a career in Computer Science. APCS has transitioned between languages in the past: at first, it was taught Pascal (1984-1998), then in C++ (1999-2003), and, currently, in Java since 2004. If APCS has changed to reflect the current trends in languages, then APCS should transition to Python.
Though Java will be staying in its popularity, the needs of the future seem to be pointing towards Python. It’s an easy language to learn which can then spiral into many uses in research and industry. Python code is known to be short and elegant, a trend in programming today. Since APCS switched from C++/Pascal to Java to reflect the trends in programming languages, I hope that APCS will soon switch to Python, a language skyrocketing in popularity and promising a plethora of jobs in the future.
Shreya Chaudhary is a senior planning to major in data science or computer science. She interns with TigerGraph, promotes and tutors women in STEM through...
Jim • May 27, 2021 at 1:26 pm
Java has a way more natural structure then Python. There is no need for Python. I took a quick intro to Python and I asked the instructor what can python do that java cannot. The response was that Python has dictionaries. Lol. Well so does Java, they are called Maps. You example of print Hello is misleading since you are printing that from the Python Shell. Java has IDEs that can do the same thing but there is no great need for a shell, The important thing about learning computer science is to understand what goes on behind the scenes. I think that it is a shame that you are promoting a loosely typed language in Python. So, some people got into a python and developed some deep learning programs. I am teaching Python now and I cannot understand that someone with your experience is promoting Python.
By the way , Python is not taught in AP Computer Science Principles. a generic language is used which is probably closer to Quick Basic
Have a great day
Roy • Dec 14, 2021 at 12:27 pm
Jim, if there was no need for Python it wouldn’t exist. If there were other options for programming languages we could reach more students. Why close the door? Python is far easier to learn and teach. I have students who are largely underrepresented in downtown SF who never thought they could code. They are building beautiful programs in Python, but if I had to start with OOP, they would never have tried. In my school district (SFUSD), we have access to only one approved IDE, and it cannot make Java easy to use and understand. I’m not sure what your purpose is in proposing that your way is the only way.