用于 C++ 的 Netbeans 或 Eclipse?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/308450/
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
Netbeans or Eclipse for C++?
提问by Robert Gould
I'm currently working on a pet project and need to do C++ development on Windows, Mac, Linux, and Solaris, and I've narrowed it down to Netbeans and Eclipse, so I was wonderig which is more solid as a C++ editor. I just need solid editing, good autocompletion for templated code ad external libraries, and project file management, the build tools are external, so thats irrelevant here, for my comparison.
我目前正在从事一个宠物项目,需要在 Windows、Mac、Linux 和 Solaris 上进行 C++ 开发,我已经将其范围缩小到 Netbeans 和 Eclipse,所以我想知道哪个更可靠作为 C++ 编辑器。我只需要可靠的编辑、模板代码和外部库的良好自动完成以及项目文件管理,构建工具是外部的,所以这与我的比较无关。
Thus which is a better choice?
那么哪个是更好的选择呢?
Note: I know I should be using emacs or vim, but the issue is, my theory at least, that I'm left handed, so I use my right side (design,creativity) of the brain more than the left side (logic, memory), so I just simply cannot use emacs or vim, my brain simply isn't compatible, I tried them many times too, even used emacs for a few months but it drove me crazy...
注意:我知道我应该使用 emacs 或 vim,但问题是,至少我的理论是,我是左撇子,所以我更多地使用大脑的右侧(设计、创造力)而不是左侧(逻辑,内存),所以我只是不能使用 emacs 或 vim,我的大脑根本不兼容,我也尝试了很多次,甚至使用 emacs 几个月但它让我发疯......
Thanks
谢谢
采纳答案by Josh Kelley
I haven't used NetBeans, but Eclipse CDT (C Developer Tools, which includes C++), especially with the latest version, is really quite excellent:
我没有使用过 NetBeans,但 Eclipse CDT(C 开发工具,包括 C++),尤其是最新版本,真的非常出色:
- Syntax checking and spell checking
- Syntax highlighting that distinguishes between library calls and your function calls and between local and member variables and is even applied to code that's #ifdef'ed out
- Macro expansion that can step you through each level of macro application or show the final result even of very complex Boost Preprocessor macros
- A file and class outline view that updates dynamically to show where you are in a file. (Commercial IDE's I've used fail to do this.)
- Powerful, flexible Find/Replace and Find in Files features with complete Perl-style regex support. It's also supposed to be able to do a C/C++ Find in Files that can search based on language semantics (e.g., only find references, not declarations), although this sometimes doesn't work for me.
- Automatic tracking of TODO and other comment tags
- Mouseover tips that show the exact declaration of a variable or function, including any comments, instead of just where a variable or function is declared. (Again, commercial IDE's I've used fail to do this.)
- Support via plugins for Subversion, Doxygen, etc.
- Some refactoring support - rename, extract constant, extract function, a few others
- Code reformatter, based on user-definable code styles
- 语法检查和拼写检查
- 语法高亮区分库调用和函数调用以及局部变量和成员变量,甚至应用于 #ifdef 输出的代码
- 宏扩展可以引导您完成每个级别的宏应用程序或显示最终结果,即使是非常复杂的 Boost Preprocessor 宏
- 动态更新以显示您在文件中的位置的文件和类大纲视图。(我使用的商业 IDE 无法做到这一点。)
- 强大、灵活的查找/替换和在文件中查找功能,具有完整的 Perl 风格的正则表达式支持。它还应该能够在文件中进行 C/C++ 查找,可以根据语言语义进行搜索(例如,只查找引用,而不是声明),尽管这有时对我不起作用。
- 自动跟踪 TODO 和其他评论标签
- 鼠标悬停提示显示变量或函数的确切声明,包括任何注释,而不仅仅是变量或函数的声明位置。(同样,我使用的商业 IDE 无法做到这一点。)
- 通过插件支持 Subversion、Doxygen 等。
- 一些重构支持 - 重命名、提取常量、提取函数等
- 代码重新格式化,基于用户可定义的代码样式
You'd asked specifically about its editor; the Eclipse editor is good enough that I use it in preference to the commercial IDE for our product whenever I don't need the commercial IDE's forms designer.
你专门询问过它的编辑器;Eclipse 编辑器已经足够好了,当我不需要商业 IDE 的表单设计器时,我会优先使用它而不是我们产品的商业 IDE。
Eclipse's debugger integration (using gdb) is tolerable but not great, and its memory usage is high. A few features (like the C/C++ Find in Files) don't work reliably or require reindexing (which is time consuming) for no apparent reason, but the latest version seems more reliable in this regard.
Eclipse 的调试器集成(使用gdb)可以忍受但不是很好,并且它的内存使用率很高。一些功能(如 C/C++ Find in Files)无法可靠地工作或无缘无故地需要重新索引(这很耗时),但最新版本在这方面似乎更可靠。
Can someone who's used NetBeans fill in how it compares?
使用过 NetBeans 的人可以填写它的比较方式吗?
回答by Nazgob
I'm using Netbeans from time to time on Solaris and the latest (6.5) version is pretty neat. It has all the features that you need, perhaps autocompletion could work better, but I have a really bad code base so it might be the result of it. Keep in mind that you need strong machine for that, if it's your PC it's ok but Netbeans on a remote server (like I tried) is really slow unless you have a decent hardware. There are few simple refactorings for C++ with nice preview option, definitely worth a try.
我不时在 Solaris 上使用 Netbeans,最新的 (6.5) 版本非常简洁。它具有您需要的所有功能,也许自动完成可以更好地工作,但是我的代码库非常糟糕,因此可能是它的结果。请记住,为此您需要强大的机器,如果是您的 PC,那没关系,但是远程服务器上的 Netbeans(就像我试过的那样)真的很慢,除非您有一个不错的硬件。有几个简单的 C++ 重构,带有很好的预览选项,绝对值得一试。
You can get a whole Sun C++ pack from here: http://developers.sun.com/sunstudio/downloads/express/
您可以从这里获得完整的 Sun C++ 包:http: //developers.sun.com/sunstudio/downloads/express/
回答by Rob
Personally I prefer NetBeans - the project management is excellent and I was up and running quicker than with Eclipse. However, it is subjective and YMMV.
就个人而言,我更喜欢 NetBeans - 项目管理非常出色,而且我的启动和运行速度比使用 Eclipse 更快。然而,它是主观的和 YMMV。
回答by Nemanja Trifunovic
They are both bloated and slow, IMHO. Why don't you try Code::Blocksinstead? It is specifically aimed at C++ developers and performs much better than either Eclipse or NetBeans.
恕我直言,它们既臃肿又缓慢。为什么不试试Code::Blocks呢?它专门针对 C++ 开发人员,性能比 Eclipse 或 NetBeans 好得多。
回答by AndreasT
Just to give 2 cents to the comments about speed or performance issues with eclipse/netbeans:
仅对有关 eclipse/netbeans 的速度或性能问题的评论给予 2 美分:
The only part of an IDE that sucks if it is slow is the editor component. And in contrast to some obviously superficial assertions here, I found the editor component in Eclipse extremely snappy. The rest of the IDE is prone to lags, but the editor itself delivers spotless performance. I have a 1.4GHz Laptop and use Eclipse with it. Eclipse's editor component is faster (especially when scrolling/browsing through text) than Code::Blocks or KDevelop. The simple reason for this is: Eclipse caches everything, especially the syntax highlighting etc., other IDEs seem to try to do this ''live'' and fail. The c++ indexer was a cause of woe in versions past. It crashed when out of memory, without it none of the nifty search functions worked, etc. For the current version I can only say: It is all fixed and it works like a charm. It's speed is comparable to the VisualStudio Indexer.
IDE 中唯一糟糕的部分是编辑器组件。与这里一些明显肤浅的断言相比,我发现 Eclipse 中的编辑器组件非常活泼。IDE 的其余部分容易出现滞后,但编辑器本身提供了完美的性能。我有一台 1.4GHz 笔记本电脑,并使用 Eclipse。Eclipse 的编辑器组件比 Code::Blocks 或 KDevelop 更快(尤其是在滚动/浏览文本时)。原因很简单:Eclipse 缓存了所有内容,尤其是语法突出显示等,其他 IDE 似乎试图“实时”执行此操作并失败。在过去的版本中,c++ 索引器是一个灾难的原因。它在内存不足时崩溃,没有它,任何漂亮的搜索功能都无法工作,等等。对于当前版本,我只能说:它已全部修复,并且效果很好。它'
If you install Eclipse CDT you get a ton of nice features as has been explained in other replies already, that most other IDEs only provide with multiple plugins. (I don't know about netbeans, never used it.) The feature that kicks me everytime is the smart tooltip when I hover over some identifier. Eclipse gives me direct access to any javadoc that might be entered somewhere and the file where it is defined and even lets me scroll around inside the tooltip! So I have every identifiers full context at my fingertips, everywhere. I prefer it over Visual Studio and pretty much everything else I've tried.
如果您安装 Eclipse CDT,您将获得许多不错的功能,正如其他回复中已经解释的那样,大多数其他 IDE 仅提供多个插件。(我不了解 netbeans,从未使用过它。)每次让我感到震惊的功能是当我将鼠标悬停在某个标识符上时的智能工具提示。Eclipse 使我可以直接访问可能在某处输入的任何 javadoc 以及定义它的文件,甚至可以让我在工具提示内滚动!因此,我可以随时随地掌握每个标识符的完整上下文。我更喜欢它而不是 Visual Studio 和我尝试过的几乎所有其他东西。
Granted, everything else you do in the IDE could be snappier. For me, the crucial thing is, that the editor is fast and eclipse's definitely does a great job there.
诚然,您在 IDE 中所做的所有其他事情都可以更加快捷。对我来说,最重要的是,编辑器速度很快,而且 eclipse 肯定在这方面做得很好。
回答by darkhipo
If you run eclipse under linux you can use valgrind for memory leaks. Eclipse supports gdb well enough for me, but I couldn't find a decent memory leak plugin, and the valgrind integration plugin is in beta. This blog does a great tutorial for it: http://kapo-cpp.blogspot.com/2007/02/detecting-memory-leak.html. I cast my vote for eclipse on linux. P.S Real men use ed only.
如果您在 linux 下运行 eclipse,您可以使用 valgrind 来解决内存泄漏问题。Eclipse 对 gdb 的支持对我来说已经足够好了,但我找不到合适的内存泄漏插件,而 valgrind 集成插件处于测试阶段。这个博客为它做了一个很棒的教程:http: //kapo-cpp.blogspot.com/2007/02/detecting-memory-leak.html。我在 linux 上为 eclipse 投了票。PS 真正的男人只使用 ed。
回答by Geo
The only thing I hate about Netbeans is that the debugger is kinda slow in comparison to Eclipse . Besides that , Netbeans would be my choice .
我唯一讨厌 Netbeans 的是,与 Eclipse 相比,调试器有点慢。除此之外,Netbeans 将是我的选择。
回答by Johan Boulé
The c++ parser in code::blocks doesn't seem to be on par with netbeans and eclipse ones: according to code::block's wiki, it needs to be entirely rewritten.
code::blocks 中的 c++ 解析器似乎与 netbeans 和 eclipse 的不一样:根据code::block 的 wiki,它需要完全重写。
回答by h0st1le
For C++ I'd have to agree with Nemanja Trifunovic and say you should give Code::Blocksa look. It's free, and has great performance. I started using it a few years ago after switching from Bloodshed Dev-C++ (which is basically not supported anymore) and couldn't be happier.
对于 C++,我不得不同意 Nemanja Trifunovic 并说你应该看看Code::Blocks。它是免费的,并且具有出色的性能。几年前,我从 Bloodshed Dev-C++(基本上不再受支持)切换后开始使用它,并且非常高兴。
回答by Bill the Lizard
They're both excellent for C++ development, but one thing that I've recently found lacking in NetBeans is that there doesn't seem to be a plugin available for CppUnit, or any other C++ unit testing framework. I'd love to get some more responses to this questionif I'm wrong about that.
它们都非常适合 C++ 开发,但我最近发现 NetBeans 缺乏的一件事是似乎没有可用于 CppUnit 或任何其他 C++ 单元测试框架的插件。如果我错了,我很想对这个问题有更多的回答。
(Also, I know development is always going on for NetBeans, so maybe someone will come up with a plugin soon.)
(另外,我知道 NetBeans 的开发一直在进行,所以也许很快有人会想出一个插件。)