3 ms·
> rect.set_size(width: 640, height: 480) I've apparently been "ruined" by functional languages because this sort of imperative mutational style of "make this o
by pmarreck 3y ago
> rect.set_size(width: 640, height: 480)
I've apparently been "ruined" by functional languages because this sort of imperative mutational style of "make this object have these attributes" is just an instant turn-off. an equivalent functional style would look something more like:
> rect = Struct.merge_attr(rect, %{width: 640, height: 480})
(assuming you have the Elixir language feature of being able to re-use the same name, but underneath it's actually pointing to a new value; if not, you'd have to assign to a new name, but at least there'd be no ambiguity, and you could still continue to refer to the old name until it went out of scope)
- Hammershaft 3y agoThey did mention the mandlebrot set was made in Lisp.
- xp84 3y agoI’m confused, but I’m very very far from a functional expert. Can you explain a hat is better about that version? It looks longer and less instantly readable to me. I’m sure you functional fans aren’t simply madmen, so I’d just like to hear your perspective.
- xp84 3y ago*a hat = what. Thanks phone.