Jim Venolia wrote:I've been programming for some 30, eeek! 40 years now, and have only brushed up against OO without actually using it.
In all those 30-40 years of programming, what kind of programming did you do? What language(s) did you use primarily? What's the most recent language/platform you programmed on and how long have you been doing that?
I cut my teeth on Structured Programming (BASIC and Pascal mainly, plus a smidge of FORTRAN and just enough C and Assembly to be dangerous). That was back in the late 80s. My first intro to the concept of objects was with Delphi or as some would call it, Object Pascal. I only sank my teeth into Java in 2000. Around that time, I discovered this community.
You'll often hear/read that OOP is a "paradigm shift" and as nebulous as that phrase is, it actually is just that. OO languages are not just different from structured languages that you may be used to, they are also geared towards a very different way of thinking about problems and how you create the solutions for them. The same radical shift is there when you move from OO or structured to functional style programming. It's enough to literally make your brain hurt, or at least make you feel like it's twisted up into knots.
A couple of books that I've been recommending a lot lately are:
1. Understanding the Four Rules of Simple Design
by Corey Haines. It's not a beginner's book by any stretch but I think the problem it discusses—there's only one—is very relatable: Conway's Game of Life
. If you supplement your study of OOP fundamental concepts like polymorphism, encapsulation, inheritance with the practical lessons presented in Haines' book, I think you'll get a lot further than most people do in gaining a deeper understanding of OOP. The book uses examples in Ruby which isn't Java or Kotlin but it's close enough. Also, Ruby is arguably a more object-oriented than Java and there are significant differences in the syntax but not significant enough, IMO, to they make the concepts in the book specific to Ruby; you can apply the same principles/ideas in practically any other OO language, perhaps just not exactly as it's shown in the book.
2. Think Like a Programmer
by V. Anton Spraul. This book has some really good discussions about modes of thinking and problem solving approaches that are applicable in any style of programming, whether structured, OO, or functional.
And most of all, practice, practice, practice. But practice mindfully, and always look for examples of how other people solved the same problem. That's why I like Corey Haines' book, because he presents so many ways of solving a problem and clearly explains the thought process involved in making decisions that lead to those various solutions.