Software Flashcards
What is the difference between declarative and imperative languages?
Imperative languages (such as C or Pascal) consist of commands for the computer to perform. Declarative languages focus on what the program should do without listing the steps needed (such as in SQL).
Advantages and disadvantages of:
Assembly vs Machine code
Mnemonics used in assembly language are easier to read and understand than binary, so programmers can write and edit programs more easily.
Assembly code has to be assembled, so may be more portable but may run slightly slower.
Advantages and disadvantages of:
Low level vs High level languages
Low level languages use very little (or no) abstraction, so are not as easy for humans to read and understand as high levels languages.
High level languages are more structured. Functions, selection and iteration make code easy to organise and re-use.
Code written in low level languages can manipulate individual bits and hardware better than high-level languages.
Code written in low level languages only needs assembly, or no translation at all, whereas high level code must be translated (compiled or interpreted) before running. Therefore, low level languages may take up less space and execute more quickly.
Define compiler
A type of translator that takes source code and compiles it into executable object code, handling the entire code at once (though making multiple passes).
Define interpreter
A type of translator that takes source code and interprets it line by line and creates a script.
Advantages and disadvantages of:
Compilers vs Interpreters
Compiler object code can be saved on disk and run on any compatible computer without recompilation. The compiler does not need to be present, and the object code can be distributed without it. It executes faster than interpreted code. Object code is quite secure, as it would need a great deal of reverse engineering to be understandable.
Interpreters will stop when an error is found and notify about the error. Debugging is easier. Recompilation does not occur whenever an error is found. It is harder to protect, however, as sourcecode or bytecode has to be available at runtime, so it could be edited.
What is bytecode?
An intermediate code produced by compiling source code, which must then be interpreted when run.
Why use bytecode?
Portability! (It’s also known as portable code, or p-code)
The bytecode can be distributed to many types of computer, as long as it has the ability to interpret the bytecode. Java bytecode can be run on any machine with the Java Virtual machine, which can understand bytecode and convert it into machine code for the computer to run.
Define system software
Software needed to run the computer’s hardware and application programs: the OS, utility programs, libraries and translators.
Utility programs:
Any software designed to optimise system performance:
- Disk defragmenter
- Firewalls
- Encryption
- Compression/decompression
- Back-up and restoration
- Virus checker
What is the operating system for?
- Resource management: managing hardware (keyboard, monitor, disk drives, memory and CPU access, printers and other peripherals)
- Providing an interface (usually graphical) for users, so that the true complexity of the computer need not be understood.
What are library programs for?
Functions for use in other programs. Libraries can be imported for writing code (such as the random library in Python) so that functionality can be added without having to write the code. Library programs with common functionality may be used by multiple different programs.
What type of software are translators?
System software
Define application software
Any program that performs specific tasks for users. It can be general purpose (has many potential uses, such as a word processor or graphics package) or special purpose (has one, specific function)
What does a virtual machine do?
It disguises the complexity of communication between software and hardware; where software takes on the function of a machine via an API (application programming interface), including executing intermediate code or running an operating system within another for emulation purposes.