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

>I think that's a vision of OO that not many OO programs that I've seen actually follow.

Maybe not, but it absolutely was part of the original vision. This is why Smalltalk 80 implements if/else statements and loops as methods, rather than keywords. A boolean in smalltalk is not just a value. It's a latent algorithm for choosing between two blocks of code at some later point in time. It's also a latent algorithm for operating on other booleans via binary logic methods. Until you start seeing objects this way, you will not be able to appreciate the elegance of object-oriented programming.

Here are some examples of how this can work in non-trivial scenarios:

http://www.vpri.org/pdf/tr2007003_ometa.pdf

https://bracha.org/executableGrammars.pdf



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

Search: