3 ms·
> I've never understood why so many people insist on this false dichotomy. > I do both. Are you talking about methods attached to your classes or functions th
by choward 6y ago
> I've never understood why so many people insist on this false dichotomy.
> I do both.
Are you talking about methods attached to your classes or functions that are at the root/module level? If it's on a class I would argue it's not a function since it takes input that's not just the parameters to the function. If it doesn't access properties of the class, then whey does it need to be attached to the class?
For example, let's say there is a function that takes instances of two different classes and returns an instance of another class. If you want to move that function to a class, where does it go?
> once I have these functions, I am extremely happy to be able to organize them in classes and modules
I understand the organizing into modules and being able to create interfaces/types, but why classes?