- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Why is current Scala refactoring support poor in IDE?
Sat, 2011-09-17, 18:31
I’ve read a David Pollack rant, saying that Scala refactoring support
could never be good. Is it true? I can’t figure why it should be the
case. Could you explain me (or post links to explainations) what makes
Scala code more difficult to refactor than Java code?
Sat, 2011-09-17, 22:27
#2
Re: Why is current Scala refactoring support poor in IDE?
On 17 September 2011 19:31, Julien Richard-Foy <julien.rf@gmail.com> wrote:
Julien,
It would help to post a link to resource you are referring to and quote specific points.
In general: I happen to sit next to guys working hard on Scala IDE for Eclipse plugin. My observation is that Scala as a language doesn't pose that many problems. Most of the time being spent these days is on improving interoperability with Java in graceful way given the fact that Eclipse doesn't provide any sensible APIs for implementing such functionality.
That's where weeks of work are put and not on supporting Scala language. That's the job of scala compiler and it does it pretty well.
--
Grzegorz Kossakowski
I’ve read a David Pollack rant, saying that Scala refactoring support
could never be good. Is it true? I can’t figure why it should be the
case. Could you explain me (or post links to explainations) what makes
Scala code more difficult to refactor than Java code?
Julien,
It would help to post a link to resource you are referring to and quote specific points.
In general: I happen to sit next to guys working hard on Scala IDE for Eclipse plugin. My observation is that Scala as a language doesn't pose that many problems. Most of the time being spent these days is on improving interoperability with Java in graceful way given the fact that Eclipse doesn't provide any sensible APIs for implementing such functionality.
That's where weeks of work are put and not on supporting Scala language. That's the job of scala compiler and it does it pretty well.
--
Grzegorz Kossakowski
Sat, 2011-09-17, 23:47
#3
Re: Why is current Scala refactoring support poor in IDE?
On Sat, Sep 17, 2011 at 14:31, Julien Richard-Foy wrote:
> I’ve read a David Pollack rant, saying that Scala refactoring support
> could never be good. Is it true? I can’t figure why it should be the
> case. Could you explain me (or post links to explainations) what makes
> Scala code more difficult to refactor than Java code?
I think David is plain wrong. I'm guessing he alludes to the fact that
just parsing Scala with a grammar is not enough to make decisions
about refactoring, since there might be implicits in scope that become
out of scope once the refactoring takes place.
If you take a look at the leading refactoring project,
http://scala-refactoring.org/, you'll see, however, that it simply
relies on the compiler to produce the AST that will be used in the
refactoring.
Sun, 2011-09-18, 02:17
#4
Re: Why is current Scala refactoring support poor in IDE?
On Sep 17, 11:26 pm, Grzegorz Kossakowski
wrote:
> It would help to post a link to resource you are referring to and quote
> specific points.
You're right, here is the article: http://goodstuff.im/yes-virginia-scala-is-hard
That said, he does not show theoretical evidence explaining why Scala
code should be hard to refactor.
Thanks for your replies, I was wondering if there were kind of
intrinsic limitations, due to Scala nature, but it does not seem to be
the case.
Sun, 2011-09-18, 02:47
#5
Re: Re: Why is current Scala refactoring support poor in IDE?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 09/18/2011 11:11 AM, Julien Richard-Foy wrote:
> On Sep 17, 11:26 pm, Grzegorz Kossakowski
> wrote:
>> It would help to post a link to resource you are referring to and quote
>> specific points.
>
> You're right, here is the article: http://goodstuff.im/yes-virginia-scala-is-hard
Take it as "made up stuff."
>
> That said, he does not show theoretical evidence explaining why Scala
> code should be hard to refactor.
I can show strong theoretical evidence, supported by academic research,
that Scala code would be easier to refactor.
Sun, 2011-09-18, 03:17
#6
Re: Re: Why is current Scala refactoring support poor in IDE?
Basically, David is wrong. As Tony said, Scala should be *easier* to refactor than most other languages, it simply hasn't had the same amount of work put into it as Java has.
The reason for it being easier is two fold. First, Scala has a much stronger and more expressive type system than most languages. This gives a refactoring tool more information to work with. Second, and even more importantly, well-written Scala code tends to be pure, or very nearly purely functional. By definition, pure code is *vastly* easier to restructure, automatically or otherwise.
Daniel
On Sep 17, 2011, at 8:43 PM, "Tony Morris" wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 09/18/2011 11:11 AM, Julien Richard-Foy wrote:
>> On Sep 17, 11:26 pm, Grzegorz Kossakowski
>> wrote:
>>> It would help to post a link to resource you are referring to and quote
>>> specific points.
>>
>> You're right, here is the article: http://goodstuff.im/yes-virginia-scala-is-hard
>
> Take it as "made up stuff."
>
>>
>> That said, he does not show theoretical evidence explaining why Scala
>> code should be hard to refactor.
>
> I can show strong theoretical evidence, supported by academic research,
> that Scala code would be easier to refactor.
>
>
> - --
> Tony Morris
> http://tmorris.net/
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQEcBAEBAgAGBQJOdUzMAAoJEPxHMY3rBz0P07IH/jpeKhtmapXXuOA4tfLqsx1Q
> ja1kPkz4wuP9Da8zXqFltfTegoHXmmnqOck+sOSY3yYTBL9JzaCRSXWfTJcsRFwC
> Dr6aZe2ccIXB3QXrr27C9b3GMaEMftwr8SY2C+fgZvAbaXGefRLrOS54ndW4ObIb
> iRMyOMcAULQpZdRJbngGO8Cp1IrrGqz5VJTcCzmxSthq/SXYVWY7rJ10kTvilBri
> wVEd5KFOwKEwPtPpt3Xb96qzijxT46gDGzepSmhA1sFkR+wyG3JE4T+wY1YBuSuh
> 3WOSJHw8fPGr9M7nFFlFKRdniyR48Vb/jbN2iqm+ddOoyKPD+8QnaLP1zHHyIjA=
> =zcXw
> -----END PGP SIGNATURE-----
Sun, 2011-09-18, 17:07
#7
Re: Re: Why is current Scala refactoring support poor in IDE?
Unsubscribe
On Sep 17, 2011 9:11 PM, "Julien Richard-Foy" <julien.rf@gmail.com> wrote:> On Sep 17, 11:26 pm, Grzegorz Kossakowski
> <grzegorz.kossakow...@gmail.com> wrote:
>> It would help to post a link to resource you are referring to and quote
>> specific points.
>
> You're right, here is the article: http://goodstuff.im/yes-virginia-scala-is-hard
>
> That said, he does not show theoretical evidence explaining why Scala
> code should be hard to refactor.
>
> Thanks for your replies, I was wondering if there were kind of
> intrinsic limitations, due to Scala nature, but it does not seem to be
> the case.
Mon, 2011-09-19, 05:57
#8
Re: Re: Why is current Scala refactoring support poor in IDE?
IDEA doesn't seem to do too bad a job, although I did notice that refactoring a whole package to reside beneath another package didn't correctly update the package declarations in thesource files. But that may be already fixed...
On 18 September 2011 18:01, Shaun Sorrells <sorrells97@gmail.com> wrote:
On 18 September 2011 18:01, Shaun Sorrells <sorrells97@gmail.com> wrote:
Unsubscribe
On Sep 17, 2011 9:11 PM, "Julien Richard-Foy" <julien.rf@gmail.com> wrote:
> On Sep 17, 11:26 pm, Grzegorz Kossakowski
> <grzegorz.kossakow...@gmail.com> wrote:
>> It would help to post a link to resource you are referring to and quote
>> specific points.
>
> You're right, here is the article: http://goodstuff.im/yes-virginia-scala-is-hard
>
> That said, he does not show theoretical evidence explaining why Scala
> code should be hard to refactor.
>
> Thanks for your replies, I was wondering if there were kind of
> intrinsic limitations, due to Scala nature, but it does not seem to be
> the case.
Mon, 2011-09-19, 14:57
#9
Re: Why is current Scala refactoring support poor in IDE?
On Saturday 17 September 2011 19:37:05 Daniel Sobral wrote:
> If you take a look at the leading refactoring project,
> http://scala-refactoring.org/, you'll see, however, that it simply
> relies on the compiler to produce the AST that will be used in the
> refactoring.
As the author of scala-refactoring.org, I'd like to add a few things. I don't
think that creating refactorings for Scala is much harder than for Java,
things like type inference are irrelevant because I can access the AST of the
compiler with all types inferred. Scala's syntax is more flexible than Java
(semicolon inference, operator notation), so that makes code generation a bit
harder, but not that much.
If we look at a concrete refactoring, like Extract Method, then that's
actually easier to implement in Scala because we can return several values.
And we can nest methods, which also makes the refactoring more flexible. On the
other hand, implicit values that need to be passed to the extracted method
might make the refactoring more complex again, but in the end, I'm quite
certain that refactoring Scala isn't harder than Java. Do you have a specific
refactoring in mind that you'd like to discuss?
I've also created one of the first refactoring tools for Ruby (), and I can
tell you, that's much much harder because the language is not statically
typed, and languages like C++ with macros are also much harder than Scala, so
as a refactoring creator, I'm quiet happy with Scala and the tools (compiler)
it provides!
So, why aren't Scala's refactoring tools as powerful as Java's? That's easy:
we don't have enough people working on it :-) So if you want to contribute,
take a look at scala-refactoring.org.
Cheers,
Mirko
I don't know the answer :/