Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Python didn't used to have such flexible classes. It has migrated that way over time. So 'dick move' doesn't seem to be a valid criticism, to me.

That said, Python is a hybrid under the hood. It has become more prototypal over time, but still enforces the distinctions between classes and instances.

I personally think that the opportunity to fundamentally open Python to a better object model was missed when Metaclasses were added. I like Metaclasses in Python, I think they need to be there, and help all kinds of tasks. But it might have been better still to support full prototypal inheritance at that point.

The complaint I'm making is definitely true of Python though, because it dresses its objects in the outfit of classes and instances, few programmers end up understanding the underlying model and how it can be used to improve their code. And, because of that, it is unwise to use those techniques in code that will be written and maintained by a team. I tend to get nervous of code that uses custom Metaclasses, for example, because of the burden of education is imposes on a project.

I'd prefer a situation where Prototypal inheritance was actually taught as the Javascript approach. But perhaps that is utopian and naive.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: