This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-01
Channels
- # announcements (3)
- # babashka (1)
- # beginners (29)
- # calva (3)
- # cider (5)
- # clojure (17)
- # clojure-europe (9)
- # clojurescript (31)
- # conjure (2)
- # cursive (14)
- # datomic (51)
- # deps-new (4)
- # honeysql (8)
- # introduce-yourself (1)
- # lumo (8)
- # malli (28)
- # missionary (1)
- # off-topic (20)
- # pathom (2)
- # polylith (22)
- # practicalli (10)
- # reagent (3)
- # reitit (6)
- # ring (2)
- # schema (2)
- # shadow-cljs (25)
- # spacemacs (3)
95% of the instances I saw it used the programmer should have used properties or defined a -simple-schema
It is used in a way too general manner, usually one which impairs serialization and generation
We can write guides and improve documentation and give workshops and do backflips and pay for ads on the superbowl, people will still use :fn
because it's easy
I think -simple-schema is not always what you want to do. And yes :fn is pretty handy, especially if you don't need transformers and generators but only validation. I'm not sure it would be a good move to force people to use -simple-schema just for validation (e.g. involving two or more map entries).
This is absolutely me speaking from frustration, not a definitive or proscriptive solution
Ok, make total sense now. I just took it as a proposal of change. I need to develop a sense of humour I guess 😅
Frustrated by half a day fighting with badly written and used malli schemas Everything can and will be abused
I don't know you particular case, so just guessing... Maybe organising some internal training showing how to use Malli could avoid that kind of tool misuse in the future 😉🚀
I am actually working on internal training which I hope I'll be able to release mostly as a contributed getting started guide
I suspect this also has to do with docs. It can be hard to fully enumerate the possibilities of a given API, and something like :fn
just works.
I agree with this point.
@UK0810AQ2 tbh with you, I understand the points that frustrates you, but I wouldn't be two weeks ago. The thing is that Malli is nice to use once you know it, but it is fairly confusing when you start. I think that it might be the source of the problem, that people are using the simplest solutions they know, because they simply don't know all the features of the tool.
Let's take my example. I used spec before, but haven't used spec.tools nor prismatic schema. Some of the concepts were simply new to me. E.g. transformers, there are at least four ways of transforming values with Malli, and it is not obvious what they are and how they work. I discovered it by reading the docs, examples, Malli impl and reading the Tommis answers here. I don't have daily job and I could invest a bit of time, still not everyone can afford that much of investment, so most of the time, I guess, people pragmatically makes things done 🙂
In this particular topic, using Malli transformers, I intend to make a comprehensive writing at some point to make the process easier for others. I think in case of :fn
and simple-schema
case is the same, people might not be aware when/where to use what 🙂
I agree. Malli's docs are comprehensive but like man pages they don't tell you where to start, they don't guide you towards "I want to do X"
is there a more idomatic way of defining a map that must have a key but the value can be nullable. Here's what I've currently got:
(defn ? [predicate] [:or predicate nil?])
(def MyThing
[:map
[:someValue (? string?)]])