Fork me on GitHub

@adamkowalski: You can elide asserts (including :pre and :post). In ClojureScript, for example, you compile with the :elide-asserts compiler option set to true.


@adamkowalski: FWIW, at World Singles we went back and forth several times between core.typed and Schema and ended up removing both completely. We found both were too cumbersome for the benefits they provided.


Schema is runtime only anyway and relies on you having extensive path coverage in your tests. core.typed can be run as a separate phase but it’s still very hard to satisfy its type inference and checking engine with idiomatic Clojure. CirceCI wrote about how they had been using core.typed extensively but gave up on it.


@mfikes: thats good to know, it seems like they may be the best option moving forward


@seancorfield: so now that you have had some experience with multiple different solutions, can you elaborate on a strategy you guys use instead of type checking or using schema? do you rely purely on tests, and if so how has that worked for you in larger projects


First off, we try to develop nearly all code "live" via the REPL or in a strictly test-first manner (but mostly via the REPL).


Second, we try to create idiomatic code that is natural to use (this is the hardest part - and it's a continual evolution). Idiomatic code is more natural to use so you're less likely to make mistakes when composing it. Functions are short, generally pure, carefully named, and all public.


Third, good docstrings written in a consistent style "Given {description of each argument}, returns {description of result}. {specify if/when result can be nil}."


Namespaces that match the business domain where possible.


And communicate with your team.


And, yeah, we have quite a lot of tests.


About 10k lines of tests for about 30k lines of production code.


anyone based in london happy to meet to work on a small clojure project? I’m a ruby/javascript developer that wants learn 😄


@mostr: thanks for the very helpful pointer


@seancorfield: would have loved seeing that list a few months ago, you should totally blog this if you haven't already simple_smile


@mariogintili: Would hangout be an option, too?


sure, it’s just to learn clojure - on a not-for-profit basis


and if you have any ideas for a project even better 😄


An hangout would be cool! Noobs from all around the world united! 😄


10 people with no skill cramped on the same function 😂


That sounds pretty cool


@val_waeselynck: I think it should be something the community could contribute to like the style guide


That covers the code-level details but not the workflow / idiomatic best practices.


@seancorfield: That sounds like a great idea. Unfortunately I'm much too of a beginner to be able to contribute to that in any meaningful way.


@straistra: Beginners often have very insightful questions to ask — and those are valuable contributions too!


But having a community "best practices" page on GH seems like a better option than a blog post, although I may start with a blog post about how we do stuff at World Singles, just to get enough input to create such a community page somewhere…


… and as it happens we’re going through a big "business process documentation" phase at work already so some of it might fall out of that.


Given a vector [“a” “b” “c”], how could I partition (wrong choice of word perhaps) it to get a result like [[“a” “b”] [“b” “c”]]? i.e. pairs of [n n+1], but no lonely item at the tail. I can do this in ugly javascript, can’t really think of a nice functional way to do it


Aand just found it. (partition 2 1 vector)