在一開始發展程式的時候,也許思考的不夠周詳,在事後需要去做重構的動作,在VS.NET 2005上,C#及VB.NET都已有內建的工具,但C++卻沒有,因此只好尋找3rd Party的產品,試用了幾套工具後,覺得Ref++相當不錯,簡潔有力!

http://www.refpp.com/

Ref++ is an add-in for Visual Studio that provides a powerful set of refactorings for the C++ language.

A refactoring being a transformation to your source code that does not change your program behavior.

The more obvious refactoring is rename. Let’s assume that you want to change a class name. You’ll have to replace the class name with the new name wherever it appears: the class definition, references to the class, forward declarations, name of constructors, name of destructor but without modifying other code elements that happen to have the same name. That is exactly what Ref++ takes care of. Furthermore it lets you view and validate the modifications before they are applied to your source code and even then you may use the Visual Studio Undo command to return the source code to its original state.

Other refactorings work pretty much in the same way, only that they are more complex and may involve more interactions with the user.

Facebook Comments Box