Advanced Coding: Using SOLID to Make Solid Code
As the old saying goes, “with great power comes great responsibility,” and in terms of OOP, this could not be truer. Object-oriented programming is an excellent methodology to program literally anything. However, it can easily end up a huge mess. In my formative years as a developer, I often put little to no forethought into how my code would work and be used; I just coded. This flaw in thinking led to a few programs being sent to the cyber-trash heap way before their time. When implemented incorrectly, OOP can produce a chaotic mess of a program.
Until this point, we have explored the power of OOP and how it can allow us to reduce the amount of code that we have to write. However, what we have not explored is how to keep codebases maintainable. By default, OOP does not necessarily translate into code that is easy to maintain, expand upon, or, for that matter, understand. Even when using proper relationships between...