Live data from Hacker News

Ask HN: Why not Java?

news.ycombinator.com

61–70 of 112 posts

Re: Ask HN: Why not Java?

#61
post #3

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…

Yes, but you can use Java (or Scala) where C++ was mentioned.

Re: Ask HN: Why not Java?

#62
post #3

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…

Yes, but you can use Java (or Scala) where C++ was mentioned.

The rationale for the distinction is given: deterministic performance.

Re: Ask HN: Why not Java?

#63
post #3

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…

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.

I've been highlighting stuff with Diggo these days...

Re: Ask HN: Why not Java?

#65
post #53

Earlier 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,…

Why would you want to reuse a construction so trivial? Why would you want to search for it?

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?

#66
There are some good, reasoned comments here. Java suffered through some unfortunate 'best practices' that tarnished it's reputation. Building is uh, suboptimal, as some have pointed out, but if you're working alone just keep it simple and it shouldn't be a problem.

Unless 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?

#67
post #16

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

The word "SimpleBeanFactoryAwareAspectInstanceFactory" reflects everything I hate about Java and it's intended approach to OOP.

Re: Ask HN: Why not Java?

#68
post #20

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

There's just no need for Interfaces when you have duck-typing at your disposal.

Re: Ask HN: Why not Java?

#69

In 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…

The verbosity of java allows an IDE like eclipse to exist. I agree that's very hard to program java without a powerful IDE, but there are a lot of things that you can do only with a static typed language and a IDE like eclipse. It's a fair trade. Could you ellaborate on the link between IDE dependency and the spawn a whole caste of very mediocre programmers? (english is not my first language, so sorry if anything I wrote sounds rude)

Re: Ask HN: Why not Java?

#70
post #53

Earlier 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,…

orangecat example is type safe, your example trades a "compile time" error for a runtime error.
Post reply on HN