SOLID Principles for Solid Code

If you’ve used an object‑oriented language for a while, you’ve probably run into the SOLID acronym. It’s a mnemonic for a set of principles that aren’t magic, but they consistently lead to code that’s sturdy, flexible and scalable. It’s code that’s easier to understand and therefore easier to change.

It might be an underappreciated quality, but I’d argue that “easier to change” is the most important quality of code for many of us, because most of what we do as developers is reading and changing code.

Even in the era of AI, this holds true. AI can generate a lot of code very quickly, but volume isn’t the same as design. Just like we get “AI slop” in text, we can get slop in code too. Or we can create code that’s solid (pun intended), and easier for a both AI and humans to understand, and easier for either to change.

Good design still matters, maybe more than ever, because it’s what lets a system grow without collapsing under its own weight.

Continue reading “SOLID Principles for Solid Code”

Clean vs. Layered Architecture – How Design Matters In Software

Software design prepares you to use AI. Here’s how.

Architecture enables structures to grow without collapsing under the weight of their own complexity. Software design is the way we architect code in an application.

While agentic coding is quite capable at generating code, we rely on software design to make things secure, scalable, well-integrated and affordable. Without design, as the codebase grows bigger and the context becomes more complex, even the AI won’t be able to make a change without monumental token use costs and breaking other parts of the app. So, you could say software design is needed now more than ever!

Clean Architecture vs. Layered Architecture

Two architectures that I leverage as reference for software design are Clean Architecture and Layered Architecture. Despite some differences, each offer patterns that strive for the same goals:

  • Separation of Concerns
  • Maintainability
  • Independence
  • Testability
  • Directional Flow

Here’s more about Clean Architecture and Layered Architecture – including a comparison – and how we make use of each in software design. I’ll compare both and provide some code examples.

Continue reading “Clean vs. Layered Architecture – How Design Matters In Software”

Common Refactors: Part 1 – Conditionals

In this series, I’ll talk about common refactors I suggest when doing code review in my day to day. I’ll start with conditionals, including severals example refactors. The goal is to help produce code that’s easier to read and understand, and thus, easier to maintain and produces fewer bugs.

These examples will be in TypeScript but the refactors are common patterns and can apply to most languages out there, such as Python, Ruby, Swift, PHP, Java, Go, JavaScript, etc.

Continue reading “Common Refactors: Part 1 – Conditionals”

The Repository and Unit of Work Design Patterns

Most web applications we build benefit from having a separate “data access layer” (DAL) and separating business logic from database interaction.

The main advantages to this are easier testing and maintainability. Because business logic is separated from the actual implementation, you can write code in terms of higher level abstractions, rather than having to worry about specifics.

Continue reading “The Repository and Unit of Work Design Patterns”

My favorite Data Structure: The binary search tree

Ever wondered how computers organize information? Data structures are the building blocks that store and manage data efficiently.

Like filing cabinets for your computer, they decide how you can find, add, or remove information. Understanding data structures is key for developers, as they all have pros and cons, and choosing the right one can make or break your solution!

Continue reading “My favorite Data Structure: The binary search tree”