1.2.2 c Flashcards
Source code
Source code is written by the programmer and refers to object code before it has been compiled. When software is described to be open or closed source, this refers to whether the code is accessible to the public
Open source code
Code that can be used by anyone without a license and is distributed with the source code
Closed source code
Requires the user to hold an appropriate license to use it. Users cannot access the source code as the company owns the copyright license
Advantages of open source code
. Can be modified and improved by anyone
. Technical support from online community
.
Advantages of closed source code
. Thorough, regular and well - tested updates
. Company owning software provides expert support and user manuals
. High levels of security as developed professionally
Disadvantages of open source code
. Support available online may be insufficient or incorrect. No user manuals
. Lower security as may not be developed in a controlled environment
Disadvantages of closed source code
. License restricts how many people can use the software at once
. Users cannot modify and improve software themselves
What must a person consider when choosing source code software
. Costs
. Functionality
What is a translator
A translator is a program that converts high-level source code into low-level object code, which is then ready to be executed by a computer. There are three types of translator that convert different types of code and work in different ways
What are the three types of translator
. Compiler
. Interpreter
. Assembler
Compiler
. Compilers translate high-level code into machine code all at once
. This process is longer than interpreters or assemblers, if changes need to be made, the whole program must be recompiled
. Once code has been compiled to produce machine code, it can only be executed on certain devices
. Compiled code is specific to a particular processor type and os
. Code can be run without a translator present
Interpreter
. Interpreters translate and execute code line-by-line, they stop and produce an error if a line contains a error.
. They are slower than running compiled code as code must be translated every time it is executed with an interpreter
. This makes interpreters useful for testing code
. Interpreted code requires an interpreter in order to run on on different devices. However, code can be executed on a range of platforms as long as the right interpreter is available making interpreted code more portable
Assembler
. Assembly code is considered a low-level language as it is ‘next up’ from machine code. Assembly code is platform specific as the instructions used are dependent on the instruction set of the processor
. Assemblers translate assembly code into machine code.
. Each line of assembly code is equivalent to almost one line of machine code so code is translated on a one-to-one basis