Chapter 4 - Pragmatic Paranoia Flashcards

1
Q

What is Design by Contract (DBC)?

A

It is a simple yet powerful technique that focuses on documenting (and agreeing to) the rights and responsibilities of software modules to ensure program correctness.

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

Explain the sentence “Defensive programming is a waste of time. Let it crash!”

A

Crash is often the best thing you can do when something goes wrong. The alternative may be to continue, writing corrupted data to some vital database or commanding the washing machine into its twentieth consecutive spin cycle.

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

What is assertive programming?

A

It is a way of programming that use assertions to prevent impossible scenarios.

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

How to Balance Resources effectively?

A

The method or object that allocates the resource should be responsible for deallocating it. This tip works for most cases.

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