News for hackers. Stuff that matters.
Re:Stability by Design by 0xDEAFBEAD on Friday May 09, 2025 @12:07AM (#43933710)
>For example, over its lifetime the Clojure community has shifted from accepting argument lists and named parameters in their functions to accepting a single hashmap. This is because the single hashmap is easier to grow over time.

This seems a little nuts, to be honest. It feels like you're just pushing failures from easy-to-diagnose issues with the function signature, to hard-to-diagnose issues with the function body. Basically the function body now has to support any combination of hash parameters that the function has ever taken over its entire history -- Is this information documented? Do you have test coverage for every possible parameter combo?

Re:Stability by Design by jiehong on Friday May 09, 2025 @01:08AM (#43933953)
I think it was meant from old style functions to new style, but not changing a given function’s signature this way.
Re:Stability by Design by MarkMarine on Friday May 09, 2025 @01:57AM (#43934171)
no, you pull out the things you need from the map in the function body and move forward. I recommend either reading up on how this works in Clojure or just trying it, it's pretty simple.

https://clojure.org/guides/destructuring#_associative_destru...

Some extra reading if you're curious: https://softwareengineering.stackexchange.com/questions/2723...

Re:Stability by Design by upghost on Friday May 09, 2025 @07:34AM (#43935688)
It is nuts, especially in ClojureScript.

"Am I missing a key, is the value in the hashmap nil, or was there an upstream error or error in this function that is presenting as nil?"

Re:Stability by Design by potetm on Friday May 09, 2025 @07:42AM (#43935743)
I'm sympathetic to this idea, but in practice it's very manageable. Function signatures destructure exactly the data that they need, so it's easy to tell what's required and what's optional.

Of course, normal rules apply like, "Don't pollute your program with a proliferation of booleans."