Life, Liberty, and
the Pursuit of
APIness
The Secret to Happy Code
Dylan Beattie
@dylanbeattie
www.dylanbeattie.net
dot
net
sheff
Slide 2
@
dylanbeattie
•
Building websites since 1992
•
CTO @SkillsMatter
•
Microsoft MVP
•
London .NET User Group
•
www.dylanbeattie.net
•
dylan@dylanbeattie.net
How To Draw An Owl:
1: draw an oval for the head
2: draw an oval for the body
3: draw the rest of the owl
@dylanbeattie
happycode
Slide 9
EXPERIENCE
EXPERTISE
@dylanbeattie
happycode
Slide 10
Server Error in '/' Application
Looks like you forgot to register the http module
Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule
. To fix this add <add
name="
PerWebRequestLifestyle
"
type="
Castle.MicroKernel.Lifestyle.PerWebRequestLifeStyleModule
,
Castle.Windsor
" /> to the
<
httpModules
section on your
web.config
@dylanbeattie
happycode
Slide 11
Do you
believe in…
the users?
@dylanbeattie
happycode
Slide 12
@dylanbeattie
happycode
Slide 13
(image from @
DrunkVS
via Twitter)
@dylanbeattie
happycode
Slide 14
@dylanbeattie
happycode
Slide 15
@dylanbeattie
happycode
Slide 16
@dylanbeattie
happycode
Slide 17
By
MBlairMartin
Own work, CC BY
SA 4.0,
https://commons.wikimedia.org/w/index.php?curid=50244059
@dylanbeattie
happycode
Slide 18
A>
@dylanbeattie
happycode
Slide 19
A>hello
@dylanbeattie
happycode
Slide 20
A>hello
Bad command or file name
A>
@dylanbeattie
happycode
Slide 21
A>hello
Bad command or file name
A>menu
Bad command or file name
A>help
Bad command or file name
A>
@dylanbeattie
happycode
Slide 22
A>if you're happy and you know it, syntax error
Syntax error
A>if you're happy and you know it, syntax error
Syntax error
A>if you're happy and you know it and you really
want to show it if you're happy and you know it
syntax error
@dylanbeattie
happycode
Slide 23
A>if you're happy and you know it, syntax error
Syntax error
A>if you're happy and you know it, syntax error
Syntax error
A>if you're happy and you know it and you really
want to show it if you're happy and you know it
syntax error
Syntax error
A>
@dylanbeattie
happycode
Slide 24
@dylanbeattie
happycode
Slide 25
@dylanbeattie
happycode
Slide 26
Type Your Program Here
@dylanbeattie
happycode
Slide 27
@dylanbeattie
happycode
Slide 28
Microsoft Edge video
@dylanbeattie
happycode
Slide 29
Slide 30
@dylanbeattie
happycode
Slide 31
here?
Oxfordian
Kissuth
via Wikimedia Commons : https://commons.wikimedia.org/wiki/File:Hyde_Park_sign_post.jpg
@dylanbeattie
Time
CPU Consumption
100%
80%
60%
40%
20%
0%
@dylanbeattie
happycode
Slide 46
Time
CPU Consumption
100%
80%
60%
40%
20%
0%
@dylanbeattie
happycode
Slide 47
Time
CPU Consumption
100%
80%
60%
40%
20%
0%
@dylanbeattie
happycode
Slide 48
Time
CPU Consumption
100%
80%
60%
40%
20%
0%
@dylanbeattie
happycode
Slide 49
Time
CPU Consumption
100%
80%
60%
40%
20%
0%
@dylanbeattie
happycode
Slide 50
Time
CPU Consumption
100%
80%
60%
40%
20%
0%
10:00
11:00
12:00
13:00
14:00
15:00
@dylanbeattie
happycode
Slide 51
Time
CPU Consumption
100%
80%
60%
40%
20%
0%
Jan
Feb
Mar
Apr
May
Jun
Jul
@dylanbeattie
happycode
Slide 52
@dylanbeattie
happycode
Slide 53
FATAL
ERROR
WARN
INFO
DEBUG
@dylanbeattie
happycode
Slide 54
FATAL
•
Application is completely unresponsive
•
Multiple users affected with immediate effect
•
Immediate attention. Stop what you’re doing
and look into it.
@dylanbeattie
happycode
Slide 55
ERROR
&
WARN
•
They
will
happen.
•
ERROR
–
one person noticed, maybe?
•
WARN
–
nobody noticed but it’s still odd.
•
Individual messages probably aren’t useful
@dylanbeattie
happycode
Slide 56
https://universitycompare.com/articles/worst
commuters
sit
next
tube/
@dylanbeattie
happycode
Slide 57
INFO
•
Everything’s fine
•
Startup
, shutdown, cache recycle
•
In a perfect world,
INFO
is all you’ll ever see.
@dylanbeattie