Cascadia Ruby 2014 - Day One
Note: This post is an un-contexualized, un-edited, & un-proofed bunch of notes taken during Cascadia Ruby 2014.
Be Awesome By Being Boring
- “standard is better then better”
- Nobody know how it works yet.
- Docker apis changed.
- No standard uusage pattern.
- Security wild card.
- Protocol Buffer version of your performance critical endpoints.
- SRV Records.
The Science of Success
- Jarvis March (Gift wrapping Algorithm.)
- Monotone Algorithm.
benchmark/ipsRuns iterations per second.
benchmark-bigoBenchmarks big o notation algorithms.
- Programming is hard. Due to abstractions.
- Visual/Spatial Reasoning
- The Squint Test: Stand back and try to discern identifiable parts of the code. Heavily margined, columns.
- Linguistic/Social Reasoning:
- Rubber Ducking.
- Start writing an email describing the problem.
- Please Mr. Gear what is your ratio?
- Practical Object Oriented Design in Ruby - Sandi Metz.
- Body Syntonic Reasoning.
- Pac Man Smell solution.
Designing for Empathy
- GOV.UK: Shows only the next holiday.
- Zappos CS will send you to competitors if it helps you.
- Dropbox setup user friendly opt-out while telecoms require mail sent to a PO box.
Why We Can’t Have Nice Things: Unicode, Dates, and Names
- As humans our assumptions make it in to our code.
- Marriage license database had man and woman id. This fails in states with same sex marriages.
- Time.advance can cuase errors when moving over months with 28 days.
- Scunthorpe problem.
Biggish Data With Rails and Postgresql
- The Vitures of a programmer
- Use real computers to work with your database.
- Use explain.
- Slooow cache misses.
- Slooow disk I/O
- blockdev –setra 2048 /dev/sda
- Read ahead cache
- Slooow Vacuums
- Too Mandy DB Connections
- My locks have locked my locks
- but I have to run a report full of slow queries!
- I can’t delete these old rows!
- Backups take forever
Cloning the Seattle Ruby Brigade
- Don’t always enforce the problem areas.
- Enforce the areas that you need to protect.
N design patterns you might actually use (where N is < 10)
- Outline for a similar task.
- ETL: Extract Transfer Load.
- Share common code.
- Isolate difference.
- Easy to add new versions.
- Force common algorithm.
- Read multiple files
- Inheirtance * 2
- Let consumers ignore quantity.
- Trees of arbitrary depth.
Speed up Rails, Speed up Your Code
- Markov Chains.
- Binary Heap to pick random children.
- ruby -d
- Fewer types =/= faster/easier code.
- Freeze strings if performance requires it.