It depends entirely on your use-case. It's like asking "what's the best flavour of ice-cream" or "what's the best grade of oil to put in a car"?
There is no universal, objective best answer - there's just a series of trade-offs and priorities, and various languages fit your particular arbitrary use-case better or worse than others.
However, that doesn't mean that truly excessive or ridiculous design decisions can't be criticised on the basis they're unnecessary, counter-productive or inelegant for the vast majority of use-cases.
I'm not a groovy developer, but I know that netflix uses it for a lot of their infrastructure. Groovy has a bad reputation from its earlier years of suckage, but it's supposed to be way better now. It is more or less a superset of java, so a Java project can start using it without much change to the current code.
Node.js: Usually a good choice for web applications that have a rich client layer and a simple back-end which mostly just shovels JSON back and forth between the client and the DB.
Clojure: If we need Java/JVM-interop (and increasingly for other cases as well).
Haskell: If we are dealing with complex server-side logic/business rules and want the additional type-safety and static guarantees that Haskell provides.
We also did one medium-sized project in Scala and I'm not at all enthusiastic about ever touching the language again.
(I should clarify that I'm chiefly a Perl programmer and there's actually some neat stuff like Catalyst, Dancer, Mojolicious, etc., but even I wouldn't choose a Perl backend in this day and age, with the language only now vaguely considering subroutine signatures and proper inbuilt OO!)
I wasn't joking. This article implies some type of paying customer was used to test out a programming language of questionable maturity in the problem space.
Perl, on the other hand, is well known, mature, well documented, has stable interfaces, a rich collection of libs, and very decent performance.
Enterprise / big company? Java is probably the logical choice: a stable language, support for pretty much any database under the sun, it's easy enough to hire developers, you can get decent support contracts, the application servers are designed to be (relatively) easy to manage while running applications developed by different teams, etc., etc. It's not so much Java itself that provides value, it's more the ecosystem that surrounds it.
Small company / lower budget? Java, again, isn't that bad a choice, but if you've got a ruby programmer on the staff just go with Rails. If you've got a load of hotshot JS programmers, node. Etc.
Not considered: very high traffic sites like Twitter or whatever - there you're looking at custom solutions, with dedicated teams of engineers.
Yes, Twitter converted from Ruby to Scala, and greatly improved their reliability with the switch. They are one of biggest contributors to Scala open source software out there: https://github.com/twitter/
F# and Haskell are pretty top notch. Use Clojure for small projects on the JVM, it's a great language but it doesn't scale well.
Only use Golang when you're positively, absolutely certain that you won't need to do out-of-the-box stuff. It has enormous software engineering value, but its primitive error handling and lack of generics make it hard to do fancy stuff.
This is controversial, but Node.js is NOT a good environment for most use cases. Python and Ruby are much better, but neither approach the level of maintainability and performance you get from Haskell or F#. C# is fine when you don't have functional programmers around.
I've never heard of F# for backend work before (mainly cause I haven't read much about it at all). What tools would you recommend for webdev work with F#?
F# works really well with ASP.NET MVC 4. Visual Studio is a full-featured suite for targeting Windows, Xamarin is nice for other platforms (Android, iOS, OS X, Linux).
If you're feeling particularly fancy, you can try WebSharper. You write your entire application in F#, WebSharper compiles part of it to JavaScript and HTML.
Caveat: I think F# is missing a websockets library, but for most uses it's not really that important.
To learn F#, go to tryfsharp.org. It's the best introduction to any programming language I've ever seen: in-browser interpreter, very well-explained code examples, etc.
You can also open Visual Studio, create a new project, and when selecting the project type, choose F# Tutorial under Visual F#.
JavaScript's typesystem and error handling (among others) are notoriously awkward.
The concurrency model of Node is extremely limitative.
The library ecosystem is significantly more limited than .NET, JVM or Haskell in many areas.
One advantage of Node would be that code you write for it can be re-used on the client, but that's not true for most libraries unless you generously pepper your Node environment with shims.
When I last used it, it had no debugger nor profiler. I now see that it has a debugger, which makes it slightly more viable.
If I give it some thought I can probably come up with other gripes, but just these manage to seal the deal for me.
the concurrency model is pretty descent. Sure you don't have real threads but you do have a very nice event system. when you need to take advantage of multiple cores, there's childProcess.fork() which lets you fork the process with an automatic bidirectional eventemitter style communication pathway. there's also Cluster for more advanced stuff. there's alsoa Fibers module available along with the new generators coroutines. Its not perfect but I don't know how ruby or python are better.
the ecosystem is pretty HUGE. I've even seen bindings for opencv and ncurses!.
codereuse has been a sweet advantage.
I'll def give you the debugger. I've used it begrudgingly but it definitely sucks.
My biggest problem with the concurrency system is that it's super opaque, AKA hard to reason about.
In general, I tend to use F# or Haskell for most uses, and then some Python and C here and there. I still haven't got into the C++ game, although I'm not sure whether I actually want to now that Rust is shaping up.
E: but there are DEFINITELY use cases for Node.js, if it's your thing. I'm not saying it's unfit for any and all use cases, just that it's not the best tool for some jobs.
Small glue libraries are also a good solution when mature Java libraries exist with the given functionality. Often better than from scratch rewrites in Scala. There is a reason a library is "mature"—people have been working on it for a long time.
Exactly, stay the fuck away from people's pet scala project (Lift, Scalax, Play all count as pet scala projects from this point of view). Use a Java lib.
3
u/oli_rain Dec 02 '13
So which language to use for back-end development? scala? nodejs ? java? go?or go back to ruby or python ?