Another article to cover a very common topic. Often questions come up like:
- What IDE can I use?
- What compilers are there?
- What <insert> is the best?
Let's start with:
A compiler is a command line application (in most cases) that takes your source code files and generates an executable. The methods used to do this and the resulting size/optimized executable will vary based on compiler.
A compiler does not help you write code, it's not a development environment where you can type code. It's sole purpose is to take code already written and build an executable.
No one compiler is better than any other. They all have their pros and cons. If you wish to compare compilers, please do so from the technical specifications on their own websites. In most cases, this is not going to serve you any great purpose. If optimization is your concern, your best bet is to follow standard coding techniques when developing highly optimized code.
Some common compilers are:
- MS Visual C++ Compiler (Windows) - http://www.microsoft.com/express/vc/
- GCC (Linux) - http://gcc.gnu.org/
- MingW (Windows) - http://www.mingw.org/
- Intel C++ Compiler (Linux, Windows, OS X) - http://www.intel.com/cd/software/products/asmo-na/eng/compilers/284132.htm
- Borland C++ Compiler (Windows) - http://www.borland.com
Integrated Development Environments (IDE)
An IDE is a full suite for software development. Typically they come bundled with a text editor, a compiler and a debugger. The text editors are the main component as they offer functionality like Syntax highlighting, project management, source-control integration etc.
An IDE is not a compiler, but most IDEs will come with one of the compilers listed in the previous section.
e.g Dev-C++ comes with MingW, Code::Blocks comes with GCC.
The complexity of IDEs will vary greatly, while some are better suited for new developers and some for advanced/professional developers.
Note: Dev-C++ is no longer recommended on their official forum. wxDev-C++ should be used instead.
Some common IDEs:
Easy to Use
wxDev-C++ (Windows) - http://wxdsgn.sourceforge.net/
Anjuta (Linux) - http://anjuta.sourceforge.net/
Code::Blocks (Windows/Linux) - http://www.codeblocks.org/
MS Visual C++ Express (Windows) - http://www.microsoft.com/express/vc/
NetBeans (All) - http://www.netbeans.org/
KDevelop (Linux) - http://www.kdevelop.org/
Borland C++ (Windows) - http://www.borland.com
Eclipse CDT (All) - http://www.eclipse.org/
Note: You are also free to write code in any of your favorite text editors then compile it manually.
Debuggers are used to analyze your application while it's running. You are able to pause your application at selected points (breakpoints) and view information such as variable values etc.
Currently, there only seems to be 2 major debuggers in use.
Microsoft Visual Studio Debugger (Windows)
This is a high quality debugger. It's easy to use and integrates seemlessly into the visual studio IDE. It does have some slight problems when dealing with multiple threads, but generally works very well.
This is an open source debugger often run alongside GCC/MingW. It's also a good quality debugger, but unfortunately it's multi-threaded debugger is considerably behind the visual studio equal.
Fortunately, GDB is platform independent and will integrate with numerous IDEs. Unfortunately, this integration is sometimes very difficult to work with and not intuitive.
Please post corrects/comments or questions below.
Justification for that is that Visual Studio offers more functionality. Especially when working in .NET. You can link assemblies from different languages, it has proper integrated source-control and you can use other plugins (e.g SVN). You can also have multiple projects per solution etc.
It's considerably more complicated than Dev-C++(wxDev-C++)
Eclipse (with CDT plugin).
I use this because my development is for both Windows and Linux systems. So I prefer to have an IDE I can use across multiple platforms. Eclipse also has a good plugin framework, so I am able to use the same SubVersion plugin on both my installations.
I also use it because it has other plugins I like (PHP, Database, Modelling etc)
My compiler is GCC (Linux) and Mingw(Windows). I use GDB on both platforms.
MingW is a patched version of GCC. And you'd expect the source to come with no compiler. That's typical of any application you build from source.