Learning C++ without an IDE

2020-05-20 07:39发布

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.

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.

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.

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: C++ Compiler for Windows without IDE?

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?

9条回答
姐就是有狂的资本
2楼-- · 2020-05-20 08:31

I'd say to start out with Visual Studio. This is a great IDE for programming C++ on windows, might as well use it when it can speed up certain things a lot.

The differences between compilers aren't that huge - if you can write solid code in VS then it shouldn't be a problem to figure out how to get your code working in GCC/G++.

As for books; Exceptional C++ by Herb Sutter and The C++ Programming Language by Bjarne Stroustrup are a great read.

Visual Studio is the way to go when developing for Windows.

查看更多
霸刀☆藐视天下
3楼-- · 2020-05-20 08:36

Use MinGW - it's a command-line C++ development toolchain that allows you create Windows applications. The SO link you quoted seems to have all the relevant details, so I don't really understand why you posted this question.

查看更多
家丑人穷心不美
4楼-- · 2020-05-20 08:41

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.

MS Visual C++ 2008 Express is a free IDE aimed at folks like you, it's available by download from Microsoft, I recommend you try it out.

查看更多
登录 后发表回答