Saturday, May 20, 2006

Pain of C++ Refactoring, 2006

It was the end 2004 when I wrote about the "Pain of C++ Refactoring". What has changed?

Many hopes were held for Visual Studio 2005. It came out with first class refactoring support for C# folks, who by the way were already happy with beautiful ReSharper. For C++ people, the new Visual Studio was a big disappointment: no C++ refactoring whatsoever.

What else do we C++ developers have around in 2006? Well, not a whole lot.

Xrefactory crawled from version 2.02 to 2.08 with no major changes. Maybe for UNIX folks auto-completion and full undo are new and exciting features well worth $400, but I'm just too spoiled by Visual Studio to give up its usability for Emacs with primitive refactoring support by Xrefactory.

Ref++ Visual Studio plug-in grew a lot since I tried it last time, making its way to the top of Google. Under active development, it is $60 for a single license and may be worth a closer look. So far I am not aware of any team using it for real. If you do, please let me know.

SlickEdit is the new kid on the block. It comes as three products: a full blown code editor, an Eclipse plug-in, and a Visual Studio plug-in. To get it, I had to fill in the web form, register, give them my email, and wait for the trial key. When I finally installed the plug-in on VS 2003, it failed to do any basic refactoring on a two file project. The Slick broke its neck somewhere in STL because I dared to use stl::string! In frustration, I threw it away. Later, it turned out I was not the only one who uninstalled it in 20 minutes.

There are rumors that Eclipse C++ Plug-In will soon have some C++ refactoring, but 1) so far it is only rumors and 2) I don't see mainstream C++ developers migrating from Visual Studio to Eclipse.

Why is it that 7 (!) years after Martin Fowler published his "Refactoring" bestseller there is still no reasonable and recognized C++ refactoring tool? I think there are two reasons. First, C++ as a language is just too complex. Making a refactoring tool is a challenge, let alone making it perform reasonably. Second, C++ folks are outnumbered, and outdated. They are not doing refactoring, not interested in doing refactoring, and do not demand the refactoring tools. For software vendors, the market isn't worth the challenge.

A silver lining: C++ is not so bad. Try COBOL.

AddThis Social Bookmark Button

9 Comments:

At 7/21/2006 11:48:00 PM , Blogger Gerry Power said...

Dimitri - very good points. And Netbeans has released a preview of their C++ module, but alas no refactoring support in it's current form, or in it's stated milestone release schedule.

http://www.netbeans.org/products/cplusplus/

 
At 7/23/2006 08:17:00 PM , Blogger Marc Goodman said...

interestingly helpful.

hmm -- what have you settled on using these days (for your C++ refactoring needs)?

 
At 7/09/2007 01:48:00 PM , Anonymous Anonymous said...

You say Second, C++ folks are outnumbered, and outdated. They are not doing refactoring, not interested in doing refactoring, and do not demand the refactoring tools. For software vendors, the market isn't worth the challenge.

Oh, c'mon. Refactoring is a process and a frame of mind, not a set of tools. If you don't have spiffy tools, you use what you have.

Most refactorings are simply systematic global changes, and there are many ways to do that using cscope, grep, and sed.

 
At 8/19/2007 10:09:00 AM , Blogger Jeff said...

Rather a cheap shot at COBOL, probably by someone whose expertise does not include it within the last few decades.

Actually, there is quite a lot of COBOL refactoring going on - in COBOL. The COBOL 2002 standard includes support for refactoring, for OOP, for execution environments such as .NET, for interoperability with languages such as C++ and Java even absent a .NET-style environment. Personally, I'd rather have my payroll done in COBOL than C++....

also, check out http://www.acucorp.com/partners/ctp/ctp/raincode.php - wrap your mind around THAT and smoke it, fellas!

 
At 8/22/2007 05:08:00 AM , Blogger JAYARAM said...

I have done refectoring in C++ with sed, awk and and the compilation tool. The changes were
1) removing "" brackets for angular brackets to ensure the include path is strictly followed
2) removal of global variables which is very easy to find. Just remove it and compile.
As far as I know I don't think C++ are outnumbered. Real programmers settle down in C++ language. Personally I prefer C++ over JAVA because JAVA is a handicapped language. Please note in C++ the ease of refactoring depeneds how good your application build is implemented.

 
At 3/25/2008 05:32:00 PM , Blogger zeroin23 said...

Eclipse CDT refactoring is real, you should be able to see it probably by June.

How do I know? cause I am doing my internship with the team that is building the CDT refactoring.

http://ifs.hsr.ch/

 
At 1/02/2009 12:34:00 AM , Anonymous Anonymous said...

"Why is it that 7 (!) years after Martin Fowler published his "Refactoring" bestseller there is still no reasonable and recognized C++ refactoring tool?"

Contrary to what you may think, none of this stuff is actually new. People have been refactoring since the 70's. It works fine in languages like Smalltalk and Lisp. It doesn't work in languages like C/C++, and it barely works in Java, which is probably why it took until 1999 for Fowler and friends to reinvent the wheel.

 
At 3/26/2009 04:51:00 AM , Blogger Zaphodikus said...

C++ programmers are surely still in the majority, the fact that Jetbrains have not supported C++ does surely point to language parsing support issues.
Working in both languages I really miss the refactoring tool for C++, so I'm trying out Source Insight today; which helps loads with huge embedded C projects too. But I am not keen to fiddle with licensing yet another plugin since the Jetbrains plugin does work well already (whenever VS is not taking a long nap).

 

Post a Comment

<< Home