2.5 Programming Languages and Integrated Development Enviroments Flashcards
What is Source code?
why was there an explosion in the use of High-level Languages?
What is assembly language reserved for?
- Any program written in a high level language is known as source code. Source code must be translated into machine code before the computer can understand and execute it.
Two factors led to an explosion in the use of high-level languages:
- Increased processor speed;
- increased memory capacity.
- Assembly Languages are reserved for specialist situations: Embedded systems and device drivers
What is Machine code?
Machine code is the Binary Representation of instructions in a format that the CPU can decode and execute.
Have an operation code instruction and address or data to use.
What are low-level Languages?
What is it used for?
• Written in Assembly language.
• Translated by an assembler into machine code.
• Used for embedded systems and device drivers where instructing the hardware directly is necessary.
• One instruction translated into one machine code instruction.
• The code works on one type of processor only.
• The programmer works with memory directly.
• harder to write and understand.
• Memory efficient.
• fast to execute.
What are High-level Languages?
- Translated by a compiler or interpreter into machine code.
- Makes the writing of computer programs easier by using commands that are like English.
- One source code instruction translates to many machine code instructions.
- Code will run on different types of processors.
- The programmer has lots of data structures to use.
- Code is quicker and easier to understand and write.
- Less memory efficient.
- slower to execute if it is not optimised.
- Source code is written in languages as Python, C++.
What is the Purpose of Translators?
Code written in both assembly and high-level source code is converted into binary machine code for execution.
Assembly code is translated using a assembler.
There are two methods of translating high-level code:
- *- Interpreting**
- *- Compiling**
What is a Compiler?
Translates source code from high-level languages into object code and then into machine code ready to be processed by the CPU
The whole program is translated in one go into machine code before it is run.
High level → Object code → Machine code
What are the Pros of a complier
- No need for translation software at run time.
- execution is faster as
- Code is usually optimised.
- Original source code is kept secret.
- A compiled program can be supplied as an executable file. An executable file is a file that is ready to run. Since an executable file cannot be easily modified, programmers prefer to supply executables rather than source code.
What are the cons of a compiler
- Programs will not run with syntax errors which can make it more difficult to write the code.
- Code needs to be recompiled when the code is changed.
- Designed for a specific type of processor.
What is a Interpreter?
Translates source code from high-level languages into machine code ready to be processed by the CPU.
The program is translated line by line as the program is running.
Pros of an interpreter
- Easy to write source code because the program will always run, stopping when it finds a syntax error.
- Code does not need to be recompiled when code is changed, and it is easy to try out commands when the program has paused after finding an error.
- Errors can be quickly spotted - once an error is found, the program stops running and the user is notified at which part of the program the interpretation has failed.
Cons of an interpreter:
- Translation software is needed at run-time
- Speed of Execution is slower as the processor has to wait for each instruction to be translated before it can be executed.
- Code is not optimised
- Interpreters do not produce an executable file that can be distributed. As a result, the source code program has to be supplied, and this could be modified without permission.
What is an IDE
An IDE is a set of tools which aid you in writing, debugging and testing computer programs
REMEMBER DURT
- Debugging tools
- Run-Time environment
- Usability functions
- Translator
What are Debugging Tools in an IDE
Debugging Tools are for finding logic errors.
- Breakpoints – stopping at a line of code during execution.
- Stepping through lines of code one at a time.
- Tracing through a program to output the values of variables.
How do IDE’s help identifying Syntax Errors?
Illustrating keyword syntax and auto-completing command entry
Error Highlighting and the complier produces an output of the error message to identify it.
What is a run-time enviroment?
- Output window
- Simulating Different devices the program can run on