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.

* *
interests
Social software
Tools for programmers
published
Code (contributions)
Prose (shorter, favorites)
favorite insights
Programming
Social Software

Life
Making
Work
Startups

Social Dynamics
Cognition
Economics
History

Links I peddle to everyone I know
subscribe → subscribe →

© mmxi ak