Posts tagged “how-we-build”
-
What happens when you reset a few commits and force-push?
Force-pushing after a reset moves the branch pointer on the server; it doesn't delete anything. The dropped commits live on in reflogs, in every teammate's clone and, on GitHub, by SHA. What each teammate sees next depends on how they pull: a merge-pull brings the commits back, a rebase-pull…
-
Refactoring or rewrite?
Refactor in small steps by default; most rewrites take longer than planned and lose behaviour nobody wrote down. Rewrite only behind a strangler fig, piece by piece, with old and new running side by side. How to decide, and how to do either without a big-bang cutover.
-
Trunk-based development or Git flow?
For a SaaS that deploys often, trunk-based development with short-lived branches and feature flags is faster and safer. Git flow's long-lived branches fit products with versioned releases you must support in parallel. How to choose, and what each needs to work.
-
Which design patterns still earn their place?
Strategy, adapter, state machine, outbox, idempotency key and retry with backoff solve problems every backend has. Abstract factories, visitors and deep decorator stacks mostly solve problems we no longer have. The patterns I reach for, with real examples, and the signs of an over-patterned…
-
Test-first or test-after: what actually reduces bugs?
Writing the test first helps most when the expected behaviour is clear and the design isn't: parsers, rules, bug fixes. Property-based tests find edge cases nobody thought of. Integration tests against real dependencies catch what unit tests can't. How to combine them.
-
Clean, hexagonal or layered architecture: does the shape matter?
They share one idea: business rules shouldn't depend on frameworks, databases or vendors. Layered is the simplest, hexagonal makes swapping and testing easy, clean architecture adds more rings, and vertical slices organise by feature instead. How to choose for the size of your system.
-
SOLID: which principles still pay off?
Single responsibility and dependency inversion pay off in almost every codebase. Open/closed, Liskov and interface segregation matter mostly at boundaries where implementations vary. What each principle protects against, and when it turns into over-engineering.
-
Is "Clean Code" still good advice?
The goals are right: code that's easy to read and safe to change. Some of the famous rules (tiny functions, no comments, DRY at all costs) hurt when followed literally. Which parts I keep, which I bend, and how to settle the arguments in code review.
-
Object-oriented or functional: which style for which code?
Use objects where something has identity and state that must stay consistent, and pure functions over plain data for transformations, calculations and pipelines. Most good codebases mix the two. How to decide, with Go and TypeScript examples.
-
When is domain-driven design worth it?
DDD pays off when the business rules are the hard part and several teams or departments use the same words to mean different things. For CRUD apps it's mostly ceremony. Which parts to take (language, bounded contexts) even on small projects, and which to skip.