Why is Visual C++ lacking refactor functionality?(为什么 Visual C++ 缺乏重构功能?)
问题描述
在 Visual Studio 2008 中使用 C++ 编程时,为什么在使用 C# 时没有在重构菜单中看到的类似功能?
When programming in C++ in Visual Studio 2008, why is there no functionality like that seen in the refactor menu when using C#?
我经常使用重命名,但当它不存在时,您真的很想念它.我确定您可以获得提供此功能的插件,但为什么在使用 C++ 时不将其集成到 IDE 中?这是因为必须解析 C++ 的方式存在一些问题吗?
I use Rename constantly and you really miss it when it's not there. I'm sure you can get plugins that offer this, but why isn't it integrated in to the IDE when using C++? Is this due to some gotcha in the way that C++ must be parsed?
推荐答案
C++ 的语法和语义使得正确实现重构功能极其困难.实现一些相对简单的方法来覆盖 90% 的情况是可能的,但在剩下的 10% 的情况下,这个简单的解决方案会通过更改您不想更改的内容来严重破坏您的代码.
The syntax and semantics of C++ make it incredibly difficult to correctly implement refactoring functionality. It's possible to implement something relatively simple to cover 90% of the cases, but in the remaining 10% of cases that simple solution will horribly break your code by changing things you never wanted to change.
阅读http://yosefk.com/c++fqa/defective.html#defect-8 简要讨论 C++ 中的任何重构代码必须处理的困难.
Read http://yosefk.com/c++fqa/defective.html#defect-8 for a brief discussion of the difficulties that any refactoring code in C++ has to deal with.
微软显然已决定为 C++ 开发这一特殊功能,让第三方开发人员尽其所能.
Microsoft has evidently decided to punt on this particular feature for C++, leaving it up to third-party developers to do what they can.
这篇关于为什么 Visual C++ 缺乏重构功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:为什么 Visual C++ 缺乏重构功能?
基础教程推荐
- 初始化列表*参数*评估顺序 2021-01-01
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- CString 到 char* 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
