So let me say first that Java was my first language, and I don't believe I've been corrupted in any nasty ways.
I was 10 when I learned Java, and it always threw me off having to copy those first two magic lines which I never understood. What is 'public class'? Why 'static'? What even does the word 'void' mean? 'String[]'?!
Sure, after a few months I figured out the meaning of all of those words -- but it wasn't nice having to do that "open up last file I wrote / copy magic header to new file".
I don't think it's wrong to teach Java as a first language, but I think that there are better first languages which show what real computer science is faster than Java does. Less coercion of a language to do what you want and more free-flowing ideas.
First off, even removing line breaks it is still verbose. I can't think of another language that's even close. Even C++ would give you a shorter version.
Far more important though is how much stuff is in that one line of code that needs to be understood in order for what you are typing to be more than just arcane magic words. Pedagogically speaking that is an awful way to get started, so I think the claim that that is not a great way to teach kids is pretty valid.
To be fair I fully agree that 'Hello world' is not a good way to assess the worth of a language in general, but the ease of getting started is a valid concern when using a language to introduce programming
class M { public static void main(String[] a) { System.out.println("Hello World"); } }
The problem with using this as learning material is that the teacher has to treat the majority of the code as "magic" until the student is ready to learn about classes, access permissions, methods, arrays, namespaces, types and so forth.
In many other languages, there's much less boilerplate to handwave away:
Your example illustrates one of the main problems with verbose languages. Imagine showing this line of code to a child! I think anyone new to programming would be completely baffled. Before they could understand even the "simplest" Java program they have to know what is meant by public, static, void, main, String, arrays and more...
"And that startup time of JVM is orders of magnitude worse than pretty much anything else."
Sure, let's throw out of the window all the optimizations the VM can do at runtime because it takes a whole second to start the VM.
And you need to actually compile the source file before executing it!
Those server applications should all be written in bash because it's instantaneous!
Kidding aside, one prof at my university once told me that she wished students should still have to compile and wait for a program to start. When there is such a delay, it pays to read your code and try to understand it before running it (as opposed to run-and-see-what-happens).
> And that startup time of JVM is orders of magnitude worse than pretty much anything else.
This one never ceases to annoy me.
The JVM is optimized for LONGRUNNINGPROCESSES. It's targeted specifically toward running on servers, because that's the default use case. There's about a million options switches, gc controls, etc if you want to run it in another way.
If you want fast startup time, try compiling with gcj or something.
In any event, I run a javac->java loop many times an hour when developing, and the startup time is un-noticable.
Yes, I think what you allude to is that Java is just too verbose and unnecessarily complex and I agree. That said, the tools available for Java (i.e. eclipse) are pretty nice.
My kids will get the full C drill. Basically the same way I learned programming.
Training wheels are only necessary if you could hurt yourself by practicing. Where there is no such a danger there is no reason not to start with the "hard" stuff. It's like learning guitar or piano - you don't have a practicing instrument with only two strings/5 keys that always sounds good and forgives errors.