It's perfectly fine to use Java for this kind of software. The hate against Java comes from using Java for application development: this is largely due to the kinds of applications that are typically written in Java (line of business software) and (this is the most important reason) accidental complexity and low quality of APIs like Spring or J2EE. Recipe for programming happyness is to use the right tool for the job…
Ask HN: Why not Java?
61–70 of 112 posts
Re: Ask HN: Why not Java?
#62It's perfectly fine to use Java for this kind of software. The hate against Java comes from using Java for application development: this is largely due to the kinds of applications that are typically written in Java (line of business software) and (this is the most important reason) accidental complexity and low quality of APIs like Spring or J2EE. Recipe for programming happyness is to use the right tool for the job…
Yes, but you can use Java (or Scala) where C++ was mentioned.
Re: Ask HN: Why not Java?
#63It's perfectly fine to use Java for this kind of software. The hate against Java comes from using Java for application development: this is largely due to the kinds of applications that are typically written in Java (line of business software) and (this is the most important reason) accidental complexity and low quality of APIs like Spring or J2EE. Recipe for programming happyness is to use the right tool for the job…
I wish HN had the ability to pin posts. This is great. Absolutely what I was going to write, so naturally I think it is brilliant ;) The right tool for the job. Java has it's place and it just where strlen said it should be.
Re: Ask HN: Why not Java?
#64Re: Ask HN: Why not Java?
#65Earlier quoted context omitted.
The two areas that most frequently annoy me are processing collections and (lack of) first-class functions. Java: List firstNames = new ArrayList (); for(Person p : people) { firstNames.add(p.getFirstName()); } addCallback(new Runnable() { public void run() { doSomething(); } }); Python: first_names = [p.first_name for p in people] add_callback(do_something) Scala: val firstNames = people.map((p) => p.firstName); add…
This is, because you can't Java. How you will find out, where you use first_names = [p.first_name for p in people] ? More verbose, but right way in Java is like (you can do this better with enums and/or guava, it's just example): class PersonTransformer implements Transformer { public Object transform(Object o) { return ((Person)o).getFirstName(); } } and then: Collection firstNames = CollectionUtils.collect(people,…
A couple days back I commented Java, by making some things harder than needed, induces programmers to over-engineer and build things for needs they don't have and to think that's perfectly normal. Think about what you just wrote.
Re: Ask HN: Why not Java?
#66Unless you're building something that needs to be (1) highly dynamic (like a web-based spreadsheet where you don't know the column types til run-time, or (2) true real-time software, you're probably better off using java. Some libraries do suck as others wrote, but it's the volume of good libraries you care about. In any case, I'd argue that in many alternate languages, the code you're writing so quickly doesn't need to be written at all in java, because there's a library for it.
Verboseness is a fact in Java, but a decent IDE shields you from that as well. With Java it takes a little longer to get things done, but (in my experience) you spend less time trying on performance, fixing problems in the underlying tools or language, or just dealing with your own bugs and keeping things running. Since most development is maintenance, you want to optimize for that.
Re: Ask HN: Why not Java?
#67Earlier quoted context omitted.
Can you give us some evidence why Spring is "unequivocal and absolute garbage"?
Well, for starters the whole idea of programming in XML. That and gems such as http://static.springsource.org/spring/docs/2.5.x/api/org/spr... or http://static.springsource.org/spring/docs/2.5.x/api/org/spr... Of course I can't a priori prove that Spring is garbage, much like I can't a priori prove that it's better to be healthy and rich than to be poor and sick. It is a judgement call, but a judgement call that I be…
Re: Ask HN: Why not Java?
#68I am curious about what, specifically, you find easier to do in Java syntax than Python syntax. Seriously, there is a fairly direct translation from any Java you might want to write to completely equivalent Python. Sure, Python offers more complex techniques such as list comprehensions and iterators. But you don't need to use them. You can just write Java-like Python.
Interfaces.
Re: Ask HN: Why not Java?
#69In my experience many Java programmers don't really "program" Java. They are more like "expert Eclipse users" and Eclipse happens to output Java. This style of development makes heavy use of wizards and those Eclipse refactoring tools. This probably is a consequence of the verbosity of Java-the-language, which made heavy tooling support a necessity. And then Eclipse, which provides one of the tightest language integr…
Re: Ask HN: Why not Java?
#70Earlier quoted context omitted.
The two areas that most frequently annoy me are processing collections and (lack of) first-class functions. Java: List firstNames = new ArrayList (); for(Person p : people) { firstNames.add(p.getFirstName()); } addCallback(new Runnable() { public void run() { doSomething(); } }); Python: first_names = [p.first_name for p in people] add_callback(do_something) Scala: val firstNames = people.map((p) => p.firstName); add…
This is, because you can't Java. How you will find out, where you use first_names = [p.first_name for p in people] ? More verbose, but right way in Java is like (you can do this better with enums and/or guava, it's just example): class PersonTransformer implements Transformer { public Object transform(Object o) { return ((Person)o).getFirstName(); } } and then: Collection firstNames = CollectionUtils.collect(people,…