visual-studio 用于本机 C++ 开发的 C++ Builder 还是 Visual Studio?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 
原文地址: http://stackoverflow.com/questions/437416/
Warning: these are provided under cc-by-sa 4.0 license.  You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
C++ Builder or Visual Studio for native C++ development?
提问by Mick
I've decided I want to get more into native code development with C++. I'm trying to decide if I would be better served using CodeGear C++ Builder 2009 or Visual Studio 2008. I currently use Delphi 2007, so I'm very comfortable with C++ Builder's IDE (its the same as Delphi), as well as the VCL and RTL.
我决定要更多地使用 C++ 进行本机代码开发。我正在尝试决定使用 CodeGear C++ Builder 2009 还是 Visual Studio 2008 会更好。我目前使用的是 Delphi 2007,所以我对 C++ Builder 的 IDE(与 Delphi 相同)以及VCL 和 RTL。
I've never been a big fan of MFC (from the first time I played around with it in the VS 6.0 days), but haven't taken a close look at it since then.
我从来都不是 MFC 的忠实粉丝(从我在 VS 6.0 的日子里第一次使用它开始),但从那时起就没有仔细研究过它。
I'm interested in hearing from some experts that have experience with both IDE's, whether they are the most recent versions or not.
我有兴趣听取一些对这两种 IDE 都有经验的专家的意见,无论它们是否是最新版本。
Right now, I'm leaning towards C++ Builder because I believe the VCL is much more robust and easier to work with than MFC --- but as I said, it's been a while since I've used MFC. I'm not interested in building programs that rely on the .NET Framework because I'm partly teaching myself native development. Is MFC still king for Windows C++? Or is WTL or ATL the big thing?
现在,我倾向于使用 C++ Builder,因为我相信 VCL 比 MFC 更健壮且更易于使用——但正如我所说,我已经有一段时间没有使用 MFC 了。我对构建依赖于 .NET Framework 的程序不感兴趣,因为我部分地自学了本机开发。MFC 仍然是 Windows C++ 的王者吗?还是 WTL 或 ATL 是大事?
Any C++ gurus out there want to share their opinions?
有没有 C++ 专家想分享他们的意见?
EDIT: I understand MFC is not the only gui toolkit for Visual Studio. However, I'm looking for some recommendations based on GUI toolkit + IDE. For C++ Builder, there is only 1 real option, which is C++ Builder + the VCL. For VS 2008, it's VS + MFC/ATL/WTL/QT....confusing for me since I don't know much about them.
编辑:我知道 MFC 不是 Visual Studio 的唯一 gui 工具包。但是,我正在寻找基于 GUI 工具包 + IDE 的一些建议。对于 C++ Builder,只有 1 个真正的选项,即 C++ Builder + VCL。对于 VS 2008,它是 VS + MFC/ATL/WTL/QT ....让我感到困惑,因为我对它们知之甚少。
回答by Roddy
Coming from Delphi, you'll find the VCL straightforward to use with C++ Builder. There are a few oddities, like C++ doesn't hide the fact that TObjects are all really pointers (which Delphi hides from you), and some things like array properties are accessed differently.
来自 Delphi,您会发现 VCL 可以直接与 C++ Builder 一起使用。有一些奇怪的地方,比如 C++ 并没有隐藏 TObjects 都是真正的指针的事实(Delphi 对你隐藏了它),并且像数组属性这样的东西的访问方式不同。
Two or three years back, I was looking for any way out of C++Builder, but now, with recent releases (and Embarcadero's purchase of Codegear), I'm happy with the product and the direction.
两三年前,我一直在寻找摆脱 C++Builder 的方法,但是现在,随着最近的发布(以及 Embarcadero 购买 Codegear),我对产品和方向感到满意。
You'll find the number of string types and the assorted potential incompatibilities quite painful with C++Builder, but you'll get used to it! (std::string, char[], wchar_t[], TCHAR, AnsiString, WideString, UnicodeString and String to name a few)
您会发现使用 C++Builder 时,字符串类型的数量和各种潜在的不兼容性非常痛苦,但您会习惯的!(std::string、char[]、wchar_t[]、TCHAR、AnsiString、WideString、UnicodeString 和 String 仅举几例)
Personally I'd vote for C++ Builder - because of two-way RAD and the VCL, although it may not be the best way of learning modern C++ idioms.
就我个人而言,我会投票给 C++ Builder - 因为 RAD 和 VCL 是双向的,尽管它可能不是学习现代 C++ 习语的最佳方式。
回答by ctacke
Visual Studio and MFC are not the same. I use Studio all the time and I avoid MFC like the plague. You can use WTL, ATL, Win32 or any number of libraries to create apps without MFC.
Visual Studio 和 MFC 不一样。我一直在使用 Studio,并且像瘟疫一样避免使用 MFC。您可以使用 WTL、ATL、Win32 或任意数量的库来创建没有 MFC 的应用程序。
回答by Richard Harrison
The simple answer is that for pure C++ development it has to be VC++.
简单的答案是,对于纯 C++ 开发,它必须是 VC++。
To expand: as a pure C++ development environment you simply cannot beat VC++, the debugger is better, the IDE is superior (all IMHO, of course). I've used it to develop libraries that I then use from C++Builder because of these reasons.
扩展:作为纯 C++ 开发环境,您根本无法击败 VC++,调试器更好,IDE 更优(当然,恕我直言)。由于这些原因,我用它来开发库,然后我从 C++Builder 使用这些库。
However once you start into UI development, or anything that you can solve using the VCL or components C++B is the better choice. Compared to the VCL, MFC or ATL are horrible by comparison, and so that leaves you to use .NET, which is probably a better option, but not
但是,一旦您开始进行 UI 开发,或者您可以使用 VCL 或组件 C++B 解决任何问题,都是更好的选择。与 VCL 相比,MFC 或 ATL 比较可怕,因此您只能使用 .NET,这可能是更好的选择,但不是
I'm not sure that I'd recommend building a new product using C++B or Delphi based on the last few years of 'direction' from the vendors. However that appears to be changing for the better, but until a little more time has passed it is hard to tell how the promises translate into reality.
根据供应商最近几年的“方向”,我不确定是否建议使用 C++B 或 Delphi 构建新产品。然而,情况似乎正在好转,但直到时间过去了,还很难说这些承诺是如何变成现实的。
回答by MattyT
If you're doing pure C++ development on Windows then it's hard to beat VS. The compiler is fast, quite standards-conforming and produces well optimised code. The debugger is the best on any platform. The IDE is OK.
如果您在 Windows 上进行纯 C++ 开发,那么很难击败 VS。编译器速度快,非常符合标准,并生成优化良好的代码。调试器是任何平台上最好的。IDE 没问题。
It's also clearly the most widely-supported compiler toolchain on Windows. Download any open-source project/library and, if Windows is supported, it's likely to have been built and tested using VS. Its popularity also ensures that it's the most useful to have on a resume.
它显然也是 Windows 上支持最广泛的编译器工具链。下载任何开源项目/库,如果支持 Windows,它很可能是使用 VS 构建和测试的。它的受欢迎程度也确保它是最有用的简历。
What does Builder give you? A reasonable GUI library. Well, that's good but there are many other decent GUI toolkits out there (wxWidgets, GTK, Qt etc). Many are open source and cross-platform.
Builder 给你什么?一个合理的 GUI 库。嗯,这很好,但还有许多其他不错的 GUI 工具包(wxWidgets、GTK、Qt 等)。许多是开源和跨平台的。
However, these days I find it better to restructure my applications to provide an API and then build the GUI on top of it in a different language. C++'s strength is notin GUI development. At least not today...
但是,最近我发现最好重构我的应用程序以提供 API,然后在其上以不同的语言构建 GUI。C++ 的强项不在于 GUI 开发。至少今天不是……
I'd choose - and recommend - VS over Builder.
我会选择 - 并推荐 - VS 而不是 Builder。
回答by Andy Dent
I haven't used C++ Builder for years but on the topic of C++ debugging, Visual Studio 2008 is way out in front of other IDEs and previous VS especially if you use STL containers as it makes it very easy to inspect their content.
我已经多年没有使用 C++ Builder,但在 C++ 调试的主题上,Visual Studio 2008 远远领先于其他 IDE 和以前的 VS,尤其是如果您使用 STL 容器,因为它可以很容易地检查它们的内容。
However, on the GUI side, C++ is now very much a second-class language for Microsoft. The way of the future is WPF and C++ is not supported as a XAML-friendly language: We will continue investing in C++/CLI to enable developers to expose native C++ assets to the managed world and vice versa. We believe that pure .NET development is done best using a .NET focused language such as C# or VB. Investing in C++/CLI will be mainly in the native-managed interop areas.
然而,在 GUI 方面,C++ 现在在很大程度上是 Microsoft 的二等语言。未来的方式是 WPF 并且C++ 不被支持作为 XAML 友好的语言:我们将继续投资 C++/CLI,使开发人员能够向托管世界公开本机 C++ 资产,反之亦然。我们相信纯 .NET 开发最好使用以 .NET 为重点的语言,例如 C# 或 VB。对 C++/CLI 的投资将主要在本机管理的互操作领域。
So, to create a modern-lookingC++ GUI, your best option may indeed be VCL - if VCL continues to make such possible ;-)
因此,要创建具有现代外观的C++ GUI,您的最佳选择可能确实是 VCL - 如果 VCL 继续使这种成为可能;-)
回答by Sharad
C++ Builder is far superior than MS-VS when it comes to UI based development and Database oriented application. MFC sucks!! However VS has better debugging capabilities.
在基于 UI 的开发和面向数据库的应用程序方面,C++ Builder 远远优于 MS-VS。MFC 太烂了!!但是VS有更好的调试能力。
回答by Marcin Gil
Well, you can use Eclipse + MinGW + Qt4 + QT Eclipse Integration and you get all of the stuff: debugger, visual GUI designer, etc.
好吧,您可以使用 Eclipse + MinGW + Qt4 + QT Eclipse 集成,您将获得所有东西:调试器、可视化 GUI 设计器等。
Mind that Qt4 is dual licensed: Open Source and commercial license.
请注意 Qt4 是双重许可的:开源和商业许可。
Also you can combine Qt4 with Visual Studio (even with Express) and use all goodnes VS gives you.
您也可以将 Qt4 与 Visual Studio(甚至与 Express)结合使用,并使用 VS 提供的所有优点。
For me Qt4 is the way to go and VS over Builder.
对我来说,Qt4 是要走的路,VS 是 Builder。
回答by Piotr Dobrogost
I loved C++ Builder a couple of years ago. It was fantastic. It was a way better with its VCL than VS with its crappy MFC. Then things have been changing with every year.
几年前我喜欢 C++ Builder。太棒了。它的 VCL 比带有蹩脚 MFC 的 VS 更好。然后事情每年都在变化。
Builder has been going down; 1. Builder hasn't been updated with any real functionality. 2. Borland abandoned the idea of rewriting VCL in C++ for use with Kylix and Builder 3. CodeGear mess and uncertain future of Builder put many people off the product.
Builder 一直在倒闭;1. Builder 没有更新任何真正的功能。2. Borland 放弃了用 C++ 重写 VCL 以用于 Kylix 和 Builder 3 的想法。CodeGear 的混乱和 Builder 的不确定性让很多人放弃了这个产品。
VS has been getting better; 1. IDE has been improved a lot 2. Compiler from the least standard-compliant one on windows platform became the most standard-compliant (not counting GCC on MinGW of course) 3. .NET emerged and there was Managed C++ and then C++/CLI to make it possible to use this framework from within C++
VS 越来越好;1. IDE 改进了很多 2. 编译器从 windows 平台上最不符合标准的编译器变成了最符合标准的(当然不包括 MinGW 上的 GCC) 3. .NET 出现,有 Managed C++,然后是 C++/ CLI 使在 C++ 中使用此框架成为可能
We got new, strong players 1. Eclipse 2. Qt Creator
我们有新的强大的参与者 1. Eclipse 2. Qt Creator
and new GUI toolkits
和新的 GUI 工具包
- wxWidgets
- Qt4 now has also open source license
- 小部件
- Qt4 现在也有开源许可证
To summarize; Builder is dead because Borland
总结; Builder 已死,因为 Borland
- was thinking Delphi is so wonderful they don't really need anything else to earn money
- has fallen into Java hype and invested too much resources in it
- didn't understand great power of C++ and instead stack to pascal, which has always been academic language with no real products created with it
- 认为 Delphi 太棒了,他们真的不需要其他任何东西来赚钱
- 陷入了 Java 炒作,并在其中投入了过多资源
- 不了解 C++ 的强大功能,而是堆栈到 pascal,它一直是学术语言,没有用它创建真正的产品
回答by Greg Domjan
Just for the hell of it, can we throw in eclipse to the mix as well?
I just found working in eclipse to be better than working in visual studio.  
只是为了它的地狱,我们可以将 eclipse 也加入其中吗?
我刚刚发现在 eclipse 中工作比在 Visual Studio 中工作要好。  
Unless you are using VS2008 with winforms, the gui support is through windows templates (typically from resources) which is old hat and you probably don't want to use. So the gui support in VS2008 isn't that special.
除非您使用 VS2008 和 winforms,否则 gui 支持是通过 windows 模板(通常来自资源),这是旧帽子,您可能不想使用。所以 VS2008 中的 gui 支持并不是那么特别。
As for gui toolkit, perhaps see What is a good GUI/widgets toolkit
至于 gui 工具包,请参阅什么是好的 GUI/widgets 工具包
回答by user51568
I second going for C++ Builder, given that you already know Delphi. MFC has not changed much since the VS6 days, so code written using MFC still looks like shit. However, VS has changed and is now quite a good IDE.
鉴于您已经了解 Delphi,我第二次选择 C++ Builder。自 VS6 时代以来,MFC 没有太大变化,所以使用 MFC 编写的代码仍然看起来很糟糕。但是,VS 已经发生了变化,现在是一个相当不错的 IDE。
Also, keep in mind that C++ Builder is not stable as a product line. There have times in the past where it was not maintained/its future was not clear etc. So you're taking a chance if you want to build something that lasts.
另外,请记住,C++ Builder 作为产品线并不稳定。过去有些时候它没有得到维护/它的未来还不清楚等等。所以如果你想建立一些持久的东西,你就抓住了机会。

