benjaminsavoy/genapp-template — pull request #1 by gar1t (2013-06-26 17:34:37+00:00)
Title: jiffy to proplists refactor

The main takeaway is the structural refactor of the jiffy_to_proplists function. Erlang lets you do a lot of work in function headers, which is almost always preferable to using pattern matches via variable bindings. If you can get your functions to look like grammar specs, you know you're writing clear, maintainable functions.

Lesser points:

- I religiously avoid comments unless they're absolutely unavoidable
- I personally don't like the "jiffy" reference in the function, but it's arguably better than "json" given the other code-- but I'd wrap calls to jiffy with functions named with "json" (Jiffy is a peanut butter brand in the US and wtf, why do I want to think of peanut butter in my code! :)
- I don't typically write unit tests, but in the case of a conversion function like that, I think they're a good idea -- the pattern I used there in adding tests to the bottom of the module is common (you'll note that tests are automatically run in the shell when the module is reloaded - that's a function of the xxx_reloader module)