Live data from Hacker News

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

beginwithjava.blogspot.com

61–70 of 108 posts

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

#61
post #44
post #26

Earlier quoted context omitted.

Most of my work these days is Java too, fwiw. But only because I need Lucene and Hadoop ;-) 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…

I'm personally mad at Doug Cutting for perpetuating Java. Java is a virus. If Lucene and Hadoop were written in C/C++ you'd be able to easily use them from basically any language. Because they're written in Java, it forces the rest of your code to live in Java land as well.

Think of it from his point of view: if you've already got a large chunk of code and working systems in Java-land that you want to strap a text indexer to, what language would you pick?

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

#62
post #44

Earlier quoted context omitted.

I'm personally mad at Doug Cutting for perpetuating Java. Java is a virus. If Lucene and Hadoop were written in C/C++ you'd be able to easily use them from basically any language. Because they're written in Java, it forces the rest of your code to live in Java land as well.

there is a C++ port of Lucene (named CLucene iirc) Not sure if there is such thing for Hadoop though.

Yeah, but because it's not the main project, the CLucene port is perpetually the red-headed stepchild. It runs several versions behind the Lucene trunk, and therefore, you have to choose to ignore its disadvantages.

...which is a shame, because I agree with the OP that the choice of Java was a mistake for a large, high-performance system.

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

#64
post #15
post #9

Earlier 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.

> which would take any kid hours

> Your "argument" if you can call it that

From Hacker News guidelines ( http://ycombinator.com/newsguidelines.html):

"Be civil. Don't say things you wouldn't say in a face to face conversation. When disagreeing, please reply to the argument instead of calling names."

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

#66

Earlier quoted context omitted.

You forgot the class: 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:…

But you don't actually need the main: class a{static{System.out.println("Hello world");System.exit(0);}}

I'm not sure that's any better. The static block is rarely used in Java, so I think you'd probably be better off teaching them how to use main.

It also doesn't cut down much on the amount of boilerplate you need.

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

#67
You should always understand the programming language your platform of choice is built upon. That means Java if you are going to use the JVM in some way, just like it means C if you are going to develop native applications on Windows or Linux.

I have always been astonished at VB6 programmers which ignored what a Variant was, when they were using such datatype all the time.

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

#68
post #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?

Would you mind discussing your development setup? What editor(s) do you use? Other software that makes writing Java easier?

There are many opinions about this on the internet, but most of them are geared towards enterprise developers in large shops; not towards startups.

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

#69
post #5
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?

Java is part of the C family of languages, you can draw a pretty straight line between C++ and most of Java's features (or non-features, or lacks of features).

Many C programmers would argue that C++ does not belong to the C family of languages.

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

#70
post #27

Earlier quoted context omitted.

- It is just barely object oriented (and Alan Kay agrees with me on this). Checkout CLOS and the MOP or Smalltalk sometime for a good object system. - 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 larg…

- True; I was just considering the mainstream languages. Yes, if you include Smalltalk, LISP, I'm sure there are better alternatives to learn specific concepts. But Java is used a lot in practice, and looks a lot like other languages used in practice (C++, ObjC, C#, and friends), which in my experience makes students more enthusiastic. - I agree the "generics" are complex and overly verbose. They almost look like the…

> I think it helps for learning to specifically mention everything and be a bit repetitive.

That's right at the bottom level of the Dreyfus model of skills acquisition. One may be able to draw inference from this to the apparent profusion of useless Java coders, but that's further than I'd really want to go. Once you've stepped off that bottom rung, however, it's all noise and just gets in the way.

Post reply on HN