01. Introduction
Programming:
- art of solving problems using a language that computer could understand is called as programming.
Software:
- A set of programs is called as software.
Program:
- A set of instructions is called as program.
- Avoid duplicate code.
Why we need Programming?
- We need programming to create new softwares.
- to update existing softwares.
Translator:
- software engineer ---- translator ----- machine code
- translator is a piece of software that translates programming language code to machine code.
Types of translator:
- Interpreter
- Compiler
Interpreter:
| Interpreter | Compiler |
|---|---|
| Reads --- check syntax --- translates --- execute (Works per line) | Reads whole file ---- check syntax --- translates ---generates output file. |
| Do not store machine code in file | Stores machine code in a file |
| Executes code after translation. | Do not execute code after translation. |
Conclusion :
- Languages that are based on interpreter are called as interpreter based language.
- Languages that are based on compiler are called as compiler based languages.
- Examples of Compiler based language : C, C++, Java, C#, ....etc.
- Examples of interpreter based language : HTML, JavaScript, PHP .... etc.
- Compiler is less secure as compared to interpreter.
- because code is translated only once and after that it is executed again and again without re-translation.
- Adding of virus or code to compiler generated .exe file is easy.