5 ms·
This sounds great. I have not really used Scala before. 3 questions: - How good do IDEs understand Scala these days? Compared to C#/Java, where IDEs instantly
by julius 12y ago
This sounds great. I have not really used Scala before. 3 questions:
- How good do IDEs understand Scala these days? Compared to C#/Java, where IDEs instantly know a crazy lot about your code. I am looking at features like IntelliSense, marking wrong code, marking typos, marking unused code, telling me about unhandled Exceptions etc.
- Is there any difference, on the IDE side, between Scala support and Scala.JS support?
- Is a development cycle possible, where I save and I can instantly reload the page in my browser to see the differences?
- (Bonus Question) How well does it integrate with React. If my memory is not fooling me, Scala supports something like Inline-XML. Can I write React-Code, like I write JSX code with it? Any examples?
- sjrd 12y ago- IDEs for Scala are pretty good, nowadays. They do all of what you mentioned (except unhandled exceptions, because that's a Java-specific thing). - There's no difference between Scala and Scala.js support. To your IDE, Scala.js is Just Scala. - There is a development cycle, absolutely, and it's pretty fast! With Workbench (https://github.com/lihaoyi/workbench https://github.com/lihaoyi/workbench) you don't even need to reload the page: it does so automatically! - For React, there is essentially scalajs-react (https://github.com/japgolly/scalajs-react https://github.com/japgolly/scalajs-react). It does not support inline-XML per se, because it relies more on ScalaTags instead (https://github.com/lihaoyi/scalatags https://github.com/lihaoyi/scalatags), but at some point there was a proof of concept showing it was possible to implement with macros.
- danieldisu 12y agoYou have an alternative with a more closer syntax to the original one. https://github.com/xored/scala-js-react https://github.com/xored/scala-js-react
- caente 12y ago- How good do IDEs understand Scala these days? Compared to C#/Java, where IDEs instantly know a crazy lot about your code. I am looking at features like IntelliSense, marking wrong code, marking typos, marking unused code, telling me about unhandled Exceptions etc. IntellIj has a very nice plug-in, it will tell you a lot about your code, including suggestions of best practices. The down side is that the more "functional" your code gets, the slower IDE becomes(that's also true for Eclipse), but chances are that when that happens, you won't care about having an IDE. So IntellIj will be great to get you started, it does help a LOT. Is there any difference, on the IDE side, between Scala support and Scala.JS support? Not sure about this, it seems like you can just code in IntelliJ/Eclipse, but the debugging has to happen in the browser, it does work very nicely(you debug the scala code, not the generated javascript) I owe you the bonus question :-P
- egon_n 12y agoAn additional answer to your bonus question is https://github.com/xored/scala-js-react https://github.com/xored/scala-js-react Which allows the following syntax: @scalax def render(self: This) = { <div>Hello {self.props.name}</div> }
- the_af 12y agoLet me contradict the other answers with my personal experience: the two IDEs for Scala I know, Scala-IDE (Eclipse based) and IntelliJ are relatively bad. - They are very slow. - They have poor refactoring support (Scala-IDE's support is still marked as experimental; all but the simplest refactoring will often randomly break code, either by not doing a full refactor, or by introducing gibberish). - Until the latest version of Scala-IDE, you couldn't inspect variable contents while debugging. I can confirm the latest version does let you inspect variables, but I'm not sure how stable this is. - This is the killer disadvantage for me: both Scala-IDE and IntelliJ give spurious compilation errors pretty often, even for relatively trivial code. I know there are valid technical reasons why this isn't solved yet, but to me it's unacceptable that an IDE for a statically typed language gives spurious compilation errors: after all, compile-time errors are the main tool a statically typed language gives us. It's the one feature that absolutely must work correctly. - Even trivial autocomplete randomly stops working for Scala-IDE. This may be related to the spurious compilation errors. I've been told the unofficial recommendation from the Scala community is to disable incremental compilation in the IDE and compile with SBT. Consider what this says about the maturity of current IDEs.
- eweise 12y agoI program in Scala at work full time using Intellij and I'm having a great experience. No weird compilation errors, quick, responsive. Works almost as well as with Java files.
- the_af 12y agoAwesome. My own experience is more with Scala IDE, which is terrible. I tried IntelliJ for a brief time last year, saw it had spurious compilation errors, and the gurus at my office told me it was even worse than Scala IDE (but you know how gurus are...). Out of curiosity: - Do you have incremental compilation enabled with IntelliJ? - Do you ever experience a compile error in the IDE for code that SBT is able to compile successfully?
- eweise 12y ago