This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-12-01
Channels
- # adventofcode (77)
- # announcements (1)
- # architecture (6)
- # babashka (16)
- # beginners (28)
- # calva (2)
- # cider (5)
- # clj-kondo (28)
- # clojure (63)
- # clojure-europe (39)
- # clojure-nl (1)
- # clojure-norway (10)
- # clojure-uk (3)
- # clojurebridge (2)
- # clojurescript (23)
- # cursive (1)
- # datalevin (1)
- # dev-tooling (2)
- # emacs (16)
- # events (3)
- # fulcro (8)
- # guix (3)
- # honeysql (16)
- # introduce-yourself (1)
- # jobs (1)
- # joyride (91)
- # lambdaisland (1)
- # lsp (18)
- # membrane (1)
- # nbb (1)
- # off-topic (62)
- # pathom (4)
- # portal (11)
- # rdf (4)
- # re-frame (4)
- # releases (3)
- # shadow-cljs (55)
- # tools-deps (10)
- # xtdb (3)
- # yada (5)
morning
anyone wanna do some Advent of Code puzzles in babashka, nbb or clerk? https://github.com/borkdude/advent-of-babashka-template https://github.com/nextjournal/advent-of-clerk
why oh why can't the m2 local repo be configured as an external environment variable
what do y'all do when your test namespace gets unwieldy ? i've got a case here where an API+impl namespace is 500loc, but the corresponding test namespace is over 1kloc and growing ... my thoughts are to do one of: 1. ignore 2. split the test namespace alone (which will confuse some tooling) 3. move the impls out of the API namespace, then split the impls namespace and the test namespace in step leaning towards option 3 atm...
a lot of different cases ... there are about a dozen functions in the api ns, and each of those requires testing with a few different broad classes of input, and sometimes multiple cases within each class of input ... there is perhaps some scope for abstracting the test code some more, but i have 100 occurences of testing
so just quite a lot of individual cases
well a few days ago i was all enthusiastic to use test.check
, but sadly this codebase is both clj+cljs and async, and i couldn't see any way of making test.check
work with it
i'm already using a set of modified deftest
and testing
macros to give me uniform async tests on both clj and cljs ... and afaics test.check
would need a rewrite to work with async, so i gave up on it
what's the actual manifestation of 'unwieldy'?
@U0509NKGK i find files of >500loc increasingly hard to navigate, extremely hard when >1000loc... on files <500loc i can navigate very quickly by the "visual shape" of the code, but the bigger the file gets the less i seem able to do that... so i prefer files to be <~500loc
dyu mean this hyperfiddle @UK0810AQ2? https://github.com/hyperfiddle/hyperfiddle-2020
ah, ok - yeah, rcf seems to have the aim of unifying clj + cljs tests ... i don't think that would be any more compatible with test.check
though
yep... i have no problem with that though - i have macros which support async tests on clj+cljs, and the tests look and behave almost exactly the same as vanilla clojure.test/deftest
tests
I've enjoyed 3
for a few years. Strict API/impl separation in sources and tests with a simple 1:1 mapping. No privacy, keeping the deftests hack-free.
I'd go as far as linting that no single ns can exceed ~300LOC - at that point, more often than not things start getting complect-y.
(also, code reloading gets faster if you're into reloading one ns at time. Be it with require :reload
or tools.namespace)
i find that having a truly reliable lsp go-to-definition is making the line count less of a problem for me. we maintain a 10 year old 150kloc clj[sc] codebase, we've long since left being able to remember where stuff behind, and now lean into knowing how to look for it efficiently
however when doing substantial work on a piece of code, that's where pulling things apart into separate nses tends to happen š
Imagine multiple mini windows where the definitions spread out of the form under view like a tree
@U0509NKGK i have a similar size codebase, not quite so old ... and have plenty of opportunities to let sleeping dogs lie š¬ ... but in this case i'm taking one of the foundational libraries and refactoring/rewriting it with the learning of all those years, so everything is up for grabs
@U45T93RA6 what's your favoured technique for referring to impls from APIs ? i've been using simple def
s recently, since clj+cljs is more important to me than the nice metadata transparency you get with things like potemkin/import-vars
@U0509NKGK totally agree that ability to navigate across a complete codebase is very important as the codebase gets larger ... i abandoned spacemacs because it's nav was too laggy (doom + CIDER is working well for me now)