Fork me on GitHub

spam in announcements


Oops. Sorry about the spam. That was an accident. I've deleted. Thanks for mentioning it.

πŸ‘ 8

bit by any? 😞


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


Thanks for the ideas. I haven't used :pre/:post yet, I'll give them a try

✌️ 4

there's an excellent spy library for clojure:


Jose Valim (creator of Elixir) just announced this:

πŸ‘ 4

Essentially you can use that platform to sell a software library. Consume it via normal tooling (npm, maven, etc). Seems like it’s not launched yet but seems useful.

πŸ‘€ 12
πŸ‘ 12