Teaching Java in Introductory programming courses

I challenged him to tell me ONE single example of where Java is the most suited language. He could not. Instead he claimed Java was. .. UbiquitousMy opponent's source does not say Java can be developed over the internet. It cannot - in fact, his source specifically warns not to confuse the Java mantra with "write anywhere". Java requires a special plugin to be used in all web browsers, while Javascript is available by default. Moreover, Java can only be developed on platforms supporting Oracle's "Java Development Environment", of which there are around a dozen, all exclusively available from Oracle's website. SecureWorth noting that Javascript has NEVER had to fix any security flaws in the language. Java has had several exploits in the past. Supported by more than just OracleEven IF this was to happen and Oracle was just kind enough to let Java go (not likely) it would end up like Free Pascal instead of Pascal. Face it, nobody uses either Pascal language nowadays, because why would you when you have languages like c++ and javascript which have NOT collapsed? At the very least Apple allowed others to develop their own Pascal compilers, unlike Oracle. FastThe test my opponent used for the speed of Java comes from a dubious forum post from over 2 years ago. Javascript speeds can change drastically in a week [3]. I also had my doubts in that the author tried to use Java code ported to Javascript to prove Java is faster, when native code would have run much faster. So I did my own testing. The program is simple - compute PI to 2000 decimal places. The Javascript test using the Machin Formula is freely available on the net [1]. Using V8 on my machine I get a time of 0.146secs. I then rewrote the code for Java [2] based on native code [4]. On my machine it executes in 0.17secs. So Java today is around 16% slower than Javascript. If you add in the additional time it took to compile the Java program, Java is about 100% slower than Javascript on my machine. And that's not to mention the extra time it took to run both programs from the command line (Java) versus clicking one simple button (Javascript). I should add that I can easily see several ways the Javascript code could be made even faster. The code was clearly designed to be understandable, not to be as fast as possible. In any event, Java is conclusively NOT 200 times faster any more. Lacking in advanced featuresHaving beginner students not feel that they've learnt everything is good because they know what they still have to learn. My opponent agrees the initial learning curve is steeper. Not dynamically typedThis makes it easier to debug if there is a profiler available that can tell students about what their variables are up to, and tells them which variables were responsible for the error. It makes debugging faster as it ignores the compile step, and the program does not need to be compiled by Java with a profiler, which is good because Java's profiler is INCREDIBLY slow. Getting students into the habit of using a profiler early also helps them track memory leaks as they become more advanced. The "false sense of security" argument only works if there was something to give that security in the first place - since there is no compile step, no security is given. Mind you, a Javascript programmer need not search far for errors, as Javascript's automatic error reporting will always catch them. No logical test cases need to be done since most Javascript profilers do this automatically (ie V8, SpiderMonkey), basically telling the programmer exactly how to fix their code as well. Not weakly typedThis only leads to errors if programmers are not careful with typing. Incidentally, the SAME ERRORS OCCUR with strongly typed languages like Java. Javascript simply makes it easier to convert types by building in weak typing as a language feature. No first class functionsFunarg problems only occur in languages without closures. See his own source #11 for that. Since Javascript supports closures this is an extremely important OOP concept, and first class functions are necessary. Not only that, they are very useful too - for example, pointers to functions are what allow multithreading to happen, which is way easier in javascript than java. Has a large standard libraryHaving a smaller standard library is actually good, because having a big standard library confuses and overwhelms beginners. For students to write their own methods for some of the more complicated things, at least in earlier courses, can be valuable learning in the same way that having kids to their own experiments in high school science classes is valuable learning. Better PolymorphismJavascript's polymorphism is different, not better or worse. The "more recently defined" function statement in Javascript can act very differently with different parameters because the arguments array of any given function is always dynamic in javascript, so (this is confusing for those who don't know Javascript) a single function statement can define multiple functions. The meaning of a method can also be changed by the object that invokes it using the special "this" object in Javascript. No Global ScopeMy opponent's whole argument here is that OOP languages have encapsulation. Given that javascript does too, I'm not sure why this proves all code must be contained in a class. While programs themselves can be represented as classes, the explicit declaration thereof in every single program is completely and entirely un-necessary for the compiler to be able to build the code. Proof: Javascript does it. Why Javascript is, in fact, betterIn 40 years time, what languages will still be in use? Will it be a closed, proprietary language by a single developer with basically the bare minimum of functionality for OOP, which takes forever to learn (not that there's even that much you can do with it) and isn't really suitable for any application. Or will it be a modern, expressive and evolving language based on advanced principles, but easy to pick up? A language that is free of strange syntactical mannerisms, secure, easy to debug by simply watching what your code does and having any errors highlighted for you as they happen - and allowing you to fix them as they happen without having to start over again? It's about what would the most enriching and useful learning experience be, the most useable for students who perhaps aren't even studying the subject and are doing the introductory paper as some sort of general education requirement. I think only one language in this debate fits the bill. The resolution is negated. Sources9 - . http://www.trans4mind.com...10 - . http://www.filedropper.com...11 - . http://arewefastyet.com...12 - . http://en.literateprograms.org...'s_formula_(Java)