Joe White’s Blog

Life, .NET, and Cats


Comments on the survey #2: Refactorings

The survey had little room for comments, so here are mine, starting with refactorings.

Delphi’s refactorings are crap. They leave you with non-compilable code more often than not.

A few examples of brokenness off the top of my head:

  • Class Completion got broken in CDS 2007. It usually completes stuff into the wrong class.
  • Class Completion mangles your visibilities if you ever try to use strict private or strict protected.
  • Delphi’s refactorings still don’t work across units if you don’t have every single unit explicitly added to your project file, so a Rename will usually break the build.

And that’s just the brokenness, not the suckiness. Extract Method still won’t do functions, but that’s just an annoyance. Automatic variable declarations usually get the wrong type, but that doesn’t break code that already compiled. What’s utterly unacceptable is that there are cases where the “refactorings” actually make previously-working code stop compiling.

Pretty much our entire team just ignores Delphi’s refactorings, because we know they’ll usually break our code. Please, please, please, put some effort toward making the refactorings work. In this day and age, we should not have to refactor by hand.

9 Responses to “Comments on the survey #2: Refactorings”

  1. Brian Kohrs Says:

    I have submitted QC tickets for most of these behaviors.

    http://qc.codegear.com/wc/qcmain.aspx?d=56993
    http://qc.codegear.com/wc/qcmain.aspx?d=58322
    http://qc.codegear.com/wc/qcmain.aspx?d=58323

    So go forth and vote.

  2. Lex Y. Li Says:

    The rename issue is so big that I give it up soon. However, it is so often that I need to rename something across projects.

    I guess that’s why Castalia still has chances to sell more copies. But why cannot CodeGear make default refactorings better? Wish they could do things well in Tiburon.

  3. David Novo Says:

    ModelMaker Code Explorer is cheap and does everything above perfectly. Since the choice seems to be:

    1. Complain and complain for years hoping this ever gets fixed in the IDE and in the meantime not using refactorings.
    2. Spend $99 Euro and get Code Explorer.

    The choice seems a no brainer to me. The efficiency improvement when using this tool (I have not tried Castalia but it may be similar) is well worth the money.

    Of course, using this does eliminate the fun one can have by bashing CodeGear for years and years :-)

  4. felix colibri Says:

    the brown menu on the left overwrites about 10 characters of left of the center content on a 1024 screen

  5. Joe Says:

    Felix: That’s an IE bug that I haven’t worked around yet. For now, you can either use FireFox, or look at the blog’s front page — it’s fine there.

  6. Xepol Says:

    Useful for renaming a variable inside a procedure. I think that is about all I use it for myself tho.

  7. Joe Says:

    Rename usually works fine within a single source file — as long as you’re not renaming an overridden method.

    For variables within a single method, I usually use SyncEdit instead. Rename leaves that stupid refactoring window to clutter up my screen; SyncEdit doesn’t.

  8. william Says:

    Wonder if anyone tried the design pattern in Delphi… The generated codes template seemed to be fine for .NET but I doubt some of them are actually not working as expected for Win32…

  9. Joe White’s Blog » Blog Archive » Comments on the survey #3: .NET Says:

    […] already talked about the lack of refactoring tools for Delphi. Visual Studio, on the other hand, has two big things going for it here. #1, it has a handful of […]

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


Joe White's Blog copyright © 2004-2008. Portions of the site layout use Yahoo! YUI Reset, Fonts, and Grids.
Proudly powered by WordPress. Entries (RSS) and Comments (RSS).