News for hackers. Stuff that matters.
Re:State of Clojure 2020 by slifin on Friday February 21, 2020 @07:27AM (#22382587)
Most editors should autocomplete those keys for you if you want somewhere that is a centralised location to find those names you could consider using spec https://clojure.org/about/spec

Spec 2 should separate two concepts, schema: all of the possible keys, and selection: the keys used in this particular function, Spec is also recursive

Because spec is part of the language there is a growing ecosystem for defining specification once in spec then translating them to things like database schema, GraphQL schema, OpenAPI schema etc where they can be more "traditionally" understood

You also get other cool things like you can generate conformant data examples given a spec, and use those to create generative tests, as time goes on I think our static analysis tools will start working partially with specs to further their abilities

Specs also power things like this: https://borkdude.github.io/re-find.web/ and I think we're increasingly using them for validation, error detection etc in the core language too

Re:State of Clojure 2020 by kls on Friday February 21, 2020 @08:01AM (#22382748)
Was going to highlight the same thing. even in OO if you are not using tooling like autocomplete, you have to mentally map all of those attributes. Fortunately autocomplete is fairly ubiquitous and it exists for Clojure as well. Visual Studio Code has pretty good support for Clojure via some contributed plugins.
Re:State of Clojure 2020 by int_19h on Friday February 21, 2020 @07:34PM (#22388483)
In OO, autocomplete can be driven by type information, which makes it that much more reliable and relevant.