3 ms·
>You can also stay away from advanced / theoretical / crazy parts of Scala most of time. The parts that make it worth using in the first place? >You don't nee
by copergi 13y ago
>You can also stay away from advanced / theoretical / crazy parts of Scala most of time.
The parts that make it worth using in the first place?
>You don't need to use Scalaz, advanced type system features etc
Might as well stick with java then. You're not getting the benefits of scala vs java, but you are still paying the costs like compile times and poor tool support.
- playing_colours 13y agoI didn't experience "poor tool support" with Intellij IDEA. Java performance profiler also worked well, command line too. Maybe I am not very exacting. Sticking with Java you lose both the expressive Scala features and some good frameworks without Java burden. Btw under "advanced parts" I didn't mean "everything above Java". I enjoy immutability, collections, case classes, pattern matching, first class functions, lambdas, terse syntax not considered them "advanced parts". Advanced parts are all those lenses, recursive types, type lambdas, you know.
- anonymoushn 13y agoI used IntelliJ IDEA to write Scala for 2 years. Such complex operations as renaming a variable or getting a list of uses of a trait would frequently be done wrong, so I ended up checking the IDE's work every time. The Java-to-Scala tool emitted code that would never have compiled on any version of the Scala compiler. Using the IDE's auto-import feature would frequently end up importing * from a package, which would cause the file to see the wrong definition of some class name that occurs in multiple packages, so it was important to check the IDE's work even when the only task I gave it was to import a class.
- bad_user 13y agoI used IntelliJ IDEA for about 1 year and I never encountered a single instance in which this IDE got a rename wrong, or a "find usages" for a type. I also never got an importing wildcard to shadow some important definition that I was using from another package and in fact it bugs me that lately I can't get IntelliJ IDEA to do wildcards imports were it can, because I don't like dozens and dozens of imports from the same package. What it does wrong is when copy/pasting code or when moving a class/trait to another file/package, it sometimes misses the imports for the implicits that the code is using. You can't really blame it, since an imported implicit is not hard-wired in the same way an explicit reference or type usage is. Depending on your perspective, this may be a feature and not a bug :-) Either way, IntelliJ IDEA gives awesome in-editor error highlighting and you also have Scala's compiler to double-check things for you, so you really don't have to double-check the IDE's work, except in cases where there are problems. > The Java-to-Scala tool emitted code that would never have compiled on any version of the Scala compiler. It's pretty hard to translate from Java to Scala and you're right that it doesn't work. On the other hand, idiomatic Java code is pretty freaking far from idiomatic Scala code and I think you should either leave that Java code as is (mixed projects are easy to configure) or you should translate it in idiomatic Scala code by hand, a task that no transpiler could do.
- anonymoushn 13y ago> What it does wrong is when copy/pasting code or when moving a class/trait to another file/package, it sometimes misses the imports for the implicits that the code is using. You can't really blame it, since an imported implicit is not hard-wired in the same way an explicit reference or type usage is. Depending on your perspective, this may be a feature and not a bug :-) This does sound like a feature and not a bug, yes. > It's pretty hard to translate from Java to Scala and you're right that it doesn't work. On the other hand, idiomatic Java code is pretty freaking far from idiomatic Scala code and I think you should either leave that Java code as is (mixed projects are easy to configure) or you should translate it in idiomatic Scala code by hand, a task that no transpiler could do. I agree, but some of the team used IntelliJ's make and apparently our particular project configuration had trouble with Java in some projects, so where there wasn't much Java the solution we went with was to move it to Scala. There were other more reasonable solutions available like "Fix the config" or "Just use xsbt bro", but it wasn't my call.
- copergi 13y agoAlmost everything you listed as not in java is in java 8. Your distinction between "advanced" and "stuff I like" is a false one. Other people who aren't familiar with what you are familiar with will call those things "advanced". And when you learn those things you call "advanced", you will move them into the "stuff I like" category.
- saryant 13y agoOther than lambdas, almost nothing in that list is in Java 8.
- copergi 13y agohttp://www.infoq.com/articles/java-8-vs-scala http://www.infoq.com/articles/java-8-vs-scala
- saryant 13y agoThe only thing in that article that was also in playing_colour's list was lambdas. Which I already conceded as being in Java 8. Not sure what your point is.
- copergi 13y agoYou missed immutability, collections, and first class functions.
- saryant 13y agoJava 8 doesn't have immutable collections, nor would I consider Java 8's lambdas to constitute first class functions. Java 8 doesn't have function types, just functional interfaces.
- copergi 13y agoImmutability and collections were two separate list items. And "it doesn't count cause I don't want it to" doesn't really change anything.
- zenbowman 13y agoWhat makes Scala worth using is a good type system, pattern matching, excellent support for concurrency and powerful DSL capabilities. None of these are crazy or require you to write mind-bending code. Tool support is outstanding with IntelliJ
- copergi 13y agoScala has a poor type system, and poor support for concurrency. It's terrible DSL problem is not a selling point. Nothing he talked about was crazy or required writing mind-bending code, that is the point. IntelliJ's scala support is still, to this day, completely broken. Have you tried using it?
- zenbowman 13y agoYes, I use it daily. What are your issues with it?