Here is a very interesting story of someone who started using Scala and then decided to come back to Java:
My experiment with Scala is not working out. It’s just not ready for prime time, and is overkill for my needs. Reluctantly, I am falling back to Java.
Here are some of the reasons why this blog post stands out for me:
- The author didn’t simply look at Scala and shy away from it, he actually started his project but he got bogged down by various obstacles and he decided that he wasn’t going to get a return on his investment (“I wish Scala the best, but I have work to do”).
- He also still gives plenty of credit to Scala, and while he hasn’t been completely turned off from it, the combination of subpar tooling, language complexity and compiler quirks led to him abandoning Scala for his project.
- The comments are all extremely interesting, make sure you read them all. No flame wars, no fanboyism, just educated answers from professionals. And Martin stepped in as well.
Here are a few notable quotes from this post along with my thoughts.
Martin Odersky:
It’s true that functional programming folks are increasingly picking [Scala] up. This is a good thing, IMO, because it pushes the envelope of what you can do with the language
This statement concerns me. First, I’m not sure that the envelope needs to be pushed any further in Scala. A lot of potential users are routinely turned off by its excessive functional and academic aspects and its complex type system. The interaction between functional and object oriented features already feels pretty complex to handle, so I certainly don’t want the language to evolve any further. I hope that future efforts will be oriented more toward the libraries and the tools than the language
I think Scala has pushed the functional envelope already a bit too far for comfort.
A commenter named Nat said:
The powerful, convenient type checking is made redundant by the powerful, convenient implicits
I think this is a good way to capture the observation I made above about how the interaction of complex features leads to even more complex behaviors.
Martin Odersky:
I have now switched for all of my development work to our as yet unreleased version of the Scala plugin for Eclipse. That’s after 20 years of emacs. And I am not looking back.
Now I found this quote quite perplexing. The good news is that with Martin’s team taking over the Scala Eclipse plug-in, I am hopeful that we will finally get some significant progress in that area.
However, I am disappointed to learn that until recently, Martin was still using Emacs to write Scala (and I’m guessing, Java before he switched). For those of you who are not familiar with my opinion on the subject, I’ll summarize it thusly: if you are currently using a text editor to write Java/Scala code, you will be even more productive if you switch to Eclipse or IDEA.
The fact that Martin was still using Emacs to write code until recently probably explains why progress on the Scala IDE front has been so glacially slow. And this is tragic because I’m sure that a lot of developers have been turned off from Scala because of the lack of a good IDE plug-in. I’m hoping that with this new direction, Martin will mandate everyone on the core team to force themselves to use Eclipse in order to dogfood and improve the plug-in. It’s the only way we’ll see any progress.
This situation is pretty shameful, to be honest. Scala is about seven years old and the absence of decent IDE support after such a period of time is absolutely unforgiveable, especially given the ambitions of the Scala team.
Jonathan Edwards, the author of the blog post, is going even further:
Design the IDE first, then build a language that does what it needs.
This sounds a bit extreme to me, but I absolutely believe that in order for a language to become successful, both the languages and the productivity tools that surround it (IDE, debugger, etc…) need to be built in lockstep. Granted, this might slow down the development of the language itself, but I see this as a good thing: bringing up the entire stack at the same time is a great way to make sure that the language remains manageable. If your language has become too complex for IDE’s to handle, how do you think users will feel about it?
And this brings us to another weakness of Scala, which Martin himself touches on in another comment:
But what’s absolutely necessary is that the people who work on the IDE have an intimate knowledge of the compiler internals.
This sentence is probably the main reason why IDE support has been so slow. There are obviously very few people who are familiar with the Scala compiler internals (and I remember hearing somebody say that there are probably areas of the compiler that nobody understands any more, I wonder if it wasn’t Martin himself), so the bar is impossibly high for a Scala plug-in to happen.
Sadly, cooperation from the Scala compiler seems completely unavoidable if you want to deliver a decent plug-in, if only because the IDE will need help resolving inferred types and probably other potentially complex constructs such as implicits. I hear Martin’s team is working hard on the compiler so that it will expose a clean API that tools can work with. Let’s hope this work will come to fruition sooner than later.
One last thing: Fantom receives a well deserved mention in this thread. If you still haven’t looked into Fantom and if you are looking for Java’s successor, I strongly encourage you to go take a look at it now.
Pingback: Tweets that mention From Scala back to Java « Otaku, Cedric's blog -- Topsy.com
#1 by Mats Henricson on February 24, 2011 - 12:17 am
Cederic, you have been one of my favourite bloggers for quite a few years, but your constant bashing of Scala is disappointing. What is your problem? Let people use Scala if they wish! You are obviously not interested (and have been bashing Scala for several years), so why not just leave the whole issue and go somewhere else?
I’m a Scala fanboy, but would I go writing blog posts about how Ruby or Groovy or whatever other language have drawbacks or failures? No, why would I? These languages just aren’t interesting to me, so why bother?
And, your conclusions in your blog are just over the top. When Martin tells us he just switched from Emacs to Eclipse+Scala plugin, then you stab this good news in the back by claiming this is evidence Eclipse+plugin just was too bad quality. There just is no way for Martin + Scala to win in your eyes.
So, go blog about stuff you are passionate about. It will make your blog posts more interesting, and you will probably lower your blood pressure at the same time.
#2 by soliloquyguy on February 24, 2011 - 3:01 am
Cederic, i have been going through your blog about TestNG framework . I have a query . Can i use TestNG Framework for data diven testing for Android Application ? If possible ….how can it be done. i am wondering how to do a data driven Testing in Android Application. I know it can be done for Selenium. Hope to get a reply from you ASAP.
#3 by Tetsuo on February 24, 2011 - 3:32 am
@Mats If only fanboys blogged about their languages/tools, no one would ever be informed about its potential drawbacks. If a technology is really good, the haters/lovers ratio will be low, and nobody will care about the haters. And, it’s when the haters start to show up (provided that it already has lots of lovers) that you know your technology is relevant! 🙂
Scala, in particular, will attract a lot of ‘haters’, simply because we, Java developers, are deeply spoiled by the incredibly smart tools we have. And, Scala being statically-typed, we expect the same for it.
I myself simply can’t live without Ctrl+Space, Ctrl+1, and Alt+Shift+L/R/I/O anymore. And can’t even consider using Scala until I have this. And I can only feel pity for thos who say their language is more productive, when they still have to use vi or emacs.
#4 by Craig on February 24, 2011 - 6:17 am
“And this is tragic because Im sure that a lot of developers have been turned off from Scala because of the lack of a good IDE plug-in.”
The Eclipse plugin has never been the strongest. Try the IntelliJ plugin. It’s quite good.
http://stackoverflow.com/questions/419207/which-is-the-best-ide-for-scala-development
#5 by Cedric on February 24, 2011 - 6:18 am
Mats,
I am disappointed by your characterization of this blog post as “Scala bashing”. I’m simply expressing my concerns about the language and its ecosystem as they stand today.
You’ll probably be surprised to hear that I actually like Scala and the intellectual field that it opens up. Just this week, I read two articles on it, one written by Martin and another about using Scala for Generic Programming. I really like this stuff. But just because I like something doesn’t mean I necessarily find it flawless (see another of my posts about the “Fan syndrome”), and it’s just in my nature to talk about my concerns and spark a discussion in an attempt to improve things.
If you want to participate in the debate in a constructive manner instead of shooting a messenger that brings you news that you don’t like, you are welcome to disagree with me and explain why you think that the Scala IDE works great or that Scala is really not that complicated.
#6 by Craig on February 24, 2011 - 6:29 am
“I certainly dont want the language to evolve any further.”
“I think Scala has pushed the functional envelope already a bit too far for comfort.”
The point of Martin’s comment is that the language hasn’t evolved much recently and that people have been writing more Scala code in a functional style. We haven’t named any projects but I suspect we’re all thinking of scalaz. I think scalaz can seriously hurt readability but you know, just avoid that library.
#7 by Mats Henricson on February 24, 2011 - 6:38 am
@Tetsuo What do you mean? That blog has been online long before Cederic picked it up. I read it before Cederic picked it up too, and I fail to see what he added.
@Cederic I never said the Eclipse plugin was good. I have tried it myself and wasn’t too happy. But the way you described it was just dishonest! When Martin told people he had switched from Emacs to Eclipse, then you took that as a proof that the plugin was (had been) crap, instead of the more honest way of looking at it, that it today indeed was really good.
Had Martin stayed on Emacs, then that would have been evidence the Eclipse plugin was crap. Now when he switched, you used that as evidence of pretty much the same thing. There just is no way to win…
#8 by Cedric on February 24, 2011 - 6:44 am
Mats,
I’m still confused by what you’re trying to say.
“I never said the Eclipse plugin was good.”
“it today indeed was really good.”
Which is it?
I think the Scala IDE plug-ins (Eclipse and to some extent, IDEA) are way behind where they could be. And I do think that the fact that Martin (and probably the rest of his team) wasn’t using the plug-in until recently is most likely a contributing factor to its disappointing shape.
I don’t think either of these claims are extravagant, and certainly not “bashing”. But to each their own.
#9 by Al on February 24, 2011 - 7:22 am
Fantom as a strong IDE support, no doubt about that 😉
Thx for the advice.
#10 by Joshua Hartman on February 24, 2011 - 7:33 am
Hi Cedric,
As another commenter mentioned, the IDEA plugin is much better than the Eclipse one. It can even perform some rudimentary conversion from Java code to Scala code. The Eclipse plugin has recently improved as well, so if you haven’t used it recently I’d suggest trying again.
If Martin starting using the Ensime plugin in Emacs, then he’s not far off. Ensime brings up a server for the emacs client to communicate with, giving emacs realtime syntax highlighting errors and the ability to understand the code. http://www.youtube.com/watch?v=A2Lai8IjLoY
For most users, I don’t think Scala’s type system is too complex. They won’t hit variance or abstract types for quite a while, and when they do, using classes with proper variance is much nicer than Java’s in my opinion. If your comment about the type system is directed towards the standard library’s heavy use of implicit parameters, then I agree the code there is complex. But I think a library is the right place to use more advanced code and features than an application. Do application designers in Java really even need to generics in their APIs? I’d argue not and by the same token, they shouldn’t be touching advanced Scala in most places.
I agree with you that it will be a very good thing if Martin starts working more closely with the Eclipse plugin. I do hope he doesn’t throw away everything Miles did though. I noticed the two debating some issues on the bug tracker and I’m doubt Martin is familiar enough with Eclipse to whip up something usable in a few months.
#11 by steve on February 24, 2011 - 7:36 am
Am I the only one who doesn’t have problems with IDE support? I did some heavy refactoring lately and was pretty impressed.
I just think that this “IDE support is awful” is not honest.
It is basically the “Scala is complex”++ and as soon as Odersky&Team have improved anything, it will be used against them.
They said “We will solve binary compatibility and provide tools to seamlessly migrate bytecode from one versions to another”
… and people went like “Scala always breaks compatibility”.
They said “We invested quite some time and knowledge to make the collection library more simple and consistent to use”
… and people went like “OMG the library implementation is too complex”.
Really, I’m getting a bit annoyed by people doing a
listOfImprovements foreach (improvement => println(“Scala is bad because ” + improvement.negate))
I think this behavior is even worse than just making things up about Scala.
#12 by Seth Tisue on February 24, 2011 - 7:39 am
ENSIME (ENhanced Scala Interaction Mode for Emacs) provides IDE features such as code navigation and completion, refactoring, etc for Emacs users.
Needless to say, it isn’t perfect and neither are the current GUI IDE plugins for Scala, but they continue to improve.
#13 by Toby on February 24, 2011 - 8:03 am
As much as I love Scala (to the point of being a fanboy), I’ll readily admit that it’s a very complex language that isn’t a good fit for most developers or most projects. The learning curve isn’t as steep as it is for languages like Haskell or Clojure, but it does take lots of time to become familiar with the various intricacies.
Some of the undue complexity behind Scala can be avoided by deliberately avoiding certain language features. For example, implicits can very easily lead to unreadable code that is extremely difficult to debug. Avoiding their use in all but the most necessary cases goes a long way towards making Scala more accessible. Such a situation is hardly ideal, but I think it’s a situation that appears in other languages as well. For example, Java’s finalizers are not guaranteed to run, so their use is not recommended in most cases – this is a strong divergence from C++’s destructors, but we take it for granted now. I think that as Scala matures, these sort of principles will become more established.
Tooling support is a sore point, and I think the language suffers for it. However, I think it’s somewhat unfair to expect tooling support to be at the level it is for Java now – remember that Java tooling, especially IDEs, didn’t reach the current level of maturity until 2004/2005. That’s nearly 10 years after the language first appeared. So by my estimation it’s not unfair to give Scala another 2 years to get the tooling down.
As a related point: Both Ruby and Python don’t have much in the way of tooling and IDE support either. Granted, due to their dynamic nature, such tools may be less useful, but it’s still an issue. Anecdotally, most developers I know who work in Ruby and Python tend to use Vim, Emacs, TextMate, or some other “dumb” editor.
#14 by Jonathan on February 24, 2011 - 8:47 am
One of the features that attracted me to Scala was traits. But as Jonathan seemed to allude to, Scala’s linearization algorithm is unnecessarily complex, where you really have to walk through the entire heirarchy of types/traits if you want to figure out what the invocation chain is going to look like. It’s just too much.
#15 by Razie on February 24, 2011 - 10:40 am
Did you try ENSIME? It made me try emacs for coding and it’s good, especially after switching the commands to VI mode 🙂
Your comment on being more productive with Eclipse than a text editor implies you don’t know what good code editors can do. Let me put it this way: moving your hand to reach the mouse slows you down.
Also, sure Martin is good, but not god! The IDEs can and should and do evolve even if he’s still using Emacs, man!
cheers
#16 by Cedric on February 24, 2011 - 10:47 am
Ensime is a good intermediate step, but there is only so far you can go with regexps.
#17 by Cedric on February 24, 2011 - 10:49 am
As for your comment about the mouse: moving the mouse has nothing, really nothing, to do with being productive while coding. Besides, most IDE’s have full keyboard support so you hardly ever have to leave the keyboard if you don’t want to.
Seriously, text editors are not even in the same league as IDE’s when it comes to being productive in a statically typed language.
#18 by Ara on February 24, 2011 - 10:57 am
Cedric, I agree with you that Fantom is the strongest successor to Java. It’s a very well-balanced language. I hope it takes off….
#19 by Josh Berry on February 24, 2011 - 11:05 am
You do realize that ENSIME doesn’t just rely on regexps, right?
#20 by Razie on February 24, 2011 - 11:28 am
I don’t quite follow. Can you give me an example of what Eclipse can do for a statically typed language that Emacs can’t?
Advanced debugging is cool, but that’s not where I spend most of my time. Refactoring? Content assisst? Underline errors? Browse to definition? What’s missing from Emacs?
#21 by Wille on February 24, 2011 - 11:34 am
It’s worth having some perspective regarding the tooling criticism: as I recall it (and I was around to recall it), the Java tooling and IDE’s available oh, around 2000 where not all sunshine and rainbows either. It’s been a long hard slog to get Java toolsets to the place they are today – I’d argue the first painfree Java IDE I used was Eclipse 3.0 back in 2004. Before then I had massive gripes with pretty much every IDE I came across.
..And Java was about 10 years old at that time.
#22 by Nirav Thaker on February 24, 2011 - 4:11 pm
I agree with Cedric. Tooling is not optional especially for statically typed languages like Scala. IBM/Sun learned this lesson from Microsoft, Initial Java tooling was primitive compared to Visual Studio. Part of Java’s success is its powerful tooling ecosystem like Eclipse (aka Visual Age), Net Beans, IntelliJ IDEA etc.
Vocal programmers who use Vim/Emacs for main development are not majority of programming community and should know that they do turn away a lot of programmers when they marginalize IDEs.
IMO, What Scala needs is a good presentation compiler (non-trivial effort I know) which other tools can use for features like semantic highlighting, automated correction suggestions (a la Ctrl+1 style) and so on. If SDT ever catches up with JDT, question of choosing Scala over Java would be moot.
#23 by Stephen Haberman on February 24, 2011 - 5:10 pm
As far as Fantom is concerned, I doubt the successor of Java will lack user defined generics. That’s like going back to Java 1.4.
#24 by Cedric on February 24, 2011 - 5:23 pm
Stephen:
That’s a fair point.
Personally, I wouldn’t mind trading user defined generics if I get in return type inference, closures, traits, properties, actors, .net support and Javascript generation.
And user defined generics are on Fantom’s road map, but I wouldn’t expect them for at least one or two years.
#25 by Seth Tisue on February 24, 2011 - 5:25 pm
“Ensime is a good intermediate step, but there is only so far you can go with regexps” is a nonsequitur. Ensime uses Scala’s presentation compiler; it’s not regexes.
#26 by Tom Davies on February 24, 2011 - 9:18 pm
Re Fantom — are you really prepared to give up generic types (aside from a few built in collection classes) ?
#27 by Mikael Ståldal on February 25, 2011 - 1:01 am
I agree that the plugins for Eclipse and IntellJ IDEA can certainly be improved (and most likely will soon).
But with the current version of them you are still more productive with Scala than you are with Java and its near-perfect IDE support, since Scala is such a better language than Java.
#28 by Mats Henricson on February 25, 2011 - 5:06 am
@Cederic *I* never said the Eclipse plugin was good. *Martin* does say that, implicitly, by telling people he has switched to it from Emacs. How can this be confusing?
#29 by Walter Chang on February 25, 2011 - 5:18 am
“This situation is pretty shameful, to be honest. Scala is about seven years old and the absence of decent IDE support after such a period of time is absolutely unforgiveable, especially given the ambitions of the Scala team.”
if i remember correctly, james gosling was still using emacs for java development until 3-4 year ago. there is nothing shameful about martin odersky using it, its just a personal preference.
#30 by Xiong Chiamiov on February 25, 2011 - 1:48 pm
Have you read http://osteele.com/archives/2004/11/ides ? It’s an interesting post on the difference between ‘tool mavens’ (that would be you) and ‘language mavens’. It came up in a Scala-related discussion on HN recently.
#31 by Nat on February 26, 2011 - 9:34 am
@Razie – the difference between working in a text editor and a modern IDE is the way that one actually performs programming. In a text editor, one programs by editing text. In an IDE one programs by performing automatic program transformations, only dropping down to editing text as a last resort if the tool does not implement the transformation you want automatically (or you haven’t yet learned how to make the tool perform the transformation). In modern Java IDEs, almost all programming can be done by combining automatic transformations, without editing text at all.
#32 by Anonymous Coward on March 1, 2011 - 7:08 am
It is very disappointing to see what should be top-notch developers opposing vi/Emacs to Eclipse/IntelliJ IDEA. It’s not like it’s one or the other: for a *lot* of Java-related things, IntelliJ IDEA’s editor rocks the day. But for some other things it *really* sucks compared to Emacs. What do I do then ? Well, in one shortcut I switch from IntelliJ IDEA to Emacs, do my stuff-that-only-Emacs can-do-blazingly-fast-and-that-non-Emacs-users-do-painfully-wasting-precious-time and then, poof, another shortcut and I’m back to IntelliJ. Both my IntelliJ and my Emacs are configured to synch files automatically upon gaining focus (this requires a setting in Emacs). So, please, both camps, lighten up and admit the facts: it’s not one or the other if you want to be the most productive, it’s BOTH. My dream is the day IntelliJ’s editor with be replaced with Emacs (reducing Emacs to a “text editor” is silly in itself) and yet show the shiny IntelliJ icons and offer the IntelliJ shortcuts etc. In other words: one day we’ll have the best of both world. I’m close to it by using both Emacs and IntelliJ.
Pingback: Fantom and user defined generics « Otaku, Cedric's blog
#33 by Steven Shaw on March 1, 2011 - 7:24 pm
Fantom is pretty cool, not so much as a language but as an implementation that targets 3 great platforms .NET, Java and JS. Fantom is no Scala. You must be sick of all the Scala fanboi’s beating up on you ;).
#34 by Razie on March 2, 2011 - 7:10 am
@Nat – what does that mean? Did I miss some evolution of Java programming in the past decade? Sorry, but the meaning of that entire comment eludes me…
Are you refering to some MDD model transformation stuff? Or some code-generating Web frameworks?
@AnonymousCoward: +1
#35 by zefi on March 2, 2011 - 8:58 pm
Fanboi(s): I can has nails?
#36 by Frank Bolander on March 3, 2011 - 7:10 am
I think it should be noted that the author in fact did not go back to Java, he used Stratego/XT to GENERATE Java.
#37 by David H on March 22, 2011 - 5:49 pm
Hi Cedric, I’m a college student majoring in computer science who happened to find your blog post, which I found to be very interesting.
May I ask why you think the functional aspect of Scala makes it complicated, and why do you say that it turns people off? Do you have some sort of prejudice against the functional paradigm in particular?
#38 by Alain O'Dea on May 4, 2011 - 2:39 pm
Thank you for the link to a very interesting discussion of the migration challenge from Java to Scala and the hurdles that are holding people back or pushing them away.
My response got quite long so I have a more complete treatment on my blog:
http://concise-software.blogspot.com/2011/05/java-to-scala-in-pursuit-of-intention.html
#39 by Alex Kovar on August 12, 2011 - 4:18 pm
Hey Cedric,
Just wondering what your thoughts are on the tooling support after the 2.9 release and recent scala IDE release.
My thoughts on the tooling were pretty similar until I made the recent upgrade. Seems like the eclipse plugin has really made some major strides in closing the gap with java. Some of the only major features I find still lacking are quick fixes and type searching.
Also, I’m confused at why you are disappointed about the fact that Martin just recently stopped using emacs. Seems to me like this is a good thing as it signals a maturing of the eclipse plugin. I’d probably be more disappointed to learn that he had been using the eclipse plugin all this time and was fine with it. According to your opinion that switching from an editor to IDE boosts productivity, you would think this would begin a period of increased productivity on his behalf in moving the language forward.
Alex
#40 by rmxz on August 14, 2011 - 10:18 pm
Your bashing on text editors amazes me. With a bit of configuration I find emacs far more productive than any IDE.
Thanks to emacs’s customizability, with 2 keystrokes it will do-the-right-thing for whatever project I’m working on. For some projects that’s “run the unit tests; if they pass, deploy to a test server and restart the test web server; if they fail, show me the line where they failed”. For other projects it’s “restart the program running under a debugger”. For others, it’s “load the page in Firefox and Chrome and IE”. For others it’s “rebuild a kernel and boot a new Virtual Machine using it”.
Colleagues do similar with vi macros + supporting shell scripts.
IDEs get you about half-way there — usually with a “save and run under a debugger” button — but I’ve yet seen one that works well from everything from HTML pages to linux kernels.
#41 by lick-my-monads on September 20, 2011 - 2:10 am
I have just spent about 2 days trying to figure out if anything justifies the ‘jump to scala’. the answer is NO.
the language was designed in an ivory tower by (1 or more) academics. Scala and the rest of the FP gang can lick my Monads.
#42 by lick-my-monads on September 22, 2011 - 8:37 am
o.k. sorry about that comment. scala looks pretty good, it’s just frustrating when I have to add this to my ‘things to do’ when I already have enough. I guess it’s possible to avoid the gnarly parts of the language, and as I have just found out the Intellij IDEA IDE seems to work, but I’m still having a few glitches…. I sure hope the language stabilizes soon, I can’t make sense of these cryptic errors….
I guess I don’t really want the FP gang to lick my monads, since I don’t really get into that anyways and besides, most FP programmers are men….
#43 by Ferran on December 15, 2011 - 1:26 pm
For me, learning Scala has opened my eyes about what Java lacks. Unfortunately, the quality of Scala plugins is not enough to make the jump (at least the last time I tried them), but I really wish they improve. When it happens, no doubt I will start using Scala in my projects.
Scala may be complex but, as some say, you usually don’t need to use the advanced concepts, the same way you usually don’t need to use the complex Java generics syntax like <A>.
#44 by Ferran on December 15, 2011 - 1:53 pm
In my previous post I meant to put a complex generic syntax and by mistake I only put … 🙂 Well, I suppose you understand what I wanted to say.