Welcome to Fail FastSession By @AlSayedGamal
1
Fail FastBy @AlSayedGamal
2
Agenda
Fail Immediately!
Assertion!
Eliminate the debugger!
Fail fast and robust software.
3
Q1:What’s the most annoying part of software development ?
4
Q2:What are the most hated bugs ?
6
A: Bugs that appear unexpectedly after a long time of operating
normally!
7
Fail Fast is the solution
8
Fail ImmediatelyFail Fast concept can be digested as failing
immediately and clearly.
9
Can you debug this ?Imagine this in a web based app & the developer had a typo in config file
10
What about debugging this ?Same typo will be spotted immediately.
11
Assertions
What’s assertion ?!
Make sure that your language fails on assertion error.!
When is the most suitable time to do assertion.!
Assertion doesn’t conflict with logging.
13
Design your assertionsOnly if your language doesn’t have a powerful one already
14
–Jim Shore
“However, it’s tough to know when to add assertions. One way to tell is to look for comments.”
16
The Killing ExceptionWhen Assert.notNull() can save your life.
17
Debug this.The hair pulling phase.
19
23
and even better
If the maxConnections wasn’t found or mistyped it will throw!something like this one:
24
Fail fast robust software
Global exception handler
Summary
Don’t fail silently and save your time and out time.!
Assert whenever you comment.!
Assert.notNull(_instanceVariable).!
Fail with description.!
Use a global handler for users sake.
25
References
http://www.martinfowler.com/ieeeSoftware/failFast.pdf!
en.wikipedia.org/wiki/Fail-fast
26