This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-14
Channels
- # adventofcode (6)
- # announcements (4)
- # babashka (11)
- # beginners (18)
- # cider (7)
- # clj-kondo (4)
- # clj-on-windows (32)
- # clojars (6)
- # clojure-doc (1)
- # clojure-europe (14)
- # clojure-sg (1)
- # clojurescript (24)
- # conjure (4)
- # cursive (14)
- # datomic (2)
- # events (2)
- # graphql (5)
- # meander (6)
- # missionary (10)
- # nextjournal (6)
- # off-topic (10)
- # pathom (2)
- # pedestal (1)
- # practicalli (1)
- # re-frame (8)
- # reagent (3)
- # releases (1)
- # sci (6)
- # shadow-cljs (10)
- # spacemacs (4)
- # vim (6)
- # xtdb (9)
When setting up a db with different but similar names for things, is it smarter to keep the key name similar to the thing it's modeling or just use a generic name? Example:
(def {:posts [{:post-title "whatever"}] :pages [{:page-title "whatever"}]})
;; versus
(def {:posts [{:title "whatever"}] :pages [{:title "whatever"}]})
I prefer long specific names, even with namespaces. :post-title
or :
. generic names can cause problems with conflicts which can get annoying (defn fun [{:foo/keys [title] :bar/keys [title]}] ...)
1. maybe that's a sign that the two titles should be worked on separately
2. if you really need both in the same function, what's wrong with (defn fun [{foo-title :foo/title bar-title :bar/title}] ...)
?
Sorry, sometimes I get too passionate about design decisions. I didn't mean to sound derisive, I was genuinely asking:slightly_smiling_face: