3 ms·
This made me think: if we wrote object oriented code methods where all the members that we access are passed explicitly as parameters, as well as all the member
by mujina93 5y ago
This made me think: if we wrote object oriented code methods where all the members that we access are passed explicitly as parameters, as well as all the members that we modify (as out references), then we at least would immediately identify the real complexity of some methods!
I'll try to do this, I'm curious to see how that would look like.
- raducu 5y ago> I'll try to do this, I'm curious to see how that would look like. That looks like a terrible mess. The problem is not state, but messy access to it.
- usrusr 5y agoEverybody agrees that OOP was killed by getters and setters. But I don't think that there is much consensus about how long it would have survived without. (I'm not saying that OOP doesn't have its place, but it has clearly turned from a way of structuring code to universally strive for into something to avoid if possible)
- andi999 5y agoAt some point you get too many parameters, so you pass a struct, which basically means that struct turned into an object. (one interesting difference is that you can pass more than one different struct to that function which is the equivalent of subclassing; but with more permutations possible. Thats actually interesting).