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?"
You bums should use C#.
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?
They way things seem recently they'll file a patent in short order.
Personnally I think pico, nano, and notepad are the best refactoring tools out there, and two of these were commercial apps so I don't see how this is the 'first' commercial refactoring tool.
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.
we know it, we get over it. There's no unix version so I guess I won't even try this tool. Seems pretty sad that we can write a compiler but not a simple refactoring tool, but hey, no-one ever said parsing C++ was easy.
How we know is more important than what we know.
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
With VC.net being virtually the only viable C development suite(Borland is dead last I heard, and sucked anyway...CodeWarrior or whatever, isn't even worth considering) for Windows, its a good start...though a bit of a deviation from "The trueness" of open source software combined with compilers being made by CPU manufacturers...making RISC, etc. designs much easier, and getting rid of that pesky x86 thing...hell, I could design a better architecture, I would if I had the tools, already got a couple ideas on how to revamp the register structure for shorter instruction length and faster code(and no I dont mean just add more, faster, wider registers)
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."
Imagine a scenario like this: for(int i = 0 ; i < 10 ; i++) { ...
}
If you do search and replace for i, you'll break the "int".
That's where refactoring steps in.. it's sometimes just search'n'replace, but usually much more. Imagine renaming a field with OO features like inheritance and you should start to see the bigger picture.
> 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.
You toss around demands like "while I type" and "without running a code through a compiler." Now tell me just what you think is going to be doing the checking.
Detecting the examples you gave require at least a parser, and some minimal semantic analysis. Parsing takes up the bulk of compiling time in C and C++, and you're not going to get that in a heartbeat.
How often is this mini-compiler supposed to check your code? Constantly? It'll be siliently getting errors in the background, as it waits for you to type the closing parenthesis and ending semicolon, and the CPU will be pegged as soon as you start the editor, but you'll get your red lines "as you type"... more or less.
Parsing is expensive. There's a reason why syntax highlighting doesn't go beyond heavy regexing.
You cannot apply a technological solution to a sociological problem. (Edwards' Law)
... if you read the description of the features that they've added, it isn't as impressive (to me, at least) as you would believe from the magic moniker "refactoring". They merely provide automation to refactoring tasks you could do by hand but which are more time consuming.
The comparison with a compiler is specious. Perhaps a better comparison would be to a macro assembler. But even then, the fact is the editor is not doing anything more than the body sitting on the other side of the keyboard.
What would be interesting, and what wasn't clear from the marketing noise on the site, is whether the editor is performing semantic analysis of the code to deal with aliasing and other issues that crop up when refactoring by hand.
This is not to say these functions aren't useful: they are. But they don't just spin through your code and rewrite it for you. You need to know what you're doing.
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 thought together supports C++ refactoring, but I have only used it for C#. I can't afford the full blown version :(
n de x.html
Quoting:
"Refactoring
Support for Refactoring at Class, Attribute and method level. Refactoring means rewriting existing source code with the intent of improving its design rather than changing its external behavior. The focus of refactoring is on the structure of the source code, changing the design to make the code easier to understand, maintain, and modify. The primary resource book on refactoring is Refactoring -- Improving the Design of Existing Code by Martin Fowler (Addison -Wesley, 1999). "
http://www.borland.com/together/controlcenter/i
My emacs lost the race :(
--
Your GOD in 2004
A major drawback for using this tool is the company deliberately makes it hard to find the documentation to use the tool for novices, you cannot find it on their website. Getting a simple c++ program to compile on this can be nightmare to a new user.
x tProductID=M39+017W
Here is one place that sells the documentation
http://www.programmersparadise.co m/Product.pasp?txtCatalog=Paradise&txtCategory=&t
Their website does not sell the their own documentation.