r/programming • • Feb 22 '15

Java Makes Programmers Want To Do Absolutely Anything Else With Their Time

http://www.forbes.com/sites/quora/2015/02/21/java-makes-programmers-want-to-do-absolutely-anything-else-with-their-time/
35 Upvotes

636 comments sorted by

View all comments

Show parent comments

18

u/bcash Feb 22 '15

There are, as other comments have mentioned "better" HTTP libraries that present a much higher-level API. But Apache's HTTP Client has the specific aim of implementing HTTP as it's defined, and designed it's class-structure with that as a goal, allowing the various options to be substituted.

So, of course, form submission will be the most verbose example, as URL-encoding pairs of values is a convention, the mechanics of POST go far beyond that one case (yes, that one case is the most common).

There's nothing wrong with this approach. Indeed it's very valuable for non-trivial circumstances. But if you don't need it, there are other libraries available.

0

u/[deleted] Feb 22 '15

There's nothing wrong with this approach.

Isn't there? Why?

What value does this structuring of the library actually add, other than scratching some obsessive itch of the developers?

1

u/bcash Feb 22 '15

Isn't there? Why?

Is there? Why?

What value does this structuring of the library actually add, other than scratching some obsessive itch of the developers?

Right, because it's an all-too-typical standard Java ego-driven bigger-the-better library? Am I right? What would you cite as a good HTTP library in that case?

Meanwhile, back in reality. The httpcomponents project, of which the Apache HTTP Client is a component, is a tried and tested multi-decade project that's more than proven itself. Indeed it's widely used as the basis for these higher-level libraries - the maven central repository finds hundreds of artifacts that cite httpcomponents as a dependency.

And it doesn't just end there, it's used as the basis for HTTP libraries in other JVM languages too. People may think they're escaping Java verbosity writing in Clojure, but if you've made an HTTP request directory or indirectly, in Clojure/Scala/Groovy/etc. you have almost certainly used this library.

And why is it so popular? Because it does everything.

1

u/[deleted] Feb 23 '15

Being popular is no measure of being good. Sure, it does everything, but does it do everything in a way that makes sense, or is it needlessly complicated?

There's no obvious reason why structuring your library the exact same as the spec should be a good idea, or useful to users. It's up to whoever makes the claim that it is to support this claim.