This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-10
Channels
- # announcements (2)
- # babashka (20)
- # beginners (381)
- # calva (16)
- # chlorine-clover (21)
- # cider (1)
- # clj-kondo (18)
- # cljs-dev (107)
- # cljsrn (2)
- # clojure (161)
- # clojure-dev (5)
- # clojure-europe (2)
- # clojure-losangeles (3)
- # clojure-nl (3)
- # clojure-uk (35)
- # clojurescript (22)
- # conjure (48)
- # cursive (8)
- # datascript (11)
- # datomic (6)
- # figwheel-main (10)
- # fulcro (85)
- # hoplon (112)
- # jobs (1)
- # kaocha (5)
- # luminus (5)
- # malli (1)
- # off-topic (96)
- # onyx (1)
- # pedestal (1)
- # perun (1)
- # reagent (5)
- # reitit (1)
- # shadow-cljs (34)
- # specmonstah (1)
- # sql (6)
- # tools-deps (3)
- # xtdb (23)
Should we send help?
qweewa, hurd!
We just had an interesting discussion surface while doing pull request reviews. A clean-up of our code was proposed to remove named functions, (fn some-name []...)
, when technically not needed. However, these were originally added with this advise in mind: https://github.com/day8/re-frame/blob/master/docs/Debugging.md#say-no-to-anonymous
Any opinions? "To Anonymous, or Not To Anonymous"
I'm relatively new to the game, so I didn't have any skin in the game, but I agree that it didn't seem to track with almost every example I've seen for use of (fn..)
.
It seems to me to be your usual "practical vs idiomatic" debate. Re-frame advice may be good in the particular context of Reagent components, that's it.
Does it really help stack tracing that much? Usually I just look for the function+line that created the anonymous function in the first place, not the anonymous function.
If you don't do that, you will see errors like "Cannot render component div > > > > > button". Those spaces between >'s are anon components. Similar thing with event handlers and subs.
On the other hand, I haven't had to deal with a whole lot of ClojureScript stack traces yet, I've mostly been using Clojure, and have only begun to start learning ClojureScript.