学习没有IDE的C ++ [英] Learning C++ without an IDE

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

问题描述

我最近开始学习C ++,完全混淆了IDE和编译器的选择。我有能力与解释语言,并喜欢使用任何IDE或文本编辑器,然后从命令行运行解释器的简单性。一切都按照我的期望工作,不管IDE使用,因为我每次使用相同的解释器。

I've recently started to learn C++ and am completely confused with the choices of IDEs and compilers out there. I am competent with interpreted languages and like the simplicity of using any IDE or text editor and then running the interpreter from the command line. Everything works as I expect, regardless of the IDE used, because I use the same interpreter each time.

现在我已经开始学习C + +我被选择不同的编译器,更重要的是它们的差异。看起来,对我来说,事情会更简单(不一定更容易)如果,虽然学习,我使用文本编辑器和编译器,我从命令行运行。我有一个基本的了解如何编译和链接工作,我理解头文件的作用。

Now that I have started learning C++ I am overwhelmed by the choice of different compilers and more importantly, their differences. It seems that things will be simpler for me (not necessarily easier) if, while learning, I use a text editor and a compiler that I run from the command line. I have a basic understanding of how compiling and linking works and I understand the role of header files.

首先,有没有任何书或网站从这种方法教C ++? (IDE-less)
许多书试图通过选择两个并比较它们来指出IDE和编译器之间的区别,这让我很困惑。

Firstly, are there any books or websites that teach C++ from this approach? (IDE-less) Many books try to point out the differences between IDEs and compilers by selecting two and comparing them, which confuses me.

其次,我应该设置我的工作流吗? (忽略文本编辑器的选择,我在谈论编译器,链接器等)我很难理解不同的编译器有什么区别,所以请在回答时记住这一点。它似乎最流行的编译器是g ++和CL。
类似的问题,但我更感兴趣的是为什么有些程序将使用一些编译器,而不是其他人: http://stackoverflow.com/questions/958695/c-compiler-for-windows-without-ide

Secondly, how should I set up my workflow? (Ignore the choice of text editor, I am talking about compilers, linkers etc.) I am struggling to understand what differences different compilers have and so please bear this in mind when answering. It seems like the most popular compilers are g++ and CL. Similar question but I am more interested in why some programs will work with some compilers and not others: http://stackoverflow.com/questions/958695/c-compiler-for-windows-without-ide

进一步信息:我在Windows上开发,从我的理解,似乎有'纯'C + +然后C + +是某种程度上与窗口相关的,是这个Visual C + +?我想编写使用Windows功能的程序,但我想知道我什么时候使用Windows功能,当我编写的代码可以在任何平台上工作。

Further information: I am developing on Windows and from what I understand, it seems that there is 'pure' C++ and then C++ that is somehow related to windows, is this Visual C++? I would like to write programs that make use of Windows features but I want to know when I am using windows features and when I am writting code that would work on any platform.

更新:所以看来,我不应该担心编译器,当我刚刚开始。我想理解差异的原因是因为我不想为特定的编译器编写代码,并陷入坏习惯。这是一个非问题?

Update: So it seems that I shouldn't be worrying about compilers when I am just starting out. The reason for me wanting to understand the differences is because I don't want to write code for a specific compiler and get into bad habits. Is this a non-issue?

推荐答案


首先,是否有任何书籍或网站教C从这种方法? (IDE-less)

Firstly, are there any books or websites that teach C++ from this approach? (IDE-less)

是的,绝对。 Stroustrup的书已经提及。对于学习C ++我还建议另外两本书:如果你喜欢详细的解释,不要回避1000页,看看 Lippman et al 。如果您更喜欢简短的介绍,不要害怕陡峭的学习曲线,请查看 Koenig / Moo 。两本都是优秀的书。 (BTW,查找好书的好地方一直是 ACCU 上的图书评论部分。)

Yes, definitely. Stroustrup's book has already been mentioned. For learning C++ I'd also recommend two other books: If you like thorough explanations and don't shy away from 1000 pages, look at Lippman et al. If you rather like a short introduction and don't fear a steep learning curve, look at Koenig/Moo. Both are excellent books. (BTW, a good place to look for good books has always been the book review section at the ACCU.)

对于要使用的工具链:如果你喜欢有一个独立的编辑器并从命令行调用编译器,你可以使用GCC或VC。这种方法的优点是,它不太可能诱使你使用专有的东西(如C ++ / CLI)。如果你想尝试一个IDE,VC Express是好的,一旦你过去设置一个新的C ++项目。当然,您可以为一个新项目调整的选项数量可能非常多。但另一方面,你得到的东西像一个集成的调试器。注意,还有其他集成解决方案。最成熟和突出的可能是日食。

As for which tool chain you want to use: If you rather have a standalone editor and invoke the compiler from the command line, you can do this with either GCC or VC. This approach has the advantage that it is more unlikely to lure you into using something proprietary (like C++/CLI). If you would like to try an IDE, VC Express is fine, once you're past setting up a new C++ project. Of course, the number of options you can tweak for a new project can be very overwhelming. But on the other hand you get things like an integrated debugger. Note that there are other integrated solutions, too. The most mature and prominent is probably eclipse.

编辑:如果您不介意花点钱,请查看 Comeau 。它不是免费的,但它不昂贵,它通常被认为是最符合标准的C ++编译器周围,并有出色的错误消息。 (您可以在网站上测试驱动它。)请注意,它会发出C代码。这意味着你必须有另一个编译器来创建一个可执行程序。但是GCC和VC Express都会做,所以没有其他成本。 (注意,使用VC你会得到Dinkumware的std lib实现,这也被认为是一个非常好的。)

Edit: If you don't mind spending a little money, look at Comeau. It's not free, but it's not expensive either and it's usually considered to be the most standard-conforming C++ compiler around and has excellent error messages. (You can test-drive it at the website.) Note that it emits C code, though. That means you have to have another compiler to create an executable program. But both GCC and VC Express will do, so there's no other cost. (Note that using VC you will get Dinkumware's std lib implementation, which is also considered to be a very good one.)

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

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