Random tricks for computing costly sums
Some re-frame patterns for composability
This article proposes some strategies for making re-frame codebases more maintainable, chiefly by making components and events more reusable. The main idea is to enable customization by callers, by allowing callers to inject events, subscriptions, app-db paths and even callback functions as arguments. This approach is not conceptually difficult, but we found it unintuitive when we started using re-frame.
We have been using these patterns over the course of 1.5 years at Ytems (an accounting platforms for accountants focused on independent contractors), for implementing the back-office of accountants, a re-frame networked browser app requiring advanced ergonomics for viewing, searching and editing accounting records, related information, and account customization.
Continue reading →Clojure's keyword namespacing convention Considered Harmful
Thank you for taking the bait of this inflammatory and simplistic title. I promise you that the rest of the article will be more reasoned and nuanced.
In summary: for far-ranging data attributes, such as database columns and API fields, I recommend namespacing keys using 'snake case', contrary to the current Clojure convention of using 'lisp-case' (for example: favour :myapp_user_first_name
over :myapp.user/first-name
), because the portability benefits of the former notation outweigh whatever affordances Clojure provides for the latter. This is an instance of trading local conveniences for system-wide benefits.