Why is Visual C++ lacking refactor functionality?

后端 未结 11 1336
慢半拍i
慢半拍i 2020-12-12 20:15

When programming in C++ in Visual Studio 2008, why is there no functionality like that seen in the refactor menu when using C#?

I use Rename constan

11条回答
  •  孤城傲影
    2020-12-12 20:47

    There is a lot of fud and confusion around this issue. This amazing youtube video should clear up why C++ refactoring is hard: https://www.youtube.com/watch?v=mVbDzTM21BQ

    tl;dr Google refactors their entire 100 million line C++ codebase by using a compiler (Clang + LLVM) that allows access to its intermediate format.

    Bottom line, third parties are screwed here, there is no realistic way for them to refactor VS C++ unless MS outputs intermediate results the same way. If you think of it from the programming problem perspective this is obvious: in order to refactor VS C++ you have to be able to compile C++ the exact same way VS does with the same bugs, limitations, flaws, hacks, shortcuts, workarounds, etc. The usual suspects like Coderush and Resharper do not have the budget for that kind of insanity although apparently they are trying but it has been years...

    http://www.jetbrains.com/resharper-cpp/

    Update 2016: Resharper now does a decent job at C++ refactor. Limitations are purely for large / gigantic projects.

提交回复
热议问题