4.1.2.1 Programming paradigms Flashcards

1
Q

What is a programming paradigm?

A

A method of programming. Some programming languages are more suited to certain paradigms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a procedural / imperative programming paradigm?

A

Writing a program in steps with statements, functions executed in order
e.g C++

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a object-orientated progarmming paradigm?

A

Organized around objects rather than actions.
Data and functions are stored in the same memory location
e.g python, java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the advantages of procedural programming?

A

Simplicity compared to OOP, as its easy to keep track of program flow
You can reuse the same code at different points using subroutines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

One practical way in which the programmer will use a structured approach to programming is the use of subroutines (procedures/functions). Give three other ways.

A

Procedures which have an interface / using parameters to pass values ;
Use of modules / use of libraries ;
Avoid global variables / use of local variables;
Meaningful identifier names;
Consistent use of case for identifiers ;
Use of selection / loops / iteration ;
Avoid the use of GoTo structures ;
Effective use of white space / indentation;
Use of named constants ;
Use of user-defined data types ;
Use of pseudo-code / top down approach

How well did you know this?
1
Not at all
2
3
4
5
Perfectly