I usually try to organize related things in different files in the same order to ease code reviewing, reading and writing new code. For example: order of protocol method declarations, their definitions in records and unit tests. And I was wondering what's the best way to order keys in maps and specs.
The simple rule could be to always sort keys lexically, so that the order stays the same across files and there's no additional thinking needed when adding new keys. But with `s/keys` it's not that simple since `:req`/`:req-un` can break the consistency across the files. E.g. during spec definition the correct lexical order is `:req-un [:a/x :a/y ::d]`, but during "usage" it will be different: `{:d ... :x ... :y ...}`. The lesser drawback of this approach is that some human-friendliness is lost, e.g. keys `host, port, db, user, password` must be ordered as `db, host, password, port, user`. Do you try to maintain the same order of map keys (including keys in specs) across the files? If yes, what rules do you follow? Thank you. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/d29d4e36-4dee-4bd6-9347-7fa397103f5e%40googlegroups.com.