Ode to Implicitly Declared Classes & Instance Main Methods plus Module Import Declarations
Kenneth Fogel
kfogel at dawsoncollege.qc.ca
Tue Nov 19 16:49:36 UTC 2024
For me, as a retired educator, Implicitly Declared Classes and Instance Main Methods along with Module Import Declarations simplifies teaching and learning Java. As someone who has taught Java to beginners for almost 25 years (BASIC, Pascal, C, & C++ previously) I can say without hesitation that Java has been hard to learn. My opinions on teaching Java to students at any age, turns out I’m old, has changed significantly over the past few years.
When I started teaching my focus in the classroom was to train my students to thoroughly understand the syntax of the language and then apply that syntax to problem solving. I have come to the realization that this was likely the wrong approach, far too late in my career.
What is important is problem solving and the organization of the solution. Syntax is secondary. In my Intro to Java course I found that the decorations of Java OOP programming got in the way of problem solving. If I am working on the very simple problem of writing a program that can make change (x pennies, y quarters, z dollars, etc), I do not want to also tell my students to include the decorations. Just solve the problem and fall in love with the mod operator. From my limited perspective the evilest expression in Java is System.out.println (confusingly this does not require an import).
This is not to say that the proper construction of classes and employing access control will be ignored but it should not be a large part of the first few classes in an intro course.
The capability of Java is, in my opinion, unparalleled due to the bureaucracy (in this case a good thing) that ensures that every JSR and JEP enhances the language. The JEPs (I am confused by the numbering so I used the titles in my first sentence above)) have been well thought out (well maybe it could use a readNum 😊). I look forward to starting my upcoming online Intro to Java course, I am allowed to teach one course a year at Concordia University even though I am retired, where I can teach problem solving and basic data structures with minimal overhead, hence my love of module java.base implicit import. By the end of my 30-hour online course my students will have learned how to create classes and understand what public, private, and protected mean and the role of static elements, just not on day one anymore.
One last point, with these JEPs plus Launch Multi-File Source-Code Programs I believe I can also start teaching with just a text editor and a terminal/console and leave the IDE for later in the course.
Ken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20241119/38405a37/attachment-0001.htm>
More information about the amber-dev
mailing list