Live data from Hacker News

Ask HN: Why not Java?

news.ycombinator.com

21–30 of 112 posts

Re: Ask HN: Why not Java?

#21
> Why is it so horrible as a systems language above C?

* First class functions (interfaces with one method) plus garbage collector eventually encourage a functional programming style, with lots of little objects created on the heap. Alas, the per-object memory overhead of popular Java implementations is horrendous.

* Strong emphasis on using threads for concurrency. Alas, in practice, threads are incredibly large memory hogs.

* Verbosity. While it is possible to write clean composable code in Java, it is also remarkably verbose. After a while, this gets old and people take all shortcuts they can to limit verbosity. Which is a very bad idea. To quote an esteemed colleague, "I never took a shortcut I didn't regretted it later". Can we have our lambdas yet, pretty please?

Re: Ask HN: Why not Java?

#22
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…

Rigth tool for the right job is key here. I personally like to add Groovy to the devops list.

Re: Ask HN: Why not Java?

#23
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…

You can ditch the xml almost entirely in spring 3, which I've been using for 2 years now. All you need is 50-100 boilerplate lines and the rest is annotations. I agree that 2.x was xml hell, but it is worlds better now.

Re: Ask HN: Why not Java?

#24
post #15
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…

Spring is not garbage.

Why is it not garbage?

Re: Ask HN: Why not Java?

#25
Java is good enough for all types of projects. People hate Java because... they can't Java right. Personally, I very like Python and JavaScript and features like multiple inheritance or prototyping, higher-order functions and so on. But Java is better sufficient for projects which more complex as "Hello world", because type safe (robust, compile-time feedback), excelent IDE support and incredibly fast and allow fast development (if you can Java, TDD and so on).

Re: Ask HN: Why not Java?

#26
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.

Link to the comment as a bookmark.

Re: Ask HN: Why not Java?

#27
The best reason to use Java is the enormous ecosystem of libraries and resources.

The best reason to AVOID using Java is the huge demand for Java programmers and the low supply. At my job we can barely find applicants with Java so we end up hiring .NET people and converting them.

Re: Ask HN: Why not Java?

#28
My main problem is that it has awful support for functional programming, which I find to be a really helpful way of doing something like a web crawler, where you're essentially describing a computation to parse some input. I would use F#, because it offers powerful functional programming tools, is on .NET / VS 2012 (not sure if that's a pro or con for you), and has type inference (so you get the benefits of static typing without the cost of writing out the types of everything).

You should probably check existing web crawler solutions to see if you can adapt them before rolling your own.

Re: Ask HN: Why not Java?

#29
post #14

Earlier quoted context omitted.

Can you give us some evidence why Spring is "unequivocal and absolute garbage"?

Spring was innovative in 2008. Now, Spring is overbloat, buggy (look at request-mapper) and have old, sensless integration to others modules, see spring-data for NoSQL, or try integrate last version of Velocity with last version of Spring. And additionaly, all, what you can do with Spring, you can do with JEE.

Yes, I was careful to say "J2EE" and not "JEE". WebBeans/CDI in Java EE 6 are quite decent. JSR 330 seems as if they just standardized on Guice. JSR 318 is quite good as well: I highly recommend using Jersey if you're building a REST API.

Re: Ask HN: Why not Java?

#30
post #22
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…

Rigth tool for the right job is key here. I personally like to add Groovy to the devops list.

I think groovy is sensless language. You lost all Java benefits like checked exceptions, robust code... what is about debugging? And you is not faster developing with groovy. You developing faster if you ensure quality and not inline filters or other crap. If you like groovy, look at Python.
Post reply on HN