3 ms·
I feel like Smalltalk demonstrated a better version of OOP than what you get in other languages that market themselves as object oriented. Firstly that it's con
by ljm 5y ago
I feel like Smalltalk demonstrated a better version of OOP than what you get in other languages that market themselves as object oriented. Firstly that it's consistent with itself, but mainly because it's incredibly awkward to do OOP in the Gang of Four/Clean Code/DDD style that you'd typically see in, say, a Java project.
You're essentially building up a catalogue of messages and answers and so it's not particularly ergonomic to jump through several layers of abstraction in the browser to get what you need. And there's no arbitrary limitation on your code such that a class can only have 10 methods in it, or 100 lines, or some other silly thing that forces you into creating a more convoluted architecture with more indirection.
I've grown weary of OOP for a long time because of how hard it is to find an effective application of it that doesn't grow into a collection of explicit design patterns with some business logic buried in the depths of the hierarchy. My brief experience with Smalltalk essentially revived my interest in it and encouraged me to be more thoughtful about my approach without throwing it all out and pining for a purer, more functional language that trades OOP's big problems with a set of its own.
- gilbetron 5y agoThings that are good from OOP/Smalltalk: * Interfaces * Messages * Some combining of data and functions * Some polymorphism Not so good: * Inheritance * Open/close * Most Encapsulation * Most everything else ;)
- feoren 5y ago> And there's no arbitrary limitation on your code such that a class can only have 10 methods in it, or 100 lines, or some other silly thing that forces you into creating a more convoluted architecture with more indirection. I've never heard of such a restriction, even in very early programming languages. What language are you thinking of where you're limited to a specific number of methods or lines per class?
- Jtsummers 5y agoThey're making a hyperbolic allusion to texts like Clean Code which promote short methods and relatively small source files (recommendations usually in the low 100s of SLOC). Not to actual language restrictions.
- ljm 5y agoIt's not particularly hyperbolic when using, say, Rubocop for Ruby. Those are pretty much the default settings (methods no longer than 5 or 10 lines, classes no longer than 100, etc.). You can change the defaults of course but there is one class of software engineer which will treat those as gospel.