I can't say I disagree with the author. Even with all its troubles, there's simply too much legacy Java code to abandon. Much like Cobol and Perl, there will always be a need for Java programmers to--at the very least--maintain existing code. If you're a complete newb, learning Java will also introduce you to the C-like family of languages. (Although I say everyone should learn C first in order to appreciate memory m…
> Much like Cobol and Perl, there will always be a need for Java programmers to--at the very least--maintain existing code. Sure, if your goal is to get a job maintaining mainframe systems in banks for the next 30 years Cobol or Java are very good ideas. On the other hand, there are already huge heaps of mediocre java programmers available for cheap, so it's not like the demand is that high.
"Should I still learn Java?" Answered: Yes.
21–30 of 108 posts
Re: "Should I still learn Java?" Answered: Yes.
#22Then there's the ton of libraries for everything and good tooling.
Of course, the language itself might be a bit too verbose for some people but I'd rather take Java and the JVM then another language where I'm missing some of this.
I guess most people don't differentiate Java the language from the Java Virtual Machine and that's a shame. I could be doing JRuby on the JVM and be happy then drop into Java for some optimized code. Thus, Java just happens to be the "C" programming language of the JVM.
Re: "Should I still learn Java?" Answered: Yes.
#23I can't say I disagree with the author. Even with all its troubles, there's simply too much legacy Java code to abandon. Much like Cobol and Perl, there will always be a need for Java programmers to--at the very least--maintain existing code. If you're a complete newb, learning Java will also introduce you to the C-like family of languages. (Although I say everyone should learn C first in order to appreciate memory m…
> learning Java will also introduce you to the C-like family of languages Aren't Java and C, different family of languages?
Re: "Should I still learn Java?" Answered: Yes.
#24As someone who rather dislikes Java, I'd still tell others to learn it (but certainly not as their first or even second language - it teaches too many bad habits). The main reason would simply be that a lot of interesting problems require tools/libs written in Java (Hadoop and family, Lucene, etc) if you want to get off the ground quickly and efficiently. Eventually, you're going to need to tweak your tools - so lear…
As someone who programs Java a fair bit, what bad habits do you believe it teaches?
- It has a pretty simple syntax, as it doesn't have too many strange or unintuitive language constructs.
- Its verboseness forces the learner to understand what is going on and be thankful for the magic that more dynamic languages provide.
- It's statically typed so it forces the learner to think about types.
- It's hard to shoot yourself in the foot with beginner mistakes like with C++/C. Still, it's a good preparation for learning C/C++ later.
- Clear compile-time and run-time error reporting.
And so on...
Re: "Should I still learn Java?" Answered: Yes.
#25Earlier quoted context omitted.
My kids, like their dad, won't have the patience to create a singleton main object, with a print method, just to run "print 'hello world'".
public static void main(String[] a) { System.out.println("Hello world");} Yeah you're right. That's an insane amount of typing which would take any kid hours. I had to muster up all of my patience just to type all that code out. You're right! Java is so verbose! Your "argument" if you can call it that, is like people saying lisp is crap because it uses too many brackets.
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.
Re: "Should I still learn Java?" Answered: Yes.
#26As someone who rather dislikes Java, I'd still tell others to learn it (but certainly not as their first or even second language - it teaches too many bad habits). The main reason would simply be that a lot of interesting problems require tools/libs written in Java (Hadoop and family, Lucene, etc) if you want to get off the ground quickly and efficiently. Eventually, you're going to need to tweak your tools - so lear…
As someone who programs Java a fair bit, what bad habits do you believe it teaches?
The main bad habit is a gross overuse of patterns to compensate for language stupidity (see: http://norvig.com/design-patterns/).
A few particular examples include:
- Too much global state. You call it a Singleton. I call it a global variable with a fancy name and a lot more code.
- You lose the ability to think functionally and dynamically. You can see the core of the architecture much more clearly if your default thought is 'I want to pass a function' or 'I want to call a fn based on rutime types.' And then you should convert that to what's implementable in language X (strategy pattern and visitor pattern, respectively for Java). Thay way you don't lose sight of the forest for the trees (and can implement what you're trying to do without cruft in a good language).
- Verbosity. It's bad enough that passing a small fn (1 line of code in a decent language), requires a separate class and 20 lines of code in Java. On top of that the type system is too weak to actually stop most interesting errors but just strong enough to be annoying. And for some idiotic reason, they won't even implement compile time type inference which would save lots of verbosity and maintain code/bytecode compatibility.
Re: "Should I still learn Java?" Answered: Yes.
#27Earlier quoted context omitted.
As someone who programs Java a fair bit, what bad habits do you believe it teaches?
I'd like to know as well. IMO, one of the few things Java is actually good for is to learn object oriented programming. - It has a pretty simple syntax, as it doesn't have too many strange or unintuitive language constructs. - Its verboseness forces the learner to understand what is going on and be thankful for the magic that more dynamic languages provide. - It's statically typed so it forces the learner to think ab…
- No. Java has a complex syntax. Take a look at the grammar sometime. It's 10s of times longer than Scheme's (see: http://java.sun.com/docs/books/jls/second_edition/html/synta...). You just like it because it's almost, kind of, a little, like C and C++.
- It is, in large part pointless verbosity. Explain to me how: Map>> data = new HashMap>>(); is useful. Explain how 20 lines for a strategy pattern or a visitor pattern is better than just having built in first order functions and multiple dispatch.
- The type system is abysmal (and not sound). Runtime Erasure of generic types? Casts? Nulls?
- I do agree it is better than C++ for most purposes though ;-)
Re: "Should I still learn Java?" Answered: Yes.
#28Earlier quoted context omitted.
My kids, like their dad, won't have the patience to create a singleton main object, with a print method, just to run "print 'hello world'".
public static void main(String[] a) { System.out.println("Hello world");} Yeah you're right. That's an insane amount of typing which would take any kid hours. I had to muster up all of my patience just to type all that code out. You're right! Java is so verbose! Your "argument" if you can call it that, is like people saying lisp is crap because it uses too many brackets.
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
Re: "Should I still learn Java?" Answered: Yes.
#29Start with Scheme. It doesn't even have proper objects and classes, so you'll be forced (guided, actually, if you go the SICP route) to implement them yourselves. This teaches you in an elegant way about essential concepts in programming, but manages to keep your head clear and unbiased about the many different ways to do things, whereas a language with a strong fundamental paradigm (i.e. Java) may bias you forever.
Then learn C. It couldn't be more different from Scheme, but that's a good thing. It forces you to think about things you thought you didn't reaaly have to think about - such as memory allocation.
With a solid basis in these two languages, you've covered just about every paradigm or building block of programming languages you can imagine. Learning another language then becomes trivial, and for bonus points, you'll be a lot better programmer at those languages too.