3 ms·
I 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 wr
by anonymoushn 13y ago
I 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.