

Ask HN: possible Java contract, what alternatives to suggest? - Tichy

I used to be a Java consultant and my past keeps haunting me. Since I haven't earned money for a while, I did not say no immediately to a recent consulting request. It is a startup by someone I have worked with before (who is a business guy). So far I only talked to his partner, and the project does sound quite nice. Some perks for me would be that there would be a chance to bring one of my best friends on board, and we would be developing the code from scratch together (the two of us). This would give me some additional confidence because he is much more of a Java geek than I am. I haven't coded in Java for over a year now, and it would be nice to work with somebody who is more up to date with the latest developments.<p>But Java is also the problem: I really never wanted to do another Java project again, ever. I had some hopes to suggest Scala instead, but to my surprise my friend was against it. And it is actually reasonable: his argument is that it would cost us time to learn a new language and framework. Actually I have dismissed Scala twice before, too (from rather superficially reading the "how to get started" tutorials), but it is the only compromise that I could think of that a die hard Java person might take serious.<p>Also, I have now noticed that there does not seem to be a lot of online documentation about Lift, the Scala web framework. I am also not sure I really like constructs like "LongKeyedMapper" - again, a very superficial evaluation, but at first glance it just doesn't look that pretty.<p>Anyway, I am not sure what to do. I think by default the client was thinking Java, but they might not be hard set for it. But what else is there? I am not really good at any other web frameworks yet. I am not 100% happy about Rails (ActiveRecords, Migrations - bleah), and not about Django either (RESTful URLs???). I suppose any alternative would have to be statically typed to convince my Java friend. Also, this startup will do money transactions, so it is more down to earth than fancy, and performance DOES matter.<p>I guess I should just suck it up and do it in Java, as it is "only" about 4 months anyway. But I have been <i>extremely</i> unhappy in some previous Java projects. Or just say no to the project after all. It is also probably mostly standard web develepmont, a ka boring. I was hoping that learning a new language along with it could prevent my brain from completely shutting down during the process, but it seems unprofessional to burden the client with the additional risk.<p>Personally my best hope for the near future is JavaScript all the way down (perhaps with node.js), but I don't think I could suggest it to a client just yet. Maybe F# would be an option, too, but I have zero experience with .NET (is it possible to develop and run it on Linux - Mono?)<p>I am aware of Clojure, but I think it would be too big of a leap for my Java friend, and I am not certain that Compojure would be to my liking (don't think I dig the the HTML builder with <i>square</i> brackets, for instance) - yet another superficial evaluation, no less.<p>Perhaps there is some approximation to a fast turnaround Java web framework? I just know that if confronted with another service oriented architecture that requires me to change 10 files just to change one word on a web site I might end up getting writers block and unable to get any work done (Service, ServiceImpl, DAO, DAOImpl, Controller, ControllerImpl, jspx... ok just 7 so far, but I might have forgotten some... ah, perhaps messages.properties, application-context.xml, hm...perhaps a FormObject + Impl?).<p>Maybe I could say no and tell them to find a more dedicated Java developer. If they absolutely can't find anybody, I could suggest a fancy language of my choosing as a compromise and feel less bad about it because at least I would not be guilty of having prevented them from choosing the "safe" Java route :-/
======
andrewcooke
i think i have a similar skill set to you, but i have tried both django and
scala, so perhaps my perspective can help.

if you're fluent with python, django's way better than java for most web
stuff. it's nowhere near as efficient, of course, but typically that doesn't
matter for presentation layer (unless you're having to do some heavy
processing of data for display, for example). the documentation is pretty
good, but if you need to tweak something, be prepared to read their code.

[i don't really understand your objection to rest - even my java code (with
spring + jsp) uses rest. anyway, it's easy to change that.]

i was surprised by scala. if you've got experience with functional languages,
it might make sense. however, i was disappointed by the instability and lack
of documentation, given its age and reputation. it's a sweet language, and i
am using it for a personal project that requires efficient code, but i was
hoping to recommend it for use at work and decided against that (for now - in
another year i am pretty sure that will change).

but you don't give many details of what experience you have outside java.

if you do go with java, i find spring to be the "lightest" framework,
typically with just jsp and a few tags. but compared to django that's still
very heavy.

------
spitfire
Ada. It's what Java should have been to begin with. Strictly typed, safety
minded OOP programming language with modern features like generics and tasking
(in 1983 no less). It's designed to handle large projects over a long lifespan
- millions LOC over decades.

The F-16, F-15, F22, any boeing/airbus aircraft and most rail systems are
developed in it. As are financial systems, medical equipment, etc. It's the
strong silent type of programming language you don't hear about it much
because it just works.

And there's a JVM target for it.

EDIT: You might wonder why I mentioned all the safety critical stuff - Because
safety is synonymous with reliability and maintainability. With Ada I find
things are at times quite boring - things just get done without problems. This
sort of thing tends to appeal to more mature developers.

~~~
nearestneighbor
> Ada. It's what Java should have been to begin with.

And OCaml/ML is what Ada should have been. Generics 10 years before Ada AND
type inference. So, languages have been going downhill since then: OCaml ->
Ada -> Java, although with Scala being a kind of ML superset, one might say
they're attempting a full circle.

------
pivo
It's hard to say not knowing the scale of the application or any of it's
requirements, etc. In any case, if you do stick with Java you might try out
the Play framework, it looks like a nice alternative to the typical gigantic
Java framework. <http://www.playframework.org/>

I haven't used play myself, but if I had to use Java myself I'd certainly look
a it. Also, play 1.1 is supposed to support Scala, which would probably be
much nicer.

~~~
Tichy
Play looks very much worth checking out, thanks!

------
roam
If you or your friend are not comfortable with anything else, stick with plain
Java. Check out the Play framework if you really want to prevent boredom
because you've all done it before. Or Groovy.

If you don't want to do Java projects in the future, I suggest getting
comfortable enough with other languages and frameworks on your own time.

For now: what's wrong with "RESTful" URLs? And you do understand you're not
required to use 4 different layers in Java either, right?

~~~
Tichy
Thanks - play looks good, will definitely consider it.

I like RESTful URLs, the problem with Django seems to be that it doesn't
really cater for them (or at least the routing system does not know about GET,
POST, PUT and DELETE, as far as I could see).

Java layers: I know, but using Java usually also entails using Spring and
Hibernate and "doing things the proper way" :-/

I know I should get comfortable with other frameworks, I just haven't found
one I was happy with (tried Rails, and atm doing a small Python project -
where I settled for bottle.py, which is great fun, but probably too plain
atm.).

~~~
towndrunk
There is absolutely nothing wrong with using just JSP/JSTL and Servlets. With
a properly built base servlet as a foundation for your other servlets, things
become quite easy and enjoyable in the Java world. You do not _have_ to use
Spring and Hibernate to do things proper in Java.

~~~
kls
I don't even use JSP/JSTL, I do straight HTML, CSS and JavaScript for the
front end now and use a CMS for all of my static templating (by-by tiles). The
only thing I use Java for now is RESTful services using JAX-RS. I do use JPA
for my data access so for the most part, if I am just doing CRUD, I can
generate the JPA class and the RESTful service off of that class without
"writing" java. It is a far less convoluted stack and is far more efficient at
getting work done quickly.

