Designing for Change: Boundaries, Contracts, and Dependency Inversion in Java
Introduction
Most Java systems don’t fail because a single class was written badly. They fail because the boundaries between classes were drawn in the wrong place — a database library leaks into business logic, a payment provider’s SDK shows up in twelve unrelated files, and changing one third-party dependency means touching half the codebase.
Designing for change is not about predicting the future correctly. It’s about isolating what varies so that when it inevitably does vary — a new payment provider, a swapped database, a different message broker — the blast radius is one adapter, not the whole system.
Designing for Change: Boundaries, Contracts, and Dependency Inversion in Python
Introduction
Python’s flexibility makes it easy to wire everything together directly — call the requests library from inside your business logic, import the ORM model straight into your pricing rules, instantiate a third-party SDK client wherever it’s needed. It works, right up until the payment provider changes, or you want a fast unit test that doesn’t need a live database.
Designing for change means drawing boundaries around the parts of the system likely to move — third-party services, storage, transport — so that a swap or a test double touches one small adapter instead of rippling through the codebase.
Error Handling Best Practices in Java
Introduction
Error handling is where a lot of otherwise-good Java code quietly goes wrong. Exceptions get swallowed, null leaks across boundaries, and stack traces arrive with no context about what the program was trying to do.
Good error handling is not about catching everything. It is about being deliberate: fail fast on programmer errors, recover gracefully from expected failures, and never lose the information a future on-call engineer will need.
Error Handling Best Practices in Python
Introduction
Python’s error handling reads deceptively simply — try, except, done. But the difference between code that fails clearly and code that fails mysteriously comes down to a handful of habits: catching the right exception, preserving the original cause, and knowing when not to raise at all.
This post covers the practices that keep Python failures debuggable in production.
Prefer EAFP over Look-Before-You-Leap
Python idiom favors EAFP — “Easier to Ask Forgiveness than Permission.” Rather than checking whether an operation will succeed, attempt it and handle the failure:
Testing Best Practices in Java
Introduction
Most Java codebases have plenty of tests and still get burned by production bugs. The problem is rarely quantity — it’s that the tests exercise the wrong things: they assert internal wiring instead of behavior, they mock away every collaborator until nothing real is left, or they cover the happy path ten times and the failure path zero times.
Good tests are fast, deterministic, and tell you something true about behavior. This post covers the practices that make JUnit 5 and Mockito tests actually earn their keep.
Testing Best Practices in Python
Introduction
Python’s testing tools are lightweight enough that it’s easy to write a lot of tests without writing good ones. A suite that mocks every collaborator, duplicates the same assertion ten times with different inputs pasted in by hand, or chases a coverage number will pass in CI and still miss real bugs.
pytest gives you fixtures, parametrize, and monkeypatch — the tools that make it just as easy to write the right tests as the wrong ones. This post covers how to use them well.
Why Java Still Matters Today (Even in the Age of New Languages)
Introduction: Isn’t Java… Old?
Every few years, a new programming language becomes the next big thing.
- Python for data science
- JavaScript everywhere
- Go for cloud-native systems
- Rust for memory safety
And inevitably, someone asks:
“Does Java still matter today?”
The short answer is yes.
The long answer is yes — for more reasons than most people realize.
Java is no longer the “boring enterprise language” people love to mock. In fact, Java has quietly evolved while continuing to power some of the world’s largest and most critical systems.