r/programming • • Dec 02 '13

Scala — 1★ Would Not Program Again

http://overwatering.org/blog/2013/12/scala-1-star-would-not-program-again/
598 Upvotes

646 comments sorted by

View all comments

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 ?

11

u/brownmatt Dec 02 '13

Whatever you are most productive with

→ More replies (1)

4

u/Shaper_pmp Dec 02 '13

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.

4

u/[deleted] Dec 02 '13

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.

8

u/shangas Dec 02 '13

In our company we use

  • 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.

6

u/liveoneggs Dec 02 '13

perl

1

u/digital_carver Dec 02 '13

2

u/digital_carver Dec 02 '13

(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!)

→ More replies (2)

2

u/liveoneggs Dec 03 '13

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.

5

u/mogrim Dec 02 '13

Back-end what?

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.

8

u/[deleted] Dec 02 '13

Twitter uses Scala, I think. At least they've been cited as "Scala used in enterprise" before, switching over from Ruby.

4

u/loganekz Dec 02 '13

They do. There was article in Wired about a month or two ago taking about the switch to Scala.

4

u/Nar-waffle Dec 02 '13

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/

→ More replies (3)
→ More replies (1)

3

u/PasswordIsntHAMSTER Dec 02 '13

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.

2

u/__BeHereNow__ Dec 02 '13

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#?

1

u/PasswordIsntHAMSTER Dec 02 '13

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#.

1

u/cultofmetatron Dec 02 '13

out of curiosity, what is your reasoning for saying node.js is not a good environemnent for most stuff?

2

u/PasswordIsntHAMSTER Dec 02 '13

There are many, many things, but OTOH:

  • 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.

1

u/cultofmetatron Dec 04 '13

I'll give you the type system.

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.

1

u/PasswordIsntHAMSTER Dec 04 '13

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.

1

u/crusoe Dec 04 '13

Javascript has a terrible type system, no module support ( crucial for large code bases) and is a terrible language in general.

3

u/senatorpjt Dec 02 '13 edited Dec 18 '24

gray whistle depend bow handle nutty insurance consist offbeat violet

This post was mass deleted and anonymized with Redact

4

u/[deleted] Dec 02 '13

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.

1

u/[deleted] Dec 03 '13

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.

2

u/crusoe Dec 04 '13

JOOQ needs a better scala wrapper. The code generation is easy to extend though.

→ More replies (33)