在另一个问题中,Mark高度评价了ide,说“有些人仍然不知道”为什么“他们应该使用一个……”。作为一个使用vim进行编程的人,并且在大多数/所有同事都使用vim或emacs进行所有工作的环境中工作的人,ide的优势是什么?我为什么要用它?

我相信这对一些人来说是一个棘手的问题,我对开始一场论战不感兴趣,所以请只回复你认为基于ide的方法更好的原因。我对听到为什么我不应该使用IDE不感兴趣;我已经不用了。可以这么说,我感兴趣的是听取“栅栏的另一边”的意见。

如果您认为ide可能适合某些类型的工作,但不适合其他类型的工作,我也很想知道为什么。


当前回答

I'm not sure there's a clear dividing line between a text editor and an IDE. You have the likes of Notepad at one end of the scale, and the best modern IDEs at the other, but there are a lot of thing in between. Most text editors have syntax highlighting; editors aimed at programmers often have various other features such as easy code navigation and auto complete. Emacs even lets you integrate a debugger. The IDEs of even ten years ago had far less features to help programmers than you'd expect of a serious text editor these days.

其他回答

这取决于你使用的语言,但在c#和Java中,我发现ide对以下方面有好处:

Quickly navigating to a type without needing to worry about namespace, project etc Navigating to members by treating them as hyperlinks Autocompletion when you can't remember the names of all members by heart Automatic code generation Refactoring (massive one) Organise imports (automatically adding appropriate imports in Java, using directives in C#) Warning-as-you-type (i.e. some errors don't even require a compile cycle) Hovering over something to see the docs Keeping a view of files, errors/warnings/console/unit tests etc and source code all on the screen at the same time in a useful way Ease of running unit tests from the same window Integrated debugging Integrated source control Navigating to where a compile-time error or run-time exception occurred directly from the error details. Etc!

所有这些都节省时间。这些事情我可以手动完成,但会更痛苦:我宁愿编写代码。

我使用Emacs作为开发和邮件/新闻的主要环境已经有大约10年了(1994-2004)。当我在2004年强迫自己学习Java时,我发现了IDE的力量,令我惊讶的是,我实际上喜欢IDE (IntelliJ IDEA)。

我不会详细说明原因,因为很多原因已经在这里提到过了——只要记住,不同的人喜欢不同的功能。我和一个同事使用同一个IDE,我们都只使用了可用功能的一小部分,我们都不喜欢彼此使用IDE的方式(但我们都喜欢IDE本身)。

但是我想强调的是ide相对于Emacs/Vim相关环境有一个优势:您可以花费更少的时间安装/配置所需的特性。

使用Wing IDE(适用于Python),我可以在安装后15-20分钟开始开发。不知道我需要多少小时才能让我使用的特性在Emacs/Vim中运行。:)

我喜欢IDE,因为它能在我的指尖提供很多功能。编辑/编译/项目中文件的可见性是我在IDE中所看重的一切。我现在使用Visual Studio,但在以前我使用slikedit,并发现它使我的开发过程比我不使用它时更流畅。

ide基本上是:

编辑器/代码完成,重构和文档 调试器 文件系统资源管理器 scm的客户 构建工具

都在一个包里。

您可以使用单独的工具或出色的可编程编辑器和额外的工具,如Emacs(也可以使用Vim,但IDEbility IMO稍微少一些)来实现所有这些功能(以及更多功能)。

如果您发现自己经常在一个实用程序和下一个可以集成到环境中的实用程序之间切换,或者如果您缺少这里列出的一些功能(其他文章中有更完整的功能),那么可能是时候转移到IDE了(或者通过添加宏之类的方法来提高环境的ideability)。如果你已经用一个以上的程序构建了一个“IDE”(在我上面提到的意义上),那么就没有必要转移到一个真正的IDE。

拥有IDE有以下优势:

编译通常是“动态的”,这意味着不再切换到命令行进行编译 调试是集成的,在IDE中拥有调试意味着步进调试器实际上使用就地编辑器来直观地显示执行了哪些代码 IDE通常对您正在使用的语言具有更多的语义知识,并且可以在输入时向您显示可能出现的问题。重构比“搜索替换”强大得多。

还有很多,也许你应该试试。