Weekly notes #17

State machine antipattern, how’s it like to build a Phoenix app for a Rails dev and alternative to Bloom filters w/ delete.

Ruby

The status antipattern - Argues against using too generic ‘state’ or ‘status’ field as a centrepiece for state management (in this example for a billing/ordering system) and instead advocates for null->value one-way transitions, using new DB rows instead of looping (e.g. going from refunded->new), and validations for ‘state transitions’.

Your analytical research using Twitter - a quick, simple intro to using REST Client and Query Operators to analyze tweets.

Made a Phoenix webapp as a veteran Rails dev - a personal account of writing an elixir app. Thanks to Ales Najmann for the link.

Articles

Cuckoo Filters - Alternative to Bloom filters, allows deletion, but slows down when the data structure fills up. A Ruby implementation can be found here.

How I Write Tests - writing tests instead of running the code ‘manually just to check the current state’, using fakes/in memory optimisations and designing formats/dsls for tests inputs/outputs.

A Quick Guide to Testing in Golang - code coverage, property based testing and mocks demonstrated on a fizzbuzz example.

Tools

sconover/wrong - A general assert that understands whats tested and returns human-readable, understandable failure messages.