Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
For my own edification, would you mind elaborating on what you consider to be "decent refactoring support"? What exactly is it? How would you use it?

What I mean by refactoring support is the ability to do safe automated refactoring.

For example in the Java world tools like Eclipse allow you to do extract method, push methods up/down the class hierarchy, add/remove attributes, etc. automatically. They become operations on the same level of granularity as "indent block", give you sensible error messages if the refactoring is impossible, and always work.

In Perl if I want to extract a method I have to select the code I want as a separate method. Wrap in in sub {}. Figure out what local vars it needs and pass them as arguments. Figure out what local vars it creates/changes and are used by the rest of the method and return them as results. Add the call to the new method into the old code. Spend a second or two looking at it to make sure I've not missed anything. Re-run the tests just to be sure.

If I'm writing Java in IntelliJ all I do is select the code I want as a separate method, hit Ctrl-Alt-M, type in the new method name and hit return.

It takes longer to describe that it does to do. The IDE does all the tedious make-work for me and it always works so I don't have to spend brain power catching my own typos or running tests to make sure that I didn't break anything.

This is just one example, but I hope it indicates how much developer time decent automated refactoring tools can save. Working without them is like working with an editor that forces me to indent blocks of text by moving the cursor to the start of each line and typing four spaces.

Fortunately Perl makes me more efficient in other ways, so it's still worth while. However I'd really like to be even more efficient - so good refactoring support is top of my list of wishes for my mythical ideal Perl development environment.

The problem is that doing decent refactoring support in Perl is non-trivial. Partly because of the only-perl-parsing-perl problem. Partly because of it's TMTOWTDI nature. Partly due to its flexible runtime nature.

The closest we have at the moment is EPIC/Devel::Refactor which only gives us a fair stab at method extraction. We do now have PPI which is an impressive piece of work and may make future development of Perl refactoring tools considerably easier.

I imagine that Perl 6's explicit grammar is going to make refactoring support considerably easier for that for Perl 5. Still tricky, just not completely insane :-)

In reply to Re^3: Features missing in perl IDEs? by adrianh
in thread Features missing in perl IDEs? by BUU

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others rifling through the Monastery: (6)
    As of 2018-06-19 03:02 GMT
    Find Nodes?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?

      Results (111 votes). Check out past polls.