Live data from Hacker News

Java for Everything

teamten.com

261–270 of 344 posts

Re: Java for Everything

#261

The problem with verbosity and repetition is not that it takes longer to type the code, at all. The problem is that it creates dependencies which you have to manage by hand. Changing `Foo a = new Foo()` to `Bar a = new Bar()` doesn't seem that bad... except when you have to propagate that change through the code base. Half of Java's tooling is dedicated to solving a problem that doesn't exist in good duck-typed langu…

better languages will either do first-class functions

Modern Java has first class functions.

https://docs.oracle.com/javase/8/docs/api/java/util/function...

Re: Java for Everything

#262
post #190

Earlier quoted context omitted.

They're moving to a new site: http://beta.groovy-lang.org/

The site at groovy.codehaus.org doesn't mention anything about the new site (actually www.groovy-lang.org). Until it does the new site is unofficial and just one of the 5 despots at Codehaus trying to grab control of the product away from the other 4 despots there. That despot has tried other tricks like soliciting for subscribers to his weekly "news mailout" which is mainly links to tweets mentioning Groovy.

Mmm. I got this from Guillaume Laforge's blog: http://glaforge.appspot.com/article/a-new-groovy-website-in-...

He's one of the core groovy developers - unless he's one of those despots you're talking about?

Re: Java for Everything

#263

Committer to Apache HBase here: I agree with the author on some level. All of HBase and Hadoop (except for a little bit of native stuff) is implemented in Java. I found that to be + and a -. Java is easy to understand and to follow, lends itself very well to large-team development, and performs well in most situations. The alleged verbosity I do not mind. I have tools, and well structured code is easy to follow. Java…

I guess you aren't aware of

http://openjdk.java.net/projects/panama/

http://openjdk.java.net/projects/valhalla/

http://openjdk.java.net/projects/sumatra/

Some of the features will come in Java 9, others in Java 10.

Re: Java for Everything

#264
post #53

Does anyone know a good starting point for learning not just Java, but how to install everything I need? I consider myself the Neo of OOP and a master devops, but every time I tried to use Java I hit a wall of unreadable manuals/guides , software impossible to install/maintain, and mixed opinions among Java devs. Like it can't be used without a dedicated sysadmin.

That...sounds surprising. Basically you need: 1. An IDE (I highly recommend IntelliJ IDEA) 2. A build and dependency management tool (I prefer Gradle, but Maven is a reasonable choice - though way more verbose) Beyond that point, a lot depends on what you want to do. Some of my preferences (YMMV): * logging: slf4j over logback * json serialization/deserialization: jackson * db access (if you don't need or want ORM):…

Ooops. For embeddable http server I meant jetty.

Re: Java for Everything

#265

Earlier quoted context omitted.

That...sounds surprising. Basically you need: 1. An IDE (I highly recommend IntelliJ IDEA) 2. A build and dependency management tool (I prefer Gradle, but Maven is a reasonable choice - though way more verbose) Beyond that point, a lot depends on what you want to do. Some of my preferences (YMMV): * logging: slf4j over logback * json serialization/deserialization: jackson * db access (if you don't need or want ORM):…

Great suggestions. Do you have a web framework suggestion, e.g. something with templating? I like Play, but that's 'cause I use Scala. It has a Java version, but IDK how good it is.

I've heard mixed things about Play's Java version. YMMV, but the last I heard it was a "second-class citizen". Unfortunately I don't work with any templating myself, but I note that Dropwizard supports both Mustache and Freemarker. Would those work for you?

Re: Java for Everything

#266
This post relies on the assumption that all dynamic languages are an order of magnitude slower than java. Not very long ago, the OP would have used the same argument in favor of C++, and against java. In fact- many dynamic languages have proven To perform better than traditional ones in some areas, such as javascript on node for web-dev. Clojure, for example is WAY faster than python. Incremental typing can squeeze out some additional power as well.

Re: Java for Everything

#267
post #152
post #89

Verbosity matters for reading and maintenance far more than it does for writing. IDEs can make the writing faster, but they can't make the code as easy to comprehend as it would be in a more expressive language. And remember that lines of code is the only proven risk factor for bugs. Most sites are not Twitter. They're not Stack Overflow. They're not even Nanowrimo. I've watched a company spend two years, dozens of d…

> I've watched a company spend two years, dozens of developers, and over a million in ESB license fees failing to write a site that was expected to have, at peak, 100 users/day. I'm sorry to hear that. But you understand that this had nothing to do with Java, right? Java didn't make those people do that. That was just good old fashioned human stupidity. It's entirely possible to write simple things in Java, without E…

It's entirely possible to write simple things in Java, without ESBs and a person-century of effort.

That I don't disagree with (see Java4K and various other demoscene-like competitions), but when the mainstream culture of Java is oriented towards architecture-astronautism and "enterprisey" bureaucratic excesses of complexity, that's what the majority of Java developers you find are going to do. Ask them why a simpler (and less time-consuming) solution wouldn't suffice and they'll respond with things like "robustness", "extensibility", "modularity", "encapsulation", "abstraction", etc. even when none of these properties are truly applicable to the situation at hand. If I were to guess why, they're just so accustomed to writing code with such indirectness that a simple solution feels "wrong" to them. I worked very briefly for a Java shop and on one occasion my code was rejected, and was told to "refactor" a fairly trivial 20-line method in one class into 8 separate classes each containing 1-line methods on account of the fact that my original code was not "extensible" nor "modular" enough. I was suggested to introduce a design pattern to do this. Any advantage of that extra flexibility was never realised since the application was eventually completely scrapped in a rewrite. (I left shortly after that.)

Re: Java for Everything

#268
post #240

Earlier quoted context omitted.

Downvotes (especially without comments) as an expression of disagreement are just plain silly. Are we eight-year olds?

This behaviour - downvoting without explanation irritates me too when there is very lucid and concisely structured argument you can oppose. As such, I do not find your argument for verbosity normalizing convincing :) I fail to see how normalizing some risk metric against a verbosity of language will provide any valid data in the general context. For numerical algorithms, where a multiplication is just as verbose in a…

What you argue is not that LOC in itself causes bugs, but that certain programming syntaxes are both complex (thus induces bugs) and takes up more LOC.

Re: Java for Everything

#270

Ok, now your boss asks you to write an iPhone client. Or web client with a lot of logic in the browser. Or even a custom, native windows client. (Ok, Swing or SWT, but, ...really?) " Language X for Everything" is simple not possible, regardless of the value for X .

* C# (and/or F#) to build iPhone, Android, and Windows Phone apps [1] * F# code that compiles to JavaScript for front-ends [2] * C# (and/or F#) code for Windows and *nix clients [3] They are not perfect (nor the tooling are free), but it is possible. [1] - http://xamarin.com/ [2] - http://websharper.com/ [3] - http://www.mono-project.com/

There is also a project that can convert MSIL to Javascript. So, add to that list

    * C# code that compiles to Javascript for front-ends [1]
Or, indeed, any .Net-targetted language like Nemerle, Boo and VB.

[1]: http://jsil.org/

Post reply on HN