适用于 Linux 的 C++ IDE? [英] C++ IDE for Linux?

查看:42
本文介绍了适用于 Linux 的 C++ IDE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的编程视野扩展到 Linux.一个好的、可靠的基础工具集很重要,还有什么比 IDE 更基础?

I want to expand my programming horizons to Linux. A good, dependable basic toolset is important, and what is more basic than an IDE?

我可以找到这些 SO 主题:

I could find these SO topics:

我不是在寻找轻量级 IDE.如果一个 IDE 物有所值,那么我会为它付费,所以它不一定是免费的.

I'm not looking for a lightweight IDE. If an IDE is worth the money, then I will pay for it, so it need not be free.

我的问题是:

有什么好的 C++ 编程 IDE 可用于 Linux?

最低标准是相当标准的:语法高亮、代码完成(如 intellisense 或其 Eclipse对应)和集成调试(例如,基本的断点).

The minimums are fairly standard: syntax highlighting, code completion (like intellisense or its Eclipse counterpart) and integrated debugging (e.g., basic breakpoints).

我自己找过,但是实在是太多了,用手很难分清优劣,尤其是像我这样对Linux几乎没有C++编码经验的人.我知道 Eclipse 支持 C++,而且我真的很喜欢 Java 的 IDE,但它有什么好处吗?对于 C++,还有更好的吗?

I have searched for it myself, but there are so many that it is almost impossible to separate the good from the bads by hand, especially for someone like me who has little C++ coding experience in Linux. I know that Eclipse supports C++, and I really like that IDE for Java, but is it any good for C++ and is there something better?

第二篇文章实际上有一些很好的建议,但我缺少的是究竟是什么让建议的 IDE 对用户如此有利,它的(缺点)优势是什么?

The second post actually has some good suggestions, but what I am missing is what exactly makes the sugested IDE so good for the user, what are its (dis)advantages?

也许我的问题应该是:

您建议使用什么 IDE(根据您的经验),为什么?

推荐答案

最初:混淆

最初写这个答案时,我最近从 Visual Studio(具有多年经验)切换到 Linux,我做的第一件事就是尝试找到一个合理的 IDE.在当时这是不可能的:没有好的 IDE 存在.

Initially: confusion

When originally writing this answer, I had recently made the switch from Visual Studio (with years of experience) to Linux and the first thing I did was try to find a reasonable IDE. At the time this was impossible: no good IDE existed.

然后我意识到 Linux 中的 IDE 是带有工具的命令行:

And then I realised that the IDE in Linux is the command line with its tools:

  • 首先你设置你的外壳

    根据您的需要,您必须安装和配置几个插件才能使编辑器正常工作(这是一个烦人的部分).例如,Vim 上的大多数程序员将受益于用于智能自动完成的 YouCompleteMe 插件.

    Depending on your needs, you will then have to install and configure several plugins to make the editor work nicely (that’s the one annoying part). For example, most programmers on Vim will benefit from the YouCompleteMe plugin for smart autocompletion.

    一旦完成,shell 就是您与各种工具交互的命令界面 - 调试器 (gdb)、分析器(gprof、valgrind)等.您可以使用 Make, CMakeSnakeMake 或任何各种替代品.并且您使用版本控制系统管理您的代码(大多数人使用 Git).您还可以使用 tmux(以前也是屏幕)来多路复用(= 考虑多个窗口/选项卡/面板)并保留您的终端会话.

    Once that’s done, the shell is your command interface to interact with the various tools — Debuggers (gdb), Profilers (gprof, valgrind), etc. You set up your project/build environment using Make, CMake, SnakeMake or any of the various alternatives. And you manage your code with a version control system (most people use Git). You also use tmux (previously also screen) to multiplex (= think multiple windows/tabs/panels) and persist your terminal session.

    关键是,多亏了 shell 和一些工具编写约定,这些都相互集成.这样Linux shell 是一个真正集成的开发环境,完全可以与其他现代 IDE 相提并论.(这并不意味着单个 IDE 没有命令行可能缺乏的功能,但反之亦然.)

    The point is that, thanks to the shell and a few tool writing conventions, these all integrate with each other. And that way the Linux shell is a truly integrated development environment, completely on par with other modern IDEs. (This doesn’t mean that individual IDEs don’t have features that the command line may be lacking, but the inverse is also true.)

    一旦您养成习惯,上述工作流程的运行效果如何都不会过分夸大.但是有些人只是更喜欢图形编辑器,并且在最初编写这个答案后的几年里,Linux 已经为几种不同的编程语言获得了一套出色的图形 IDE(但据我所知,不是 C++).即使 - 像我一样 - 你最终没有使用它们,也请尝试一下.这只是一个小而有偏见的选择:

    I cannot overstate how well the above workflow functions once you’ve gotten into the habit. But some people simply prefer graphical editors, and in the years since this answer was originally written, Linux has gained a suite of excellent graphical IDEs for several different programming languages (but not, as far as I’m aware, for C++). Do give them a try even if — like me — you end up not using them. Here’s just a small and biased selection:

    • For Python development, there’s PyCharm
    • For R, there’s RStudio
    • For JavaScript and TypeScript, there’s Visual Studio Code (which is also a good all-round editor)
    • And finally, many people love the Sublime Text editor for general code editing.

    请记住,此列表还远未完成.

    Keep in mind that this list is far from complete.

    1 我从 dsm 的评论中窃取了那个标题.

    1 I stole that title from dsm’s comment.

    2 我以前在这里指的是 Vim.虽然普通的 Vim 仍然非常强大,但 Neovim 是一个很有希望的重启,并且它对一些旧疣进行了现代化改造.

    2 I used to refer to Vim here. And while plain Vim is still more than capable, Neovim is a promising restart, and it’s modernised a few old warts.

    这篇关于适用于 Linux 的 C++ IDE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆