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.
"Should I still learn Java?" Answered: Yes.
61–70 of 108 posts
Re: "Should I still learn Java?" Answered: Yes.
#62Earlier 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.
...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.
#63Might be worth checking out Kenya (a subset of Java for beginners, comes with a nice IDE) http://www.doc.ic.ac.uk/kenya/
Re: "Should I still learn Java?" Answered: Yes.
#64Earlier 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.
> 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.
#65It's nice to see a positive java posting on HN for a change!
Re: "Should I still learn Java?" Answered: Yes.
#66Earlier 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);}}
It also doesn't cut down much on the amount of boilerplate you need.
Re: "Should I still learn Java?" Answered: Yes.
#67I 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.
#68As 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?
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.
#69Earlier 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).
Re: "Should I still learn Java?" Answered: Yes.
#70Earlier 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…
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.