What is the use of a compiler in programming?

Neil010

Posts: 37   +0
Hellp Everybody,

I am new to the vast field of computer programing. I have started with the language "C++", and at the moment I am teaching myself from books and the internet.

I however always have a doubt - "What is the use of a compiler?"

What I deduced was that it is a software that compiles your lines of code into an executable file. But everytime I view posts on TechSpota and other forums dedicated to C++, I see people talking about different compilers, and that one compiles more efficiently that the other and that some have more support and you can improve by downloading plug-ins. Also, what is an IDE?

I currently use Bloodshed's Dev C++ compiler, and it has served me well (till now at least).

So besides compiling codes what else does a compiler do? And is Dev C++ a good choice or should I download Code::Blocks ( which I found recently after a few Google searches)?

Yes, I did my searches on Google, but I couldn't I really find a good answer. I am in a dilemma at the moment and would be grateful if somebody helped.

Neil010
 
I'm no expert, but as far as I've been taught, a compiler will compile your code into a single file, such as an exe. That file can then be used without the need of your code any longer, or the compiler itself. This is useful if you want to send your code to users to test, as they'll only have a single file.
It's usually for finished code and not bug testing, as opposed to an interpreter which looks at your code and executes it line by line, stopping if there is any error. This helps find such errors. An interpreter has to have your code on hand each time you want to run your program.

And IDE is an 'integrated development environment'. Basically, it's a program to help you program. It usually contains a compiler/interpreter within itself, along with a source code editor and a debugger sometimes.

I'm not entirely sure how to answer your other questions, but I have heard a lot of good things about Code Blocks.

Hope that helps!
 
In the simplest of terms, a compiler translates human readable grammar (eg: cobol, c, c++, java) into a binary, machine readble file that can then be executed by the machine.
 
Thank you Mr. Beard for the help. But I just wanted to ask you... Since my compiler converts or translates the codes into binary, doesn't that make my application cross-platform, which I can then use in either systems?
 
Back