ide vs complier ? whats the difference

Started by
12 comments, last by Oluseyi 16 years, 2 months ago
ok i just got my ass chewed by my professor cause he gave us a a program to build and i used visual studio to build it . he told me he wants his programs built in a compiler , i told him i was using visual studio , he yelled at me and said that not a complier he said it was an "IDE", then told me to get a compiler for the rest of the semester. so here is my questions 1- is there a difference between ide and a compiler ? 2- where can i get a compiler for free ?
Advertisement
An IDE is an environment in which you edit/manage your code. A compiler is the actual program which turns your code into an actual binary. An IDE and compiler work hand in hand, and the IDE tends to do most of the work for you when it comes to building the program based on very easy to read project preferences.

Your professor is most likely trying to get you used to things like makefiles and actual compiler flags. It's true that VS has a compiler but the IDE is doing all the work for you when you tell it to compile. Now, you could use the actual compiler that comes with visual studio and argue that you are doing all the work yourself and not simply hitting "Build" in Visual Studio.

It is good to learn about all the compiler flags and how to compile things without an IDE to walk you through it though.

To answer your second question, you could continue to use the compiler that comes with Visual Studio. Your professor probably just doesn't want you building your programs from the Visual Studio build menu, but to create the makefile yourself, etc.
1) A compiler translates your code into machine code (a little simplistic there but thats the gist of it.) An IDE is a program which groups most of your development tools (compiler, editor, debugger, etc) into a single program so you can get most of your work done in a single window.

2) Irony of ironies, Visual C++ Express is free (I'm assuming either that or C is the language you're using)

I can't help but wonder what drugs your professor is on. Maybe he just wants you to type in the command to compile the code yourself? In that case you would use cl.exe from a command prompt to use Visual Studio's compiler.
Humble people don't refer to themselves as humble (W.R.T. "IMHO".)
IDE = Integrated Development Envirement.

The compiler itself is usually a command line tool. In MSVC++, it is executed automatically, along with the linker, whenever you build your projects.

I personally do not think your professor should be discouraging MSVC++ as it includes a very standard-compliant compiler.

If you need to use a command line toolchain, I personally recommend DevC++ or DJGPP. I *believe* both uses the GCC compiler. Please anyone correct me if I am mistaken (I never used DevC++)

Please keep in mind that there are more free compiliers available. Alot/Perhaps most? of them are not up to the C99 standard, though.

Hope this helps :)
Quote:he told me he wants his programs built in a compiler
I would hope so. It's really hard to build programs anywhere else.

Quote:i told him i was using visual studio , he yelled at me and said that not a complier he said it was an "IDE"
True, VS is an IDE. However, IDEs can't build a program. Only compilers can.

Quote:then told me to get a compiler for the rest of the semester.
You already got one with Visual Studio.

Your professor yelled at you, but ironically it is his knowledge that is lacking. I sympathize with your terrible misfortune in getting a clueless professor.

Quote:is there a difference between ide and a compiler ?
The compiler is the set of tools and libraries for making programs in a certain language. Well, specifically, it's the core set of tools that do the actual job of parsing your code and converting it into whatever the end format is. Erghh I'm having trouble describing it. So I'll explain how it works in Visual Studio.

Visual Studio itself is just an IDE (integrated development environment). It provides you with a nice text editor, a project and solution manager, a debugger. It also ships with the compiler. The compiler is actually separate from the VS IDE itself. For C++, you can invoke the compiler on a commandline (cl.exe). The C++ compiler that comes with Visual Studio is a bunch of executables (compiler, linker, etc.), include files, and binaries. Technically, it could be shipped separately from Visual Studio.

And theoretically, Visual Studio could work with another compiler. Actually, it does. Visual Studio supports C++, C#, VB.NET, etc. They are all different languages with their own compilers. Visual Studio just provides you all the tools in one place to make programs easily.

Do you sort of get it?

[Edited by - oler1s on January 30, 2008 9:39:12 PM]
Quote:Original post by oler1s

True, VS is an IDE. However, IDEs can't build a program. Only compilers can.


Programming language IDEs can very well build a program. It's what the *I* in IDE stands for. It extends to debugger, linker, "makefile" and everything else.

A car also doesn't drive itself, the cooperation between engine, transmission and wheels is responsible for that. But rather than holding all these pieces together manually, they come nice package as Integrated Transportation Environment (or CAR for short).

But you can, if you wish, use each of those manually. It's just that sitting on an axle, while holding an overheating engine is uncomfortable. But can be done.

Anything else is just a text or source code editor. Emacs/vim may be used to write the code, it may even have the option to invoke the compiler, but it's not IDE, since the process is uni-directional. Although, Emacs is more extensible than any OS out there, including Emacs itself....

But...

IMHO, use VS for productivity, but deliver the build system via GNU toolchain. Once you set things up, and get up to speed with makefiles, you'll notice the productivity loss is negligible (cygwin or similar on Windows makes things simple). As an added benefit, you get two compilers, with different standard support, so they are likely to catch more errors.

Also - never use any kind of MS or Windows specific headers, types or APIs, unless you really absolutely positively need to. Stick with standard C++.
Quote:Original post by oler1s
Quote:he told me he wants his programs built in a compiler
I would hope so. It's really hard to build programs anywhere else.


LOL!!
Quote:i told him i was using visual studio , he yelled at me and said that not a complier he said it was an "IDE"
True, VS is an IDE. However, IDEs can't build a program. Only compilers can.

Quote:then told me to get a compiler for the rest of the semester.
You already got one with Visual Studio.


Your professor yelled at you, but ironically it is his knowledge that is lacking. I sympathize with your terrible fortunate in getting a clueless professor.

yea no Sh!T

Quote:is there a difference between ide and a compiler ?
The compiler is the set of tools and libraries for making programs in a certain language. Well, specifically, it's the core set of tools that do the actual job of parsing your code and converting it into whatever the end format is. Erghh I'm having trouble describing it. So I'll explain how it works in Visual Studio.

Visual Studio itself is just an IDE (integrated development environment). It provides you with a nice text editor, a project and solution manager, a debugger. It also ships with the compiler. The compiler is actually separate from the VS IDE itself. For C++, you can invoke the compiler on a commandline (cl.exe). The C++ compiler that comes with Visual Studio is a bunch of executables (compiler, linker, etc.), include files, and binaries. Technically, it could be shipped separately from Visual Studio.

And theoretically, Visual Studio could work with another compiler. Actually, it does. Visual Studio supports C++, C#, VB.NET, etc. They are all different languages with their own compilers. Visual Studio just provides you all the tools in one place to make programs easily.

Do you sort of get it?


so basically i can just use cl.exe in the command line and i can run the compiler .. my only question is how do you input ... what i mean is how do write the program , notepad ?
also are there commands that i need to know ?
The Lifetime of Code

Parsing is the process of breaking down the source code that you've provided into discrete entities that can be understood by the compiler.

Compilation is the process of parsing code and then translating it into object code which can be executed by a runtime (eg interpreter) or natively by a processor. Additional steps may be necessary to "finish" such object code, such as linking.

Linking is the process of taking multiple object files - files that contain object code, including static import libraries or object archives - and combining them into a single executable file. In the process of linking, references to symbols outside of an object file are converted into address offsets within the resulting executable.

Execution is the process of running object code. It may be performed indirectly by a runtime or interpreter, or directly by the operating system. Not all executable code can be run standalone: dynamic link libraries (shared libraries under Unix) are executable code that must be called from other applications.


Recommended (Free) Compilers and IDEs

For Windows, nothing touches Visual Studio. A scaled down version is available for free, Visual <language> Express Edition. The main alternative is the GNU toolchain with the Code::Blocks IDE; Dev-C++ is defunct and even the creators advise not to recommend it any longer. If you have a machine that doesn't stagger under the load, you can also run Eclipse, but it's really more of a Java IDE.


Comments on Your Professor

I wouldn't call him an idiot, but he is highly imprecise. An IDE still employs a compiler to actually build the executable; it merely makes the process much easier and more manageable. You should learn how to build applications from the command line, not merely because this class requires it, but because the command line is the way we integrate disparate applications. That enables you to automatically schedule builds, for example, exercising a variety of paths and building different targets, and possibly even automatically test them and send emails with the results to the appropriate parties...

He's doing you a good turn. His choice of terms is merely unfortunate.
Quote:so basically i can just use cl.exe in the command line and i can run the compiler
Yes. That will run the compiler.

Quote:my only question is how do input ... what i mean is how do write the program , notepad ?
Any plain text editor will do. Notepad is a plain text editor, but a very poor one at that. No programmer should ever be using it.

You could also use your IDE, which comes with a plain text editor, to create the files, and then manually compile them on the command line.

Quote:also are there commands that i need to know ?
The compiler flags and like. See the compiler documentation for how to invoke it.

Note that there isn't any benefit to doing this as a complete beginner. The details will only serve to confuse. Eventually you will learn how though.
Quote:Original post by Oluseyi

He's doing you a good turn. His choice of terms is merely unfortunate.


If part of curriculum is to teach GNU tool-chain, then it takes one sentence to explain that. It's an important aspect to learn.

A *teacher* would *teach* the difference between IDE and compiler, as well as why use of VS might not be desirable. With a *teacher*, this question wouldn't need to be answered here, but would be part of teaching process.

I don't think excuses or justification here are not needed. The professor may be brilliant in his own way, but is an idiot as a teacher. If truly yelling, he's usually just frustrated over something, likely over this whole teaching aspect, when his time could be better spent writing important articles for scientific journals.

If he were any kind of a teacher, this thread wouldn't need to take place.

This topic is closed to new replies.

Advertisement