Slashdot Mirror


First Commercial C++ Development Refactoring Tool

swrittenb writes "According to their recent press release, SlickEdit Inc. announced Visual SlickEdit® v9, the first commercially available development tool with C++ refactoring. Although this area has been studied, and non-commercial refactoring tools for C++ exist, how comfortable are people using an automated solution for refactoring with this particular language?"

9 of 63 comments (clear)

  1. Refactoring other languages... by NEOtaku17 · · Score: 4, Informative

    http://www.refactoring.com/tools.html

  2. We're already comfortable with compilers by orthogonal · · Score: 5, Interesting

    how comfortable are people using an automated solution for refactoring with this particular language?"

    Well, when you consider that a compiler is also "an automated solution for [code] refactoring", I guess anyone using C++ (or any other compiled language) is reasonably conformable.

    Since there are no constructors or templates or multi-expression tests ( "if( a && b || c && d )") in any machine's assembly languages, we all trust our compilers to generate assembly language that corresponds to the high-level language constructs we've actually written -- and in the case of the control expression to that "if" statement, we trust the compiler to know and follow the operator precedence for the language being compiled -- and in C and C++, the required "short-circuit" evaluation too.

    That said, a good bit of that trust -- for C++ and C -- reposes in rigorous language standards and (more or less, I don't want to argue about language (mis)features or hacks for backward compatibility) well thought-out language designs.

    (That's one of the many benefits of a rigorous, documented language standard, by the way -- do you know if, in scripting language "S"( where "S" may be Perl, windows scripting host, visual basic, or what have you), short-circuit evaluation of logical operators takes place, or if there's a sequence point between each one? Not to bash any one language, but for Perl, deja-googling shows sequence points have been an unresolved issue since 1998.)

    To the extent that a refactoring tool's design is based on standards and on thoughtful and an open -- not proprietary -- processes that bring in opposing and skeptical views, as do the design of C and C++, I'd be reasonably willing to, in Reagan's words, "trust but verify". But if the refactoring tool is the proprietary product of a closed shop, I'll be far less confident that the Marketing Department didn't;t have too much of a had in product "design".

    But however the products comes to be, the proof remains in the use -- let's see how the automatic refactoring compares over several real-life projects before trying to judge.

    1. Re:We're already comfortable with compilers by Anonymous Coward · · Score: 5, Insightful

      Well, when you consider that a compiler is also "an automated solution for [code] refactoring", I guess anyone using C++ (or any other compiled language) is reasonably co[m]for[t]able. (I assume that's what you meant.)

      Nope, it's not the same thing at all. The transformation from high-level to low-level code is much simpler than the converse; that's why you can't decompile a native-code executable, even an unstripped one, and get beautifully formatted and readable code out of it.

      I trust my compiler to output valid machine code precisely because machine code is so simple. C++ is very complicated; if I were a C++ programmer (which I'm not, I prefer simpler and safer languages) I'd definitely be keeping backups of my unrefactored work for a while.

  3. SlickEdit. by Spudley · · Score: 4, Interesting

    I've used SlickEdit for a while, and it is a very nice tool (even if we call it SlackEdit at the office). Their Diff tools (DiffZilla, etc) are probably the best I've used anywhere.

    I've only had the chance to use it under Windows, but I understand there's Unix and Linux versions available too.

    My opinion: If you're going to pay for an editor, this is a good one to pick.

    When it comes to refactoring, I can't comment - I've not used this version, so the feature is new to me. It sounds like an interesting feature, but in honesty, I can't see us making much use of it.

    --
    (Spudley Strikes Again!)
  4. Sure, why not. by ndykman · · Score: 3, Insightful

    I don't have a problem with any refactoring tool if it allows me to see what changes it made (Kind of a no-brainer), and allows them to be undone if the results aren't too great after you do it. Even better is if they integrate with a tool's undo or redo, if they are hosted in an IDE like VS .Net, JBuilder, Eclipse, etc.

    Sure, it's tricky to insure that more complex refactorings do what they say, and sometimes they do change the semantics, but in a way you want. For example, moving methods up/down in a hierarchy.

    And the simple refactorings are still really useful. Rename X is just really, really nice.

  5. What I want by geirt · · Score: 5, Insightful

    I want a syntax cheker running while I am editing the source code.

    Example 1: When I am writing: "printf("Hello %d\n", "world");" I want a red line under "world", with a mouse-over stating: "Integer, not string expected in printf format string". I want this to happen while i type.

    Example 2: When writing: sinus(3.14); I want a red line under sinus(), with a mouse over explaining "Call to function sinus() without prototype" without running the code trough a compiler.

    I also want sane syntax highlighting. I want it to highlight the things that I look for when I am browsing trough lost of code. That is my function and variable names. All other should be kept in low key (eg. if while for int struct etc.). I am not sure if i want call to libc to be highlighted. Show me the important stuff, not the cruft! Editors are not too bad on this (or can be customized), but when I press print in emacs or use gnu enscript, it prettyprints all the wrong things, and hides away the important stuff.

    --

    RFC1925
    1. Re:What I want by Anonymous Coward · · Score: 4, Funny

      ..I want a syntax cheker..
      ..running the code trough a compiler
      ..I am browsing trough lost


      [cheapshot]
      I can't imagine why you feel you need a checker for the code that you type..
      [/cheapshot]

  6. Re:Marketroids at their best by manavendra · · Score: 4, Insightful

    Most of the features are simple search and replace operations. Just add some knowledge the compiler would have to the editor and it becomes quite easy to do

    hmm... lets examine them then.

    Rename
    So say you want to rename A::foo() to A::bar(). But foo() is private - so the tool has to look only in the current file, while for protected the file and its children, while the entire project if its public. While its rather easier to limit private and public members, how about protected? What if there is B::foo() as well? what if B::foo() is used in A?

    Extract Method
    This usually works when you select a piece of code and want to extract it to a method. search and replace? umm yes. How about the method sanctity? Wouldnt the tool need to ensure your extracted method is remains unbroken? what about the variables used in the selected segment? Are they declared within the selection?

    Convert Local to Field
    A::foo() has "myLocal", and so has A::bar(). Upon refactoring, should "myLocal" be replaced within with the new field in A::bar() as well?

    Convert Global to Field Instance
    A::Global is made a field. But A::foo() has a local variable Global defined as well. Should the tool do its job silently or inform you about this?

    Convert Static Method to Instance Method
    ditto

    I haven't read the specs of the tool, so I don't really know if it performs all this validation. I sure hope it does, if they want to sell it to anyone else other than mom and pop

    Just my $0.02

    --
    http://efil.blogspot.com/
  7. Re:We have shit tools by The+Infamous+Grimace · · Score: 3, Interesting

    There's no unix version so I guess I won't even try this tool.

    Um, in addition to Windows, it supports:

    Linux kernel 2.4 and up
    AIX 5 and up
    HP-UX 11 and up
    IRIX 6.5 and up
    Solaris SPARC 7 and up

    ...all of which are UNIX.

    (tig)
    --
    Ignorance and prejudice and fear
    Walk hand in hand