week 7 Flashcards

1
Q

What does tactical programming prioritise?

A

speed

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

What is complexity

A

hard to understand and modify system

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

What does strategic programming prioritise

A

design

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

what are the advantages / features of tactical programming

A

. we need features or the task to be working as fast as possible

. working code alone is fine

Work on code without considering:
. design / improvements for design
. unit tests

. Leads to code with High complexity ( hard to understand and modify)

. Productivity will waver in long term

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

what are the features of strategic programming

A

working code is not enough and we need to focus on design

. pay time on :
- finding best design
- unit tests
.
.
.

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

compare the progress over time with tactical and strategic programming

A

Long term strategic progress is smaller ( due to inital time costs when dealing with design)
However will have more productivity than tactical in long term as tactical is complex

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

design principles are general guidelines offering flexibility in their application.

A

vfjg

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

what is the is one of the design principles ( deals with efficiency)

A

KISS

Keep it simple , straightfoward

Always pick most efficient ,simple approach

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

Loose coupling

A

Avoid tight coupling where 2 or more components are highly related to each other

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

High cohesion

A

elements of a cetain module are highly related

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

What is the S in Solid

A

Single responsibility principle
Class should have only one reason to change

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

O in SOLID

A

Open and Closed principle

open for extenstion and closed for modification :

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

L in solid

A

Liskov substitution principle

If s is a subtype of T , objects of type t can be replaced with s whilst STILL ACHIEVING DESIRED FUNCTIONALITY

eg an array (1,2,3,4)

desired functionality -> sorts in ascending order

(T -> Sorter class which sorts the array)
subtypes (s)

bubble sorter Adheres to liskov - sorts in asc

quick sorter Adheres to liskov - sorts in asc

random sorter does not adhere to likov as sorts in random order ( doesnt achieve desired functionality when sorter is replaced with random sorter)

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

. polymorphsm

Consistency and Predictability: Clients interacting with objects through base class interfaces can rely on consistent behavior across different derived classes.

Code Understanding: Developers can reason about the behavior of objects based on their common interface without having to worry about unexpected behavior in derived classes

A

just read

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

Interface segregation :

Reduced Dependencies: By breaking down large interfaces into smaller, more focused ones, classes become less
dependent on methods they don’t use. This reduces unnecessary dependencies and minimizes the impact of changes in
one part of the system on unrelated parts.

Enhanced Readability and Comprehensibility: Smaller interfaces with specific responsibilities are easier to read and
understand. Developers can quickly grasp the purpose of an interface and the methods it contains, leading to better overall
code comprehension.

Encourages Single Responsibility Principle (SRP): ISP is closely related to the Single Responsibility Principle (SRP).
Breaking down interfaces into smaller ones often aligns with the idea of each class having a single responsibility. This
separation of concerns makes code more modular and easier to manage.

A

just read

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

D - Dependecny inversion principle

A

High-level modules should not depend upon low-level modules.
Both should depend upon abstractions.

Abstractions should not depend upon details. Details should depend upon
abstractions.

17
Q

Dependency inversion expanded

A

In the high level module , there should be no dependency whether it be a direct dependency ( instance of a low level module created ) or a more subtle one where the low level module an instance variable in the high level module

18
Q
A