Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General typography question: Entity, entity?, entity-schema? #463

Open
piotr-yuxuan opened this issue Jun 4, 2021 · 2 comments
Open

General typography question: Entity, entity?, entity-schema? #463

piotr-yuxuan opened this issue Jun 4, 2021 · 2 comments
Labels
for discussion Discussion is main focus of PR

Comments

@piotr-yuxuan
Copy link
Contributor

piotr-yuxuan commented Jun 4, 2021

Hello, thanks for this very well-thought tool!

The README of this lib usually names schemas like Address, Age, but also abcd, my-schema, and obviously a datum schema can be named int? or boolean?. The style guide of @bbatsov talks about types and suggests CapitalCase. Would we have some general rules of thumb when it comes to naming conventions for malli schemas?

If I were to suggest some, I would go for:

  • A schema for atomic datum is a predicate -> datum? (but not all predicates are for schema);
  • A schema for datastructure is akin to a data type / shape, not very different from Java objects -> DataStructure;
  • Names like my-address are for functions, or constant, and my-order-schema denotes a function returning a schema for some order, where the schema can be tweaked based on fn arguments.

It may or may not look like bikeshedding, sorry for that 😅

Cheers! 👍

@ikitommi ikitommi added the for discussion Discussion is main focus of PR label Jul 16, 2021
@ikitommi
Copy link
Member

Thanks. Sounds about what I have though about it. Also registry references should have a naming guide.

Just wrote the function schema guide and was wondering what is a good name for a function schema. Ended up with =>plus, which is far from perfect.

@piotr-yuxuan
Copy link
Contributor Author

I would suggest that plus-schema denotes a function returning a schema, but I agree it is far from perfect, albeit kind of explicit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for discussion Discussion is main focus of PR
Projects
None yet
Development

No branches or pull requests

2 participants