Live data from Hacker News

"Should I still learn Java?" Answered: Yes.

beginwithjava.blogspot.com

11–20 of 108 posts

Re: "Should I still learn Java?" Answered: Yes.

#11
post #4

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…

> learning Java will also introduce you to the C-like family of languages Aren't Java and C, different family of languages?

Although a Java translation of a C program still looks C-ish, I agree; idiomatic Java is very different from idiomatic C. (This is not surprising; Java is intended to be "C++ done right", and idiomatic C++ is rather different from idiomatic C.)

Re: "Should I still learn Java?" Answered: Yes.

#12
post #8
post #4

Earlier quoted context omitted.

> learning Java will also introduce you to the C-like family of languages Aren't Java and C, different family of languages?

The basic grammar and syntax are pretty much the same, as are most of the fundamental data types and their behaviors, and many other things. There are obviously a lot of differences, but if you know one language it usually isn't hard to read well-written code in the other language.

> as are most of the fundamental data types and their behaviors

Don't ever tell that any C-novice coming from Java. Or you will have fun with interesting array constructs or functions returning pointers to variables created on the stack, etc.

Re: "Should I still learn Java?" Answered: Yes.

#13
post #6

Completely agree. I'll be teaching my kids Java first, if they want to learn programming.

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.

Re: "Should I still learn Java?" Answered: Yes.

#14
Learning Java itself is simple. As a language it doesn't offer particularly anything that isn't already found in other languages, given you know other languages.

The biggest effort would be to learn the libraries and you basically can't do that unless you're regularly writing code that interfaces them. But that you can do from Clojure or Scala or whatever language that runs on JVM.

Re: "Should I still learn Java?" Answered: Yes.

#15
post #9
post #6

Completely agree. I'll be teaching my kids Java first, if they want to learn programming.

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.

Re: "Should I still learn Java?" Answered: Yes.

#16

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…

Java will certainly not teach you anything else from C but how to put statements in braces and a couple of constructs with similar syntax. And if someone thinks that is C, he doesn't know C.

Re: "Should I still learn Java?" Answered: Yes.

#17
post #9
post #6

Completely agree. I'll be teaching my kids Java first, if they want to learn programming.

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'".

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.

Re: "Should I still learn Java?" Answered: Yes.

#18
post #13
post #6

Completely agree. I'll be teaching my kids Java first, if they want to learn programming.

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.

I'd skip C and learn assembly personally.

Re: "Should I still learn Java?" Answered: Yes.

#19
My main problem with Java isn't the language itself. I think it's a pretty ok language as far as statically typed ones go.

My problem with Java is the way it's currently being used. E.g. using annotations to fix things that the language won't let you do elegantly.

There's a lot of horrible overengineering for relatively simple problems (you don't HAVE to use GOF patterns, they're just a suggestion for a solution. If you don't have the problem, don't use the solution!).

While there are a few nice libraries (e.g. http://jsoup.org/ ), even those usually don't have examples. Especially when you don't know the library yet, it's wonderful to get a few minimalist examples how to use it. Just compare:

Java: http://jsoup.org/

Ruby: https://github.com/hpricot/hpricot/wiki/ or http://nokogiri.org/

While both Ruby HTML parsers have a simple example right on the starting page, I have to make at least 6-7 targeted clicks for Jsoup.

The same even goes for the core libraries. Just look at Ruby's String class:

http://www.ruby-doc.org/core/classes/String.html

And then look at Java's String class: http://download.oracle.com/javase/6/docs/api/java/lang/Strin...

In Ruby, almost any method has a small example. The Java doc only has an example for the constructor...

Re: "Should I still learn Java?" Answered: Yes.

#20
post #10

As 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?
Post reply on HN