4 ms·
You mean you don't like that the methods are declared outside of the struct? Or that you have to say foo(x) instead of x.foo()? The latter makes writing code
by mac01021 8y ago
You mean you don't like that the methods are declared outside of the struct?
Or that you have to say foo(x) instead of x.foo()?
The latter makes writing code using autocomplete less doable, but reads more naturally in many cases.
I can't think of compelling pragmatic reason to mind the former, but if you have one I'd like to hear it.
- Tarq0n 8y agoPipes are a nice compromise perhaps. x |> foo(). You get the clear left-to-right flow and easy autocomplete.
- Iwan-Zotow 8y agoclass methods provides namespace and scope