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

Common Lisp's object system, CLOS, is indeed a rich and expressive system. But you'll also notice that CLOS does not provide any of the above points. It is an implicit contract between the programmer who developed the code and the programmer consuming the code to (1) not use information that is supposed to be hidden, (2) understand that exported methods are those that make up the "interface" to a class, and (3) understand that the API is that which is written in documentation.


I rarely need to dig into the implementation details of a class but when I do, if the language gets in my way, that's probably a bad thing. People make mistakes in API design and strict API contracts as a feature of the language can be annoying. FWIW, I remember only one case of having to do #define private public in my 10+ year career when dealing with a third-party library. The point is that the API should be a strong suggestion, but not necessarily strongly enforced.

The arguments you make apply equally to Python, btw.




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

Search: