Foreward to Coding
If you have a basic understanding of what a compiler, assembler, linker and debugger are, you can probably skip this tutorial.
For the rest of you, I'm going to provide a very basic explanation of these 4 tools. At this point it would be easy
to overwhelm you with details which will only make it more difficult for you to begin programming. If you decide you love programming
then I encourage you to look into more detail on how each of them work. There are many, many resources available to you on the internet.
What is a Compiler?
A compiler is a program like any other software you buy or download. Its purpose is to take code in a specific computer language (like C) and convert it into
another language called Assembly. There are many different compilers available. GCC is a popular Linux based C compiler which you can download and use for free.
Microsoft Visual Studio contains a C and C++ compiler (Microsoft Visual C++) which doesn't come cheap but provides you with a ton of functionality.
What is an Assembler?
An assembler takes Assembly language and converts into operation codes the computer understands. In some cases, an entire program is written by
a programmer in Assembly. However in most cases a program is written in a higher (more abstract) language such as C and then compiled into Assembly
at which point the assembler is automatically run. Both GCC and Microsoft Visual Studio will automatically assemble your program after it is compiled.
What is a Linker?
In 99% of cases, your program will also use code written by other people. The code can consist of libraries, other code files, etc. When your program
is being compiled and assembled into an executable, all this code must be combined (or linked) together. This is the purpose of a linker. Both Microsoft Visual Studio
and GCC are capable of linking all your code together.
What is a Debugger?
Inevitablly your program is going to have bugs. Finding these bugs can be extremely difficult without the use of a Debugger. A Debugger
allows you to step through your code, line by line, as it is being executed. It lets you see the values of all your data, set special conditions, etc.
It is the single most valuable tool you can use when writing your code. Microsoft Visual Studio has a debugger built in which automatically launches
when you hit the play button. GCC generally comes with GDB which is also a very nice debugging tool. You'll need to launch it yourself via a script
or through the command line.
How do I use my Compiler, Assembler, Linker and Debugger?
This is a very tough subject to cover in such a short section...so I won't even try ;) First decide what platform you want to develop on. If you use
Windows then get a copy of Microsoft Visual Studio, it is an outstanding toolset for writing code. If you are developing on Linux or cannot get
a copy of Microsoft Visual Studio then I recommend GCC. With either package, the learning curve can be steep and would be entirely too much
to cover here. There are plenty of sources online to help you get started with either software package.
|