This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-10
Channels
- # aleph (1)
- # beginners (4)
- # biff (7)
- # calva (7)
- # cider (8)
- # clara (17)
- # clerk (19)
- # clj-kondo (30)
- # clojure (12)
- # clojure-austin (1)
- # clojure-europe (12)
- # clojure-losangeles (1)
- # clojure-norway (21)
- # clojurescript (2)
- # datalevin (1)
- # datomic (24)
- # duct (3)
- # fulcro (8)
- # hyperfiddle (8)
- # lambdaisland (4)
- # membrane (6)
- # missionary (7)
- # off-topic (55)
- # overtone (2)
- # reagent (4)
- # reitit (4)
- # releases (6)
- # shadow-cljs (80)
Morning
I promised I'll share what I cobbled together, this is by no way an authoritative source. Still, there's a chance we could hammer out something useful, so your thoughts, feedback and contributions are welcome https://github.com/bsless/100-clojure-mistakes
This is great! Still reading thru it...
Great stuff! Two things: when you write 'something vs something' it's not clear which is wrong and which is good practice (and why, for example in namespaces)
And second. There is no :constant
tag. It's :const
. It causes numerical values to be inlined.
Great idea and lots of good content already! A couple of additions spring to mind:
ā¢ pmap
ā¢ fire-and-forget future
swallowing exceptions
ā¢ using reduce
without explicit init
ā¢ concat
https://stuartsierra.com/2015/04/26/clojure-donts-concat
Categorizing: ā¢ pmap, future: concurrency ā¢ reduce: ?? ā¢ concat: laziness
In case of constants: strings and primitives are inlined. Any other objects are used as a static final var instead of a calling a getRootRoot()
.
Just a reminder that there is also: https://github.com/bbatsov/clojure-style-guide and some others (https://nextjournal.com/lambdaisland/clojure-style-guide) , https://github.com/metabase/metabase/wiki/Metabase-Clojure-Style-Guide