Guide to start using Specs?

I tried to read official docs for several times, but it still confuses me how to solve my real-world problems in Specs. I’m using assert to very some of my arguments in my projects and definitely I need something more powerful.

I had the same confusion when I first saw specs. Then I practised parsing a lot data structures with clojure.spec/conform and suddenly things get clearer :slight_smile:

Do you write blogs when you practice?

Sorry, I didn’t think about that. But that’s a good idea!

Hi,

Maybe you’ll find these interesting:

Cheers

2 Likes

Have you read the official guide https://clojure.org/guides/spec it was enough for me to get going.

tried to read official docs for several times

I doubted if there are others things I need to learn first. I don’t have much experience on testing or backend being a front-end developer.

Oh, sorry, when you said docs I thought you meant https://clojure.github.io/spec.alpha/clojure.spec.alpha-api.html#clojure.spec.alpha

I have not found a lot of good tutorials appart from the official guide yet, since its all pretty new.

Fogus’ blog posts look promising:

  1. http://blog.fogus.me/2017/01/10/clojure-spec-introduction/
  2. http://blog.fogus.me/2017/02/10/clojure-spec-data-design-01-sketching-a-struct/

If only there were more posts in this series :).

2 Likes

Why it has to be namespaced keywords in Clojure Spec?

Just like immutability is enforced in Clojure so people don’t shoot themselves on the foot, only namespaced keywords are allowed for good reason: no name collision in the long run

2 Likes