Defensive Programming Defensive Programming Good

Defensive Programming Defensive Programming Good
1 / 1
Defensive Programming Defensive Programming Good - slide 1 of 12 Defensive Programming Defensive Programming Good - slide 2 of 12 Defensive Programming Defensive Programming Good - slide 3 of 12 Defensive Programming Defensive Programming Good - slide 4 of 12 Defensive Programming Defensive Programming Good - slide 5 of 12 Defensive Programming Defensive Programming Good - slide 6 of 12 Defensive Programming Defensive Programming Good - slide 7 of 12 Defensive Programming Defensive Programming Good - slide 8 of 12 Defensive Programming Defensive Programming Good - slide 9 of 12 Defensive Programming Defensive Programming Good - slide 10 of 12 Defensive Programming Defensive Programming Good - slide 11 of 12 Defensive Programming Defensive Programming Good - slide 12 of 12
Defensive Programming Defensive Programming Good programming practices that protect you from your own programming mistakes, as well as those of others Assertions Parameter Checking Assertions As we program, we make many assumptions about

Related Topics

Download this presentation From Below

"Defensive Programming Defensive Programming Good" is the property of its rightful owner. Permission is granted to download and print the materials on this website for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.

Presentation Transcript

01
Defensive Programming<br>
02
Defensive Programming Good programming practices that protect you from your own programming mistakes, as well as those of others
Assertions
Parameter Checking<br>
03
Assertions As we program, we make many assumptions about the state of the program at each point in the code
A variable's value is in a particular range
A file exists, is writable, is open, etc.
Some data is sorted
A network connection to another machine was successfully opened
…
The correctness of our program depends on the validity of our assumptions
Faulty assumptions result in buggy, unreliable code<br>