I'm not new to programming but I been switching between a couple of different compiler for C++ and was jw if there a big difference on which one you use, and if so what is a good compiler?
Thanks for the help
I'm not new to programming but I been switching between a couple of different compiler for C++ and was jw if there a big difference on which one you use, and if so what is a good compiler?
Thanks for the help
Common to all:
- they all implement the C++ language; most of the modern and popular ones like visual studio and GCC make a pretty good job of this.
- they all implement the standard library.
Where the differences lie are in:
- additional libraries for the OS
- additional "IDE" tools like editor, debugger, help system etc.
If you learn C++ (that is, what the language will guarantee for you, and not what any particular compiler will let you get away with), then writing portable code, and moving from one compiler to another is pretty easy.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Nowadays, the situation with the big compilers is this:
Microsoft C++ (as in Visual Studio): Very fast in compilation, produces average to good code, good standard compliance (accepts pretty much all valid code), but often too lenient (accepts some invalid code), which can lead to problems if you start developing with this compiler and later want to port to others. Available for free via the Express editions of VS.
Intel C++: Extremely slow compilation, unstable. Often crashes or miscompiles (at least that's our experience here at work), but when it works, its code is considerably faster and usually smaller than what MSC produces. Excellent standard compliance, being based on the EDG frontend. Only the Linux version is free.
GCC: Average compilation times with high memory use, generally produces very good code. For AMD CPUs or one-size-fits-all solutions, a better choice than Intel's compiler, which is obviously biased. Excellent standard compliance. The Windows version is missing some MS extensions that mean that it's not a drop-in replacement for many Windows applications.
CodeGear C++: Formerly Borland C++ builder. Little activity recently, although there has been a new release. I don't have much experience with it, but it's generally reputed to have extremely fast compilation, but a rather low code quality. Good standard compliance. As with GCC, it uses its own conventions, which make it unsuitable as a drop-in replacement.
Other compilers that are not as widely used:
Sun C++ and HP C++: these are pretty much special-purpose compilers for their respective platforms (Solaris and HP-UX).
Clang: Still work-in-progress, its C++ support is not yet at a level where it can be used for most applications. I believe we got groff to compile. Where the standard is implemented, compliance is high and strict.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law