Live data from Hacker News

Ask HN: Any web startups using Java?

news.ycombinator.com

71–80 of 164 posts

Re: Ask HN: Any web startups using Java?

#71
post #58

I used Java until 2002, then used Ruby until 2009, then switched to Javascript (server side). 3 months ago I decided to switch back to Java and I really feel I lost a decade with experiments. It turns out, I am really a static-typing ...type after all. With utilities like Spring Roo, frameworks like Jersey (JAX-RS), IDEs like Eclipse and platforms like GAE, Java can be really productive.

Enterprise developer using Jersey to make RESTful apps here. I've come from a Django background in my own time, and while it's pretty verbose you can get a lot done with Jersey and spring-wiring things.

Are there any complementary tools out there for things like templating and form validation? We're currently using Apache Velocity for templating and manually doing this stuff feels a bit alien to me when Django gives you this stuff for free.

Re: Ask HN: Any web startups using Java?

#72
How times change - when we started in '95 the fact that we were doing a server side application in Java was seen as a very cool thing.

However, at some point about '99 or so Java seemed to endure a culture change where Java became popular as an "enterprise" platform and the values associated with that culture started to dominate a lot of discussions about how to do things. Suddenly everyone wanted to use every feature of J2EE in every project (largely for CV padding as far as I could see) - with predictably awful results.

However, Java has always been a pretty decent platform - we wrote search engines in it and things like Lucene continue to work pretty well. There are a lot of fascinating libraries for Java and performance can be excellent - it could be pretty fast in 2001/2002 and I assume it hasn't got slower....

If you can use Java and focus on "Keep Things Simple Stupid" then I can't think of many reasons not to use it - it might not be fashionable any more (those days are long gone) but it sure is capable.

Re: Ask HN: Any web startups using Java?

#73
post #20
post #17

Earlier quoted context omitted.

//bloated enterprise stuff// by this you mean the frameworks like Spring, Struts or the buzzwords like JMS, EJBs?

i guess stuff like EJB, JMS. Spring is kinda lightweight compared to those frameworks/platforms.

I don't mind the core of spring but the full spring stack is nearly as bad as Java EE - I was reading through what was suppose to be a simple minimalist tutorial on how to implement CRUD operations in spring the other day and my jaw dropped at the amount of duplication, verbosity & incomprehensible config involved:

http://www.adobocode.com/spring/adding-crud-capability-to-sp...

I'm personally into much simpler stuff like Stripes & Guice.

Re: Ask HN: Any web startups using Java?

#74
post #20
post #17

Earlier quoted context omitted.

//bloated enterprise stuff// by this you mean the frameworks like Spring, Struts or the buzzwords like JMS, EJBs?

i guess stuff like EJB, JMS. Spring is kinda lightweight compared to those frameworks/platforms.

I would totally disagree with you on that. If you use only the IOC controller for injecting your classes, maybe, Spring is not bloated, but also, its usefulness is not that great. But as soon as you begin to enter the wonderful spring-mvc world (which is the standard way to handle web apps using Spring), bloat is all around.

Take a look for example at the family of spring MVC controllers (http://static.springsource.org/spring/docs/2.5.x/api/org/spr...) : before doing any development, should you have to study such a family to know which controller should fit everyone of your use cases ? That, for me is the very definition of bloat.

Furthermore, the documentation is terrible, IMHO. That said, I have been spoiled by months of Django development, maybe it is not that bad according to Java Standards.

More generally, the main problem with Java is the emphasis on architecture astronautism, not the language itself, which is ok, if not very powerful (no function as first class objects, really ? ).

Re: Ask HN: Any web startups using Java?

#75
I have been part of building a web startup using Java technologies. Our stack was - 1. Apache + Jetty 2. Java 3. GWT 4. Rules engine (drools) 5. Solr/Lucene for searching 6. Mysql (InnoDB) 7. Amazon web services (EC2, S3)

Experience was good. I generally try staying away from frameworks like Struts, JSF for a consumer facing web app. They make sense in enterprise domain, but not so much in web.

I am right now building a product on my own using GWT (Java to JS cross compiler), Scala and Mongodb as my stack. Experience is again pretty good.

On the backend I chose Scala over Java mainly because I require lot of parallel processing to crunch data.

Re: Ask HN: Any web startups using Java?

#76
I'll give you my take on this as a Java programmer of 10+ years experience.

The problem you will have with Java in a startup is that Java's frameworks are by and large built for "enterprises". I put that in quotes because in one sense it doesn't really mean anything. In another, it's more of an idea of what governments and large companies want.

Even when using Spring (which, in my opinion, is a "must have" for pretty much any Java Web project), the amount of boilerplate required to set up an endpoint, map form data to objects, map those "presentation objects" into "business objects", map those "business objects" into a DAO (data access object), etc is pure torture.

Now this isn't completely the fault of the language. The language certainly doesn't help matters by being statically typed. This just doesn't gel well with how "fast" Web development works. Compare that to PHP (as just one example), where form data is just a map (hash or simply "array" in PHP parlance). Add a new field? Not a problem.

Add a new field in Java and you'll be making class modifications in about eight different places.

The bigger part of the problem is not the static typing though, it's the philosophies that dominate the Java landscape. There is a joke about the Java programmer's response to any problem is "just add one more layer and it'll be OK". It's funny because it's true.

It's fair to say that Fowleresque division of responsibility based layering is pervasive.

Of course the dynamic languages can have other problems (eg no error when misspelling a form field) and Java's static typing has, in my opinion, made Java's IDEs the best of any language or platform bar none (IntelliJ in particular). IDEs seem less able with dynamic languages because it's much harder (if not downright impossible) for an IDE to, for example, derive the members (let alone the types of those members, if that concept has meaning) on the fly.

Weirdly some in the PHP world have tried to mimic Java's deep layering with these horrific (imho) MVC frameworks that (again imho) simply combine the worst of both worlds. Dynamic class loading, bootstrappers, magic (and sometimes unpredictable) file loading, enforced directory structures and so on are just the wrong approach most of the time.

Java does have some benefits though. There are basically three tiers of languages in terms of performance (from best to worst):

1. C/C++/Assembler: the true compiled languages;

2. Java, C# (and the other .Net languages): the bytecode or virtual machine "semi-compiled" languages; and

3. Python, Perl, Ruby, PHP, etc: the scripted languages.

I qualify this by saying: most of the time (particularly for Web apps and especially if you don't have Google-level scale problems) performance doesn't matter. What matters is productivity and productivity is similarly tiered from worst to best in that above list. Hardware is now so cheap that it's far more effective to throw hardware at most problems than it is to write things in C. This is almost universally true when it comes to the Web where network latency and the speed at which the browser can process your page (and Javascript) will dwarf serverside performance most of the time.

I did a bunch of the Facebook puzzles awhile ago. The breathazlyer one was quite interesting. I started doing that in Python but it is somewhat difficult to get a solution to pass in that. Java is an order of magnitude faster. C is one or more orders of magnitude faster yet again.

So back to your original question (now that my answer has some context): I would say that using Java may make sense if everyone knows it and is comfortable with it. If not you will find many speed barriers along the way of learning a new language that may just slow you down or (worse) may create huge problems (eg security issues you weren't aware of because something didn't work the way you simply assumed that it did).

None of these problems are insurmountable but the way I figure it is this: when writing something new, chances are that within a year you'll be best off throwing it out and starting again anyway as the problem changes, you identify your bottlenecks (often not what you thought they'd be to begin with) and your scale changes.

So don't try and find the perfect language or platform or framework. Write something now and don't try and solve every problem you may ever have today.

Re: Ask HN: Any web startups using Java?

#77

Earlier quoted context omitted.

I'm curious as to why you would call Java easier to deploy than Rails. Having developed both Java EE applications and Rails applications, Rails to me was much more easier to deploy, without having to deal with installing Tomcat and going through the extensive server configurations.

Java for most startups won't be Java EE. My best experience with Java recently has been with Jetty as an application server. It's fast and it's lightweight. I usually run Jetty behind nginx and don't generally need to configure Jetty to do anything. The whole Tomcat and connectors for apache configuration from a few years ago is well and truly behind me.

++Jetty. It's also great for development as it handles hot swapping of code changes, so they can be tested immediately without a container restart.

Re: Ask HN: Any web startups using Java?

#78
post #61

I sold a Java-based program for about four years and have a previous background in Big Freaking Enterprise Java Web Development. You can certainly write web applications in Java. They're harder to deploy than PHP but easier to deploy than Rails, in my experience, depending heavily on how experienced you are at administering systems and how much Java enterprise coffee you want to drink. Java is a mature language. Libr…

There is play framework, which is very good and comparable to RoR.

Re: Ask HN: Any web startups using Java?

#79
post #59

#1 reason: Java is a verbose language with a rather verbose design philosophy/ecosystem which is not to say it's bad. it's actually really good, with lots of great qualities. but compared to PHP, Ruby and Python, it's rather verbose. As a general rule you can pound out way more feature points per hour in a less verbose language than a more verbose one. there are other factors, sure, but I think this is the biggest on…

You're perpetuating a myth. Verbosity doesn't equal less productivity. I would be really surprised if anyone here said their bottleneck in programming was the speed they can type. Also, all languages have their needless verbosity - look at 'end' vs '}' (ruby vs java). Which is the more verbose?

Verbosity and increased complexity in Java comes mainly for two reasons, none of which is about minor syntactical issues.

Java doesn't abstract very well beyond objects and classes. This becomes pretty irritating in stuff like event handlers, where you'd really like to use something like a lambda/delegate, but the only option you have is an inner class. This might change in the future, but right now some minor language features would make it much easier, and you'd avoid hard to track down annotations and reflection.

Also, Java library design often tends towards the obfuscated. [...]Adapters, [...]Implementations and [...]Factories, the usually bloated read/write beans, checked exceptions…

Having said that, there are lots of really good libraries and frameworks who don't fall into those traps (well, at last not too deeply). And maybe Oracle will bestow onto us some sparkly new bits that will cut down on some boiler plate and will alleviate the need for IDE wizards/code generators or stuff like lombok[1]. In some areas, languages like Perl, Python (or even Lisp) will still have advantages, but it would be nice if Java programmers could at least catch up a little to C#.

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

Re: Ask HN: Any web startups using Java?

#80
post #49

IMO there is neither lack of hosting support (just use EC2 or a vserver) nor any serious performance issues. I'm a long term Python developer (since the 1.5.2 days). I've used a lot of different languages so far (from C to Haskell), and I've always avoided Java in the past (at the beginning because it was slow, later because everyone was telling me how bloated it is). But using Java EE (!) instead of Python for a pro…

"It just works - exactly as documented." -- I guess that's the one thing that Java is really good at.

I would even say you could go as far as saying it one end of the spectrum. Where you have frontend web apps (html/js/css) on a variety of platforms[1] on the one end and the big corporate backed languages and frameworks on the other end.

[1]: This can be a real pita. Though it's being mitigated more and more by adding compatibility layers on top (jQuery et al).

Post reply on HN