Programming Flashcards
What is Modulisation?
The process of dividing a program into separate sub-programs
What is a built in function?
Functions that are bundled into a programming language by default, such as print in python
What are user defined functions?
Functions made by a developer for a program
What are anonymous /lambda functions?
Functions that aren’t declared using the def keyword in python
What’s the difference between a method and a function?
A method is a function which is also part of a class, a function however is standalone and not restricted.
All methods are functions, but not all functions are methods
How is an anonymous function called in python?
lambda [parameter(s)] : expression
An example would be:
adding = lambda a,b : a + b
print(adding(2,3))
Why are lambda/anonymous functions used?
Lambda is another way of writing a small expression as a function that’s not named. Long story short, it’s quicker, and saves on time and space
What is Decomposition?
Breaking a complex problem into smaller sub-problems
What are the advantages of decomposition?
Different people can work on various sub-tasks, which can be combined to create the final solution. Maintenance of the final program can be completed at a modular level, simplifying it
What are the disadvantages of decomposition?
The modules may not combine correctly to solve the initial problem. If the initial problem isn’t fully understood it is difficult to decompose
What are the 4 steps of decomposition?
- Identify and describe the problems and processes
- Break down the problems into separate tasks
- Describe the tasks and subtasks
- Communicate
What is abstraction?
The process of removing details and/or characteristics that aren’t needed, to focus on what is essential
What’s an example of abstraction?
The London underground map
Must say map, accept anything reasonable besides this
What are the 2 main steps of abstraction?
- Information needed to solve a problem should be identified.
- Carry out abstraction to filter any unnecessary information
What should each layer of abstraction show/contain?
Inputs, Outputs, Variables, Constants, Key processes, Repeated processes
What’s a pattern?
Patterns are things that are common between problems or programs
What is the main reason for pattern recognition in programming?
By identifying and recognising patterns, it is possible in code to locate pre existing module(s) of code
What are the steps of pattern recognition?
- Identifying and interpreting common elements in problems or systems
- Identifying and interpreting common differences in problems or systems
- Identifying individual elements in the patterns
- Describing patterns that have been identified
- Making predictions based on identified patterns
What is the point of identifying patterns in code?
To improve the efficiency of code and save time
How does facial recognition use pattern recognition?
Software identifies and confirms someone’s identity using photos, videos or in real time, using the patterns with someone’s face.
What is Pseudocode?
An informal programming description showing flow through a process
What are the benefits of Pseudocode?
- It makes it really simple to communicate code to various developers.
- It’s very simple to follow even with minor errors.
- Clearly explains each line of code.
Who uses Pseudocode?
Mainly, development teams that know various different languages