{"id":17,"date":"2006-07-25T12:08:05","date_gmt":"2006-07-25T11:08:05","guid":{"rendered":"http:\/\/www.bluej.org\/mrt\/?p=11"},"modified":"2020-05-15T15:46:30","modified_gmt":"2020-05-15T15:46:30","slug":"is-java-on-the-way-out-of-teaching-anyway","status":"publish","type":"post","link":"https:\/\/blogs.kcl.ac.uk\/proged\/2006\/07\/25\/is-java-on-the-way-out-of-teaching-anyway\/","title":{"rendered":"Is Java on the way out (of teaching, anyway)?"},"content":{"rendered":"<p>Java has undoubtedly been the most popular language of the last decade.<\/p>\n<p>It has taken over large parts of the educational and professional sector. It is its use as a language for programming teaching that I want to talk about today.<\/p>\n<p>Java has been dominating introductory programming teaching at universities for years now. But is it time to throw it out?<\/p>\n<p><!--more--><br \/>\nNot since the days of Pascal was there such a universal agreement about the programming language of choice for the introductory programming course. I don&#8217;t have real numbers, but a guess that 80% of introductory courses use Java may be in the right ballpark.<\/p>\n<p>Currently, there are no real signs of this dominance being broken, but I think change has to come one day.<\/p>\n<p>In 1995, when Java was first published, it presented a substantial and clear improvement over the state of the art of languages used for programming teaching in that day. People were happy. Happy to see such a nice, small, well-designed language that could be used for a wide variety of tasks.<\/p>\n<p>A large part of this happiness resulted from the fact that many people were teaching C++. And C++, let&#8217;s face it, is about as bad as you can get for teaching beginners to understand object orientation. And when you&#8217;re in the dark, any little spark seems bright.<\/p>\n<p>Java really was a nicely designed language. It was (for what it wanted to achieve) small, clean and elegant. It really had the feel of a single designer who had clear goals in mind. James Gosling got a lot of things right.<\/p>\n<p>And then the committees got their hands on it. In the latest Java releases, the design changes really smell of design by committee. Look at the design of generics in Java, for example.<\/p>\n<p>In the original design a principle seems to have been to make common things simple, and to accept that some less frequent tasks may require more coding or compromises. This managed to keep the language design clean. There are many examples where explicit support for certain specialised tasks has not been included in the language so that the design could remain clear.<\/p>\n<p>When we look at genericity in Java, that feeling is not there anymore. It now feels like they tried to put support for anything into the language that anyone may ever possibly want to do. The inclusion of wildcards, bounded wildcards, generic methods, and all their combinations, together with the re-writing of the standard class libraries, makes some things so complicated that the feel of simplicity as a design goal evaporates.<\/p>\n<p>How many people, for example, can confidently explain the difference between<\/p>\n<blockquote><p><span style=\"font-family:monospace\">public void m(Collection a);<br \/>\n<\/span><\/p><\/blockquote>\n<p>and<\/p>\n<blockquote><p><span style=\"font-family:monospace\">public  void m(Collection a);<br \/>\n<\/span><\/p><\/blockquote>\n<p>And I&#8217;m not talking about students \u2013 I mean the teachers!<\/p>\n<p>Or look at the standard class library: How many introductory programming teachers can really explain why the signature of the standard <em>Class<\/em> class is<\/p>\n<blockquote><p><span style=\"font-family:monospace\">class Class<\/span><\/p><\/blockquote>\n<p>Then look at its first method:<\/p>\n<blockquote><p><span style=\"text-decoration: underline\"> Class asSubclass(Class<span style=\"text-decoration: underline\"> clazz)<\/span><\/span><\/p>\n<p><span style=\"text-decoration: underline\"><\/span><\/p><\/blockquote>\n<p><span style=\"text-decoration: underline\"><span style=\"text-decoration: underline\">I don&#8217;t know about you, but that&#8217;s not something I really usually explain to my first year students. Now, I know perfectly well that there are reasons for this design. And I do understand the semantics of these definitions \u2013 I am not saying that you can&#8217;t.<\/p>\n<p>What I am saying is this: Recent changes in the Java language have made it significantly more complicated for beginners to understand the language. This includes not only generics, but also auto-boxing, the for-each loop, and just about any other change they have done to the language. And it does not stop there. The trend looks to continue unchanged in Java 7, with various changed being currently under discussion (such as method references, new parameter types, and various other things).<\/p>\n<p>These changes all make it easier to write Java programs <em>if you already know what you&#8217;re doing<\/em>, but actually make it harder to learn initially. The reason is that just about none of the new concepts completely replaces an old concept. We now have to introduce the for-each loop, but we still have to teach iterators as well. We have to teach auto boxing, but we also have to teach the wrapper classes, since understanding the exact semantics of auto-boxing is crucial to the understanding of Java&#8217;s object model. And so on.<\/p>\n<p>Every one of the language changes, which saves a programmer to type a few characters, puts another concept on the large pile of concepts to be taught in finite time in a first year programming course. It doesn&#8217;t make it easier, it makes it harder.<\/p>\n<p>One strategy could be to ignore the new concepts. Teach a subset using the concepts of your choice. Only you can&#8217;t, because you will run into the libraries. If you were to decide, for instance, not to teach generics, your students will still run into the javadoc including generics in the standard libraries.<\/p>\n<p>What is actually happening here is the re-emegence of the eternal conflict between learning and professional development. Changes that make the language more convenient for professionals make it less suitable for initial teaching.<\/p>\n<p>Maybe it is time for a new teaching language&#8230;<\/p>\n<p><\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Why is Java becoming lass suitable for teaching. Some observations. <a href=\"https:\/\/blogs.kcl.ac.uk\/proged\/2006\/07\/25\/is-java-on-the-way-out-of-teaching-anyway\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":179,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,13],"tags":[63,107],"class_list":["post-17","post","type-post","status-publish","format-standard","hentry","category-java","category-teaching","tag-java","tag-teaching"],"_links":{"self":[{"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/posts\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/users\/179"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/comments?post=17"}],"version-history":[{"count":1,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/posts\/17\/revisions"}],"predecessor-version":[{"id":1071,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/posts\/17\/revisions\/1071"}],"wp:attachment":[{"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/media?parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/categories?post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.kcl.ac.uk\/proged\/wp-json\/wp\/v2\/tags?post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}