- Builder Pattern
Introduction The Builder pattern separates the construction of a complex object from its representation, allowing the same construction process to create different representations. It shines when an object requires many configuration options, optional parameters, or a specific construction sequence…
- Standard Design Principles
These are the foundational design principles every developer should internalize. They complement the SOLID Principles (covered in a dedicated post) and apply across languages and frameworks. 1. DRY (Don’t Repeat Yourself) Every piece of knowledge should have a single, authoritative representation…
- Singleton Pattern
Introduction The Singleton pattern ensures a class has only one instance and provides a global point of access to it. It is one of the most widely used — and misused — design patterns in software engineering. When applied correctly, it solves real problems around shared resource management, such as…
- Postgres – Subqueries and CTEs
Scalar subqueries, IN, EXISTS and the difference that matters when the inner query returns NULL. WITH for naming the steps of a query you can still read next month, the MATERIALIZED keyword that Postgres 12 made optional and when to force it, recursive CTEs, and writing to two tables in one statement with a data-modifying CTE.
- Git restore deleted commit
Sometime you commit something but then accidentally deleted it and then you would like to bring it back or continue working on it. I had this happened to me and it was frustrating to redo everything I deleted. But then I found out there is a way to recover deleted commit. Well, you want to […]