Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Curious about something - if you had to do a new project from scratch today on top of the JVM, which language would you choose: clojure, scala, jruby (or anything else).

I ask because my brain really cant absorb too many languages, and I want to make some kind of pseudo-optimal choice. I'm not just talking about some shootout here, but about the the next 5 years outlook.



>>I ask because my brain really cant absorb too many languages, and I want to make some kind of pseudo-optimal choice

Am in the same boat. I moved to SF permanently 2 months back, after 15+ years in the east coast. Decided to pick 1 language, immerse myself in it deeply, & then start the interview circuit. The opposite approach would be to pick a bunch of languages ( ruby, python, jquery/coffeescript etc. ) and get a smattering of best practices in everything without knowing anything too deeply. Both approaches have their merit. In SF, I recommend the latter approach - you will find jobs almost instantly if you do that. But still, given my proclivity ( I would rather know everything about 1 thing than something about everything) I chose the former approach. I picked Scala, read every single chapter of Odersky's book, & subjected myself to 19 total interviews at 2 multibillion$ companies using Scala exclusively for a "new project built from scratch".

I got offers at both. Now am debating which one to join.

tl;dr Scala is that pseudo-optimal choice you are looking to make. In SF there are a few very-nice Scala jobs with 6-figure salaries & tons of RSU's thrown in...but only if you can hack it. The questions you will be asked in the interview are definitely esoteric & very academic ( difference between reader monad and writer monad, reverse a list without mutation using a foldLeft, kruskal's algorithm in scala, merging graphs with common edges where each edge is a tuple, etc. ) Its not web apps, its not "software engineering", and its not everybody's cup of tea. But if you like academic CS, Scala will not disappoint you.


I wonder why you did not choose to go the Clojure or Jruby (assuming you are not a Ruby guy) route ?

I am not in the valley, but it may be that you picked up on some buzz/conversations in general that lean towards scala. It is quite puzzling since Indeed.com's trends shows a massive lean towards Clojure vs Scala.

http://www.indeed.com/jobtrends?q=scala%2C+clojure%2Cjruby&#...

On an absolute term, Scala still leads the pack (http://www.indeed.com/jobanalytics/jobtrends?q=scala%2C+cloj...)


> reverse a list without mutation using a foldLeft

This is maybe a little too obvious if you understand left folding at all. A less trivial exercise in the same vein is to implement right folding via left folding. It's just a one-liner, but if you haven't tried it before, it's enlightening and worth giving a shot.


We moved node.js to Scala and play for our startup. I've programmed in grails (groovy) professionally and don't recommend it. I've heard good this about clojure but you either are a lisp fan or you aren't. As such, I don't think closure is the next big thing.

I am not a fan of the required cognitive overhead that scala takes to get started -- reading someone else's code reminds me a lot of C++ and the tooling still needs to catch up. If any of the JVM languages are going to break out, I'd put my money on scala. JRuby has its place as well, and I know of a few high profile projects done in it, so it wouldn't be a bad choice for consumer apps. For enterprise, I think static typing has some major wins.

I kind of want Scala--, to be honest...


I want it to be Scala so much as well, I don't want to start learning Go. (Although I heard great things about it, just after learning Scala, I don't want to learn a new language for a few years now)


Outside of the JVM, and for consumer apps, I am starting to think node.js is going to be the winner. It's not there yet. However, as more and more pages go to client-side apps and significant mobile presences, node is building a good enough ecosystem. Working in a single language is nice, though I think the callback system is clumsy. (That's what async or q is for. though I prefer Scala's actor model)

It wasn't right for us on this project, but I can definitely see going back to it for other projects.


I think writing one language both server and client is a big yes for node.js, but looking at my client-side code vs my server code (and I'm writing Javascript since 2001, way before I learned Java) I come to the understanding why Google are investing so much in Dart / GWT (which I think are not there yet)

If Scala/Haskell/Go would become more mainstream, and had a very straight forward / magic-free 1:1 conversion to javascript, then node.js will have much less appeal to me.


If you haven't done JVM stuff before, it's probably best to start with the terribly unfashionable Java 1.6. All of the other JVM languages tend to use its library to large extent and are using a VM which was developed for Java first, so it's good to be familiar with the underlying landscape before exploring the different riffs on it.

After that, if you want to switch to another JVM language, do it, but you should have a much clearer reason than "I want to use an alternative JVM language". Something about that language should grab you. Personally, I think Groovy's great for perl-type work where you'd like to just clack something out in a terminal rather than starting up a new project in eclipse. Clojure is an actual LISP for real functional programming. Scala (IMO, no offense) is a pile of academic features that sound great in theory. Jruby is ruby.


I will choose Play and Scala. Although JRuby/Rails comes as a very, very close second option (simply because all the cool things have a gem, not many have a Play module) But I want to have some sort of static typing to protect me, and as a Java developer, it's where I feel a bit more at home. Clojure is what I'd LIKE to use (with Noir) but I don't have the guts to be honest.

If Play had all the community and gems that RoR has, it would be a very, very strong framework, and something that the enterprise world would (years from now) adopt more likely than RoR (for all the wrong reasons, but such is life)


What would you consider to be some gems that you wish existed for play?


"I ask because my brain really cant absorb too many languages,... the next 5 years outlook."

Well, the early days of computing had domain specific languages, and I'm afraid we are getting back to that. The days of a one-size-fits-all language are over. Your best bet is to learn the principles and then the syntax differences just aren't that troublesome. The problem is that when you are new to programming, you learn only a small subset of those principles, and then are stumped when it is time to pick up a new language because it may rely on new concepts.

In education, Scheme once occupied the role of being the language in which you could learn and investigate a broad range of principles of computation. However, the perceived need for vocational training seems to have pushed Scheme out of the curriculum.

Today, Haskell is the best choice for this role.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: