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?"
http://www.refactoring.com/tools.html
Creative Demolition
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.
Opinions on the Twiddler2 hand-held keyboard?
I, for one, am extremely uncomfortable with the idea of automated code refactoring in C++ for a number of very good reasons most of which have to do with those little yellow post-it notes that people keep leaving on my monitor with words like 'the' and 'when' written all over them in increasingly small, or decreasingly large, handwriting which makes me very nervous indeed.
Thank you.
Now wash your hands.
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!)
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.
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
Uh, the main page says "Supports Windows, Linux, UNIX" right smack dab in the middle of it.
Of course, it's a tough sell to try to fight emacs and vi...
May we never see th
IBM's VisualAge C++ has been around for a long, time. All the VisualAge products include powerful refactoring tools.
I just took a look at the specs and found the "refactoring"-features:
- Rename
- Extract Method
- Encapsulate Field
- Convert Local to Field
- Convert Global to Field Instance
- Convert Static Method to Instance Method
- Move Static Field
- Move Method
- Replace Literal with Constant
- Create Standard Methods
It does not seem overly complicated to me, to implement these.
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.
Just plain and simply marketing fuzz...
Keep open minded - but not that open your brain falls out...
how comfortable are people using an automated solution for refactoring
A fair number of proficient C++ programmers make a great living refactoring other peoples' mistakes.
In an average project, most objects and methods are still damn far from being prime.
"Provided by the management for your protection."
> How comfortable are people using an automated
> solution for refactoring
It is not possible to automate (as in "without any human intervention") refactoring because it requires understanding how the entire project works. Any tools you create may help, but they do not obviate the need for thinking and redesigning, the two tasks the computer is incapable of doing.
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
(tig)
Ignorance and prejudice and fear
Walk hand in hand
From Refactoring.com
What is Refactoring?
Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior. Its heart is a series of small behavior preserving transformations. Each transformation (called a 'refactoring') does little, but a sequence of transformations can produce a significant restructuring. Since each refactoring is small, it's less likely to go wrong. The system is also kept fully working after each small refactoring, reducing the chances that a system can get seriously broken during the restructuring.
...
So not really...
http://efil.blogspot.com/
I can't speak for C++, but in the Java world most of these checks are built into the IDEs. Eclipse needs to compile the source to show most errors (which it does every time you save a file). It's a bit of a pain in my opinion. I've gotten used to IntelliJ IDEA, which parses the file with every keystroke. I assume it doesn't do this from scratch each time, since it's still very responsive. It also keeps some sort of index in memory so it can quickly show bindings to other source code (this method is an implementation of this interface, for example). The markup for these links are updated with every keystroke without pegging the CPU.
That said, I doubt this is as feasible with C++. Java IDEs can use type information to provide these messages without any assumptions. Managed C++ may have access to these features, but I haven't played with that to know what type info is available.