Comment

Comment by hodwik

Python has all of the constituent parts of an OO language, save explicit types, but it is never written in an OO style.

Using classes != OO.

Generally, Python programmers treat objects as structs with associated methods, basically the Go model. Python programmers rarely encapsulate at all. At best, they use a bunch of accessors (which is not itself OO). Implementation details are rarely hidden.

That's because dynamically-typed languages, the interpreter, and the Python culture, lend themselves more to exploratory programming, rather than a UML-design, with objects that relate to real-world entities, that are implemented after careful planning.

If you can show me a Python program where objects are really encapsulated, and aren't chock-full of accessors, I'll stand happily corrected.

parent hodwik 10 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton