May 12th, 2022 update
Heyo~ 👋 Khalil here.
In 2019, after having tanked the quality of the code for my own startup company I was building during school, I started my blog. As I sought out how to not have that happen again, writing lots of code and reading the classic software design books, I couldn’t believe how ill-prepared I was for real-world programming.
Not knowing how to organize business logic, write tests, or write code in a way that it gets better instead of worse after time, I realized that if I — a university-taught developer — was having this problem, then surely all my peers were as well.
I was right. Lots of others were.
I’m teaching software design and architecture full-time
On March 31st, I completed my last day at Apollo GraphQL and resumed my mission of helping developers learn how to write testable, flexible, and maintainable code.
I’m excited to inform you that I’m now working full-time teaching software design and architecture at khalilstemmler.com.
Object design
Over the time I’ve spent writing solidbook.io, I’ve had a lot of readers tell me that they can’t wait for me to complete Part V: Object-Oriented Design (with tests). It’s a section of the book where we finally learn object-oriented programming properly.
That’s what I’ve been working on this month. Working through the classic texts, writing code, and experimenting, I’ve come to realize that object design is probably the most underrated and poorly taught skill in all of software development.
It’s also one of the most foundational, critical skills to learn if you want to become a truly skilled software designer. For so many reasons. You simply cannot afford to avoid object software and the teachings obtained by mastering it.
Most developers struggle with OO
Today’s science estimates that 90 to 95 percent of our brain’s activity happens within the subconscious part of the brain. This means that while we think we know what we’re doing and that we’d like to think we’re in control, most of our decisions, actions, and behavior originate from beyond our conscious awareness.
Wild, right?
Awareness is important. The unfortunate reality that I’ve noticed is that a lot of junior developers (and at one point, myself included) are unaware of what it means to do OO properly. I’ve been a part of many discussions where devs believed that:
- OO is trash/broken/garbage/insert insult here
- OO is only for enterprise development
- OO is overkill for most scenarios
- OO leads to unmaintainable code
- OO is bad because it relies on inheritance and polymorphism
- mocks are bad
- functions are fundamentally better
These are all beliefs that I think stem from a misunderstanding of what OO is all about.
The truth about object-oriented design (it's about more than just programming)
Even though I studied object-oriented programming at university, I still struggled with it once I got out into the real world and tried using it to develop software.
This is because object design isn't just about programming. That's the last step.
- In analysis, we learn the domain, discover requirements, and turn them into use cases.
- In design, we utilize a design method like Responsibility-Driven Design to convert requirements into roles, responsibilities, and collaborations.
- In programming, we map designs to tested, flexible, maintainable code.
That last step - the programming step of object-oriented design - is where most developers place their focus. It's here that we learn about concepts like abstraction, polymorphism, encapsulation, and inheritance.
However, we often learn about these concepts with non-realistic (and oftentimes detrimental) examples like the classic Animal-Dog or Person-Staff-Teacher examples which map nicely to the real world but manifest real problems with the complex hierarchies they create.
The 4 Principles of Object-Oriented Programming: I wrote a post to explain those concepts of OOP - abstraction, encapsulation, inheritance, and polymorphism - in the most realistic, productive, and simple way possible. You can read it here.
Object design is the baseline for advanced software design
So how do we learn object-oriented programming properly?
Learn Object Design.
How do I learn when I should use interfaces? Abstract classes? When should I create a new class? How do I get into design patterns? Design principles? How do you use mocks properly? How do I learn how to design large-scale systems? How do I effectively use frameworks and integrate them with other services? How do I learn to design for non-functional requirements like scalability or extensibility? How do I build not-web-designy stuff like video games or robots?
Object Design. Learn all three parts. Especially the design part.
Whether you do your designs on paper, on a CRC card, a UML drawing, or in your head — when you write an object to pass a failing test while understanding what responsibility-driven design is, now you’re on the path to mastering object-oriented software design.
Coming soon
If you can’t tell how excited I am about this section, let me say it here. I am excited. I’ve been meaning to get into this topic for a long time and I’m finally in it with my full attention. With respect to the book, as usual, I’ll post updates and send emails when new chapters are posted. For the blog, expect to see more about this topic.
DDDForum updates
The last update I want to make is that I’m making some updates to DDDForum, the repo from solidbook.io that demonstrates how to use DDD principles, clean/hexagonal/onion architecture, and CQRS to build a real-world web application.
It’s been about 2 years since my last update, so take a peek through and if you have questions or suggestions, open a GitHub issue and I’ll get to it.
That's all for now.
To mastery,
Khalil