Skip to content

Commit 0a8df67

Browse files
committed
Update motivations
1 parent b4e9727 commit 0a8df67

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,14 @@ The API is very minimal, there is just a single `defn` macro in the public API.
7878

7979
## Motivation
8080

81-
I've been using Clojure spec for a while, but I found that I often resisted writing specs for functions. This was mostly because I didn't want to have to duplicate a bunch of information into the `fdef`. It's not a huge deal, but in my experience it was enough to deter me from writing specs while I was heavily working on an area of code. I created defn-spec to increase the locality of the spec definitions, and to reduce the activation energy to start adding specs to your codebase.
81+
I've been using Clojure spec for a while, but I found that I often resisted writing specs for functions. This was mostly because I didn't want to have to duplicate a bunch of information into the `fdef`. It's not a huge deal, but in my experience it was enough to deter me from writing specs while I was heavily working on an area of code.
82+
83+
I created defn-spec to increase the locality of the spec definitions, and to reduce the activation energy to start adding specs to your codebase. I wanted to make something that was small enough to drop into any project or library I worked on.
8284

8385
## Alternatives
8486

85-
* Orchestra has a [defn-spec](https://github.com/jeaye/orchestra#defn-spec) macro. The net.danielcompton defn-spec allows for optionally only speccing part of the function, and matches the well-known Schema defn syntax.
86-
* [Ghostwheel](https://github.com/gnl/ghostwheel) has a defn macro. It also introduces a new way of describing specs. This project tries to not introduce any extra concepts for defining specs, apart from the ability to add spec hints to arguments.
87+
* Orchestra has a [defn-spec](https://github.com/jeaye/orchestra#defn-spec) macro. Cursive doesn't yet have support for this macro though, and it requires you to provide specs for every function argument. Orchestra is great though, and I recommend everyone check it out, especially for instrumenting their `:ret` and `:fn` specs.
88+
* [Ghostwheel](https://github.com/gnl/ghostwheel) has a defn macro. It also introduces a new way of describing specs, along with many other useful features.
8789
* [Provisdom/defn-spec](https://github.com/Provisdom/defn-spec) is more focused on instrumenting functions. It does allow inline definitions of specs, though the syntax is much the same as in an `fdef`.
8890

8991
Try them all out though, and see which one works best for you.

0 commit comments

Comments
 (0)