3 ms·
The issue the article presents is neither unique to Python, nor a good criticism of the OO model, so I'm not sure what to take away from this. One thing I have
by franga2000 6y ago
The issue the article presents is neither unique to Python, nor a good criticism of the OO model, so I'm not sure what to take away from this.
One thing I haven't seen many comments talk about is how methods as far more discoverable and memorable than functions. Let's say I have a User object. How do I get their (calculated) age? In OO, I can pretty much guess and let autocomplete do the rest: u.get<TAB> and I immediately see getAge(), along with everything else I can get from the object - much easier than looking through documentation or a huge list of functions.
I used to teach highschoolers how to write basic Minecraft plugins as quick intro to Java and the first thing I taught them was to write the name of the variable, then a dot, then press CTRL+Space. This worked absolutely brilliantly and it meant that they really didn't have to think about types and naming conventions all that much. Is it player_teleport() or entity_teleport()? What about NPCs? Nobody cares! thing.teleport() worked on anything you could reasonably be expected to teleport and everyone just understood that with basically no prior programming experience.