4 ms·
If you use a typical IDE that comes with Squeak or VisualWorks, you can quickly inspect a lot of idiomatic code from the standard library. The most common mista
by arendtio 8y ago
If you use a typical IDE that comes with Squeak or VisualWorks, you can quickly inspect a lot of idiomatic code from the standard library. The most common mistake I have seen is that people who know about other programming languages, start looking at OOP as a way to separate and organize code.
Instead, it starts from the other side: OOP is based on a few core concepts, and those concepts are critical to understanding OOP. The first concept is 'Everything is an object', the second might be 'Objects can receive messages'. So if you have some code:
1 + 2
It means that there is an object '1' which receives a message '+ 2'. If '1' is an Integer, Float, String or whatever might be relevant for its inner workings but if you want to understand OOP you first have to understand the concept-side of it (and ignore the implementation). Once you know the concepts, you can reason about good and bad implementation/code.
You might wonder about the preachy tone, but in the beginning, it took me a few months before I understood that I was trying to understand OOP from the wrong side (at the time I was thinking in C) and I would like others to have a quicker start than I had.
- heinrichhartman 8y agoThanks for your reply. Where would you go to "to understand the concept-side of it" better? I am reasonably fluent in Java and Python, and read a lot of C/C++. So I think I have a solid understanding what OO looks like, and what concepts are involved (dynamic dispatch, polymorphism, inheritance, etc). However, there is a lot of critique about the OO models in these languages and code that is found in the wild. What I am looking for is a principled treatment, that avoids these pitfalls.
- arendtio 8y agoThe professor who taught me OOP wrote a book which I never read, but I am confident that he focuses on the concepts in the beginning: https://books.google.de/books?id=RAloBgAAQBAJ&printsec=frontcover&hl=de#v=onepage&q&f=false https://books.google.de/books?id=RAloBgAAQBAJ&printsec=front... Another good source of ebooks seems to be this page: http://stephane.ducasse.free.fr/FreeBooks/ http://stephane.ducasse.free.fr/FreeBooks/ There you can find the Blue-Book which looks like a great resource too: http://stephane.ducasse.free.fr/FreeBooks/BlueBook/Bluebook.pdf http://stephane.ducasse.free.fr/FreeBooks/BlueBook/Bluebook.... Some Links seem to be broken nowadays, but some content can be obtained from the archive: https://web.archive.org/web/20130319110836/http://stephane.ducasse.free.fr:80/FreeBooks/SmalltalkDesignPatternCompanion/ https://web.archive.org/web/20130319110836/http://stephane.d...