Jul 14, 2011
Evolution of a rails programmer

Idiomatic rails action for registering a user if he doesn't exist:

After a year of programming in lisp, I find it most natural to write:

Is this overly concise/obfuscated? I like it because it concisely expresses the error case as an early exit; most of the space is devoted to the successful save, which is straight-line code without distracting branches. It's clearer that we either pick an existing user or create a new one. Form follows function.

* *
tagline
Society from a programmer's perspective.
about me
Code (contributions)
Prose (shorter; favorites)
favorite insights
Life
Making
Work
Cognition
Economics
History
Startups
Social Software
Recently shared

© mmxiii ak