Andrew Godwin / @andrewgodwin Hi, I’m Andrew Godwin • Principal Engineer at Astronomer (w/on Airflow) • Django Migrations, Channels & Async • Doing bad things with Python since 2005
Andrew Godwin / @andrewgodwin What Is this tech/design common? Can I research elsewhere? Where What's the flow of execution? How do I find side effects? Why What was the context? The other options?
Andrew Godwin / @andrewgodwin t = sum([p for g, es in gs for e, p in es.items()]) total = 0 for group, entries in gs: for entry, price in entries.item(): total += price
Andrew Godwin / @andrewgodwin # Loop forever while True: # Check to see if we should run allocate if self.allocate_timer.check(): self.allocate() # Check to see if we should run clean if self.clean_timer.check(): self.clean() # Sleep for 0.01 seconds time.sleep(0.01)
Andrew Godwin / @andrewgodwin # Main loop - only exit when Ctrl-C or SIGTERM is received while True: # Run workloads if it's time if self.allocate_timer.check(): self.allocate() if self.clean_timer.check(): self.clean() # Sleep so we don't busy-loop if nothing is ready time.sleep(0.01)
“ Andrew Godwin / @andrewgodwin Conway's Law Organizations, who design systems, are constrained to produce designs which are copies of the communication structures of these organizations.
Andrew Godwin / @andrewgodwin Progressive Typing Add types as you are more sure of code layouts Progressive Testing Tests are really helpful for refactors, but can be fragile early on Don't Optimise Early Until you know what the bottlenecks are
Andrew Godwin / @andrewgodwin But Andrew! I work on planes/reactors/life support! Well, first of all, thank you! That's not easy! Also… have you considered Rust?
Andrew Godwin / @andrewgodwin Simple, understandable designs It makes it much easier for others to work with Capture your context and reasons If the context changes, people know it's safe to change your code! Design for iteration It is never, ever done after the initial launch.