Fork me on GitHub
#off-topic
<
2023-07-12
>
teodorlu10:07:38

Hi! Looking for an old blog post. Title something like “Lost in a forest of maps, all looking alike”. It was about working without structure with maps and data in Clojure, not properly encapsulating tings, and ending up with a very confusing code base. Anyone remember the text?

2
teodorlu11:07:46

aaah, amazing! That’s it. Presentation, not blog post. Thanks, @U2FRKM4TW! 💯 💯

👍 2
p-himik11:07:17

Just in case it might be useful, there's also a podcast episode from Eric that on the surface kinda argues the opposite: https://ericnormand.me/podcast/why-getters-and-setters-are-terrible When I asked Eric about it in an email, his answer was: > The two things aren't in conflict. Getters and setters are tools. We should use them when needed. > > In the Java getters and setters example, as a layer of indirection, they usually aren't useful. They might as well make the fields public and access the field alone. However, people put getters and setters in by default. Furthermore, the programmers are ignoring the strength of the OO paradigm, which is to build objects which maintain consistent relationships between their fields. If you are allowed to set them, they can't maintain the relationship. > > In the Clojure nested maps example, Clojure gives you getters and setters for free (with get and assoc). You can get very far with them. However, if you find you are in a real mess, like I explain in the talk, where you've got maps you can't remember the keys of, or what data is nested, etc, a bit of abstraction is called for. Explicit domain-specific getters and setters (or updaters) might help.

💯 4
teodorlu11:07:55

love this part: > However, if you find you are in a real mess, like I explain in the talk, where you’ve got maps you can’t remember the keys of, or what data is nested, etc, a bit of abstraction is called for. Explicit domain-specific getters and setters (or updaters) might help.

teodorlu11:07:19

use abstraction when abstraction is called for

p-himik11:07:23

Yeah. Aids for your mind instead of shutters on all windows. :)

❤️ 2
Samuel Ludwig13:07:26

not sure if he references it in the talk/podcast, but this seems to be what the whole concept of Lenses/Optics is trying to solve

mauricio.szabo21:07:26

> Lenses/Optics is trying to solve Or Pathom, for me, in multiple cases 🙂

Ben Sless18:07:28

Looking for a repo with a ton of 4clojure solutions, ring any bells?

Ben Sless18:07:00

refinement: it had all the solutions in code files, could serve dual purpose of benchmarking compilation and regression