Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The Scientist & The Engineer
Search
Andrew Godwin
February 07, 2020
Programming
1
570
The Scientist & The Engineer
My keynote from PyCon Colombia 2020.
Andrew Godwin
February 07, 2020
Tweet
Share
More Decks by Andrew Godwin
See All by Andrew Godwin
Reconciling Everything
andrewgodwin
1
200
Django Through The Years
andrewgodwin
0
86
Writing Maintainable Software At Scale
andrewgodwin
0
330
A Newcomer's Guide To Airflow's Architecture
andrewgodwin
0
240
Async, Python, and the Future
andrewgodwin
2
540
How To Break Django: With Async
andrewgodwin
1
570
Taking Django's ORM Async
andrewgodwin
0
580
The Long Road To Asynchrony
andrewgodwin
0
510
Pioneering Real-Time
andrewgodwin
0
270
Other Decks in Programming
See All in Programming
Changed Rules: Architectures with Lightweight Stores
manfredsteyer
PRO
0
240
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
8
4k
Site Reliability Engineering for GMO
pyama86
7
1k
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
180
StoreKit2によるiOSのアプリ内課金のリニューアル
kangnux
0
110
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
230
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
360
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
190
Build Apps for iOS, Android & Desktop in 100% Kotlin With Compose Multiplatform (mDevCamp 2024)
zsmb
0
280
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
200
Git Lint
bkuhlmann
4
750
Semantic search with Django and pgvector
pauloxnet
0
240
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
216
8.6k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
14
1.5k
Writing Fast Ruby
sferik
621
60k
Making Projects Easy
brettharned
108
5.5k
The Illustrated Children's Guide to Kubernetes
chrisshort
31
46k
In The Pink: A Labor of Love
frogandcode
138
21k
What’s in a name? Adding method to the madness
productmarketing
PRO
16
2.6k
What's new in Ruby 2.0
geeforr
337
31k
The Brand Is Dead. Long Live the Brand.
mthomps
49
28k
We Have a Design System, Now What?
morganepeng
43
6.7k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
60
14k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Transcript
THE SCIENTIST ANDREW GODWIN // @andrewgodwin THE ENGINEER AND
Hi, I’m Andrew Godwin
I call myself an "engineer"
But I studied Computer Science
I knew programming going in. But this was different.
“ Edsger Dijkstra Computer science is no more about computers
than astronomy is about telescopes.
Computer Science is idealistic
"Turing-complete"
We first want to prove it is possible
async def sleep_sort(numbers): async def sleep_add(number): await asyncio.sleep(number) result.append(number) result
= [] await asyncio.wait([ sleep_add(number) for number in numbers ]) return result
We can prove that programs are correct
def is_two(number): return number == 2
>>> import __builtin__ >>> __builtin__.True = False >>> True False
>>> True == False True (Thankfully, only works in Python 2!)
"Communicating Sequential Processes", C. A. R Hoare
contains :: (Ord a) => (Tree a) -> a ->
Bool contains Nil _ = False contains (Node t1 v t2) x | x == v = True | x < v = contains t1 x | x > v = contains t2 x
A perfect world, of perfect programs
“ Benjamin Brewster In theory there is no difference between
theory and practice. In practice there is.
Software Engineering takes shortcuts
When is it safe to take a risk?
None
Software is faster and cheaper to change
The real world is a nasty place
How often does a cosmic ray affect RAM? 36 hours
(for 16GB; "SEU at Ground Level", Eugene Normand) How long can an unpowered SSD keep data? 3 weeks - 1 year (Enterprise at 40ºC, Client at 30ºC; Intel/JEDEC) Does quantum tunneling affect CPUs? Continuously!
Always design for failure
How do we reason about software?
Input Process Output
async def disable_alarm(): ... async def open_door(): ... await asyncio.wait(
[disable_alarm(), open_door()] )
Input Rendering Output Validation Reporting Storage Processing Logging Cache
Django has 250,000 lines of code
An Airbus A380 has 4,000,000 parts
A new car has 100,000,000 lines of code
How are we supposed to handle this?
Abstract, verify and forget
Abstract Define a contract - types, behaviour, exceptions Verify Write
tests to keep the contract valid Forget Work with the contract, not the fine details
You have to learn to forget
Engineering is communication
“ Grace Hopper A ship in port is safe, but
that's not what ships are built for.
Build to expect growth
Build to expect failure
Everyone can build near-perfect software
Know when not to!
Python lets you do both.
Types Start without types, progressively add with mypy Async Make
it work synchronously first. Add async later. Speed Write slow, understandable code. Test it. Then improve it.
Scientists observe and question
Engineers build and invent
All software has consequences
Be the scientist and the engineer
Gracias. Andrew Godwin @andrewgodwin // aeracode.org