1.2.4: Types of Programming Language Flashcards
(42 cards)
What is Machine Code?
- Closest to what actually happens in a computer
- Programs directly in 1’s and 0’s
- Least abstract
- Translate directly into matching electrical signals: 1 for high voltage, 0 for low voltage
What is Assembly Language?
- Next level up from Machine Code
- Uses mnemonics so easier to use than Machine Code
- Each mnemonic matches a specific sequence of binary
- One-to-one relationship
- Written in Assembly Language and translated by a specific assembler
What are High-Level Languages?
- First languages that could go further than Machine Code and Assembly Language (First developed in the early 50’s, starting with Fortran)
- One-to-many relationship, as each instruction could give rise to many lines of Machine Code
What are Programming Paradigms?
- Different approaches to using programming language to solve a problem
How do you decide what Paradigm to use?
- Depends on the type of problem that needs solving
What is Imperative Programming?
- The use of code that clearly specifies the actions performed
What is Procedural Programming?
- One of the most widely-used paradigms
- Uses a sequence of instructions which may be contained within procedures
- Instructions are carried out in a step-by-step manner
What is Procedural Programming used for?
- A wide range of software development as it is easy to implement
What is a drawback of Procedural Programming?
- It is not possible to solve all kinds of problems with Procedural Languages, or it may be inefficient to do so
What are the advantages of Procedural Programming?
- Can be applied to a wide range of problems (that can easily be expressed as a series of instructions)
- Is relatively easy to write and interpret
What do Procedural Languages use?
- Traditional data types such as integer and strings which are built into the language and also provide data structures like dictionaries and arrays
What is Object-Oriented Programming?
- Applicable to certain types of problem with lots of reusable components with similar characteristics
- Built on entities (Objects) formed from Classes with certain Attributes and Methods
What is the main focus of Object-Oriented Programming?
- Making programs that are reusable and easy to update and maintain
What is the focus of Declarative Programming?
- Stating the desired result rather than the exact series of instructions that need to be performed to get the result
- It is the role of the programming language to determine how to best obtain the result
- The details about how the result is obtained are abstracted from the user
- Common programming in expert systems and AI
What is Functional Programming?
- The concept of reusing a set of functions that form the core of the program
- Programs are made up of lines of code consisting of function calls, often combined within each other
- Closely linked to Maths
What are Logic Languages?
- The use of code which defined a set of facts and rules based on the problem
- Queries are used to find answers to problems
What is Structured Programming?
- A popular subsection of Procedural Programming in which the control flow is given by four main programming structures
What are the four main programming structures in Structured Programming?
- Sequence
- Selection
- Iteration
- Recursion
What is Sequence?
- Code is executed line-by-line, top to bottom
What is Selection?
- A certain block of code is run if a specific condition is met [IF statements]
What is Iteration?
- A block of code is executed a certain amount of times or while a condition is met [FOR, WHILE, or REPEAT UNTIL loops]
What is Recursion?
- Functions are expressed in terms of themselves and are executed calling themselves until a certain condition (base case that does not call the function) is met
What is ADD in LMC?
- Instruction: ADD
- Add the contents of the memory address to the Accumulator
What is SUB in LMC?
- Instruction: SUBTRACT
- Subtract the contents of the memory address from the Accumulator