4 ms·
I think this is more of a problem in languages that also encourage having deep class hierarchies with virtual dispatch as their main mechanism of polymorphism.
by stormbrew 13y ago
I think this is more of a problem in languages that also encourage having deep class hierarchies with virtual dispatch as their main mechanism of polymorphism. It's in those languages that you tend to see argument-less functions like Draw() because the entire concept of what it is for that object to be drawn as well as where has been baked in to one large composite object.
In languages that place more emphasis on type deduction and composition it's much more likely you're calling draw to tell it what to draw on, and the aggregate type information once you introduce an argument or two is actually quite rich.
Which leaves you with things like Close(), which, let's be honest, we don't need 30 interfaces that all just have Close in them just because the base language didn't happen to include one. The concept is simple and relatively unambiguous and almost always has to do with some kind of disposal of resource.
- seanmcdirmid 13y agoThat's just how natural language is; languages based on objects will suffer since that can't rely on full natural language power even if based on naturalistic concepts. Any duck typed system simply doesn't care much about name meaning at all.