This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-25
Channels
- # aws (10)
- # babashka (4)
- # beginners (103)
- # calva (19)
- # chlorine-clover (2)
- # cider (10)
- # cljs-dev (23)
- # cljsrn (6)
- # clojure (145)
- # clojure-europe (17)
- # clojure-nl (1)
- # clojure-spec (11)
- # clojure-uk (4)
- # clojurescript (64)
- # conjure (11)
- # core-async (19)
- # cursive (38)
- # datomic (4)
- # duct (2)
- # fulcro (51)
- # helix (11)
- # joker (1)
- # kaocha (7)
- # leiningen (3)
- # malli (5)
- # meander (3)
- # off-topic (12)
- # pathom (17)
- # pedestal (2)
- # re-frame (27)
- # rum (11)
- # shadow-cljs (77)
- # xtdb (9)
- # yada (1)
Oops. Sorry about the spam. That was an accident. I've deleted. Thanks for mentioning it.
I might try out VSCode some day soon as well. IntelliJ seems more bloated with each release. Up to the point that it's really slowing me down, but haven't used another IDE for years.
I want to try a new (at least to me) approach to refactor a code base. Main problems are long functions that should be broken down, a few global variables used everywhere, and most of all complete lack of tests. It's a difficult task when I don't even know what are the input/output of most functions, so I thought I would: - "spy" all the functions in the problematic namespaces, so they would write their inputs/outputs somewhere - run the server, simulate normal interactions with it - generate a first version of tests from those logged inputs/outputs - then start improving the tests manually This is so I have at least some kind of safety net when doing refactoring, as well as try to understand better the shape of the data being passed along. Thoughts?
Sounds nice to me!
> - "spy" all the functions in the problematic namespaces, so they would write their inputs/outputs somewhere
If that helps, you can hijack the :pre/:post mechanism for that: :post [(do (log! %) true)]
Maybe I'd defer then start improving the tests manually
till the defn splitting is done. Else you risk refinining coarse defns that don't really represent the final desired status
Relatedly you can use :pre/:post for their more usual purpose as well. This way you have an 'inline test' run at all times. So that you don't have to maintain a bunch of test ns'es in sync At the same time you can write high-level acceptance tests, independent of the number/shape of defns. That way you exercise those pre/posts
there's an excellent spy library for clojure: https://github.com/alexanderjamesking/spy