Category: Programming

Shotgun surgery: How to avoid it and achieve safety and high productivity

Imagine an engineer tasked with updating a feature who makes changes across the entire codebase without a clear plan or structure. Instead of committing small, focused updates, they introduce a massive set of changes at once, touching numerous files and modules. Without TDD or incremental commits, tracking all these modifications becomes overwhelming, making even simple tasks like code reviews or context switching costly and confusing. This disorganized approach, known as shotgun surgery, increases the likelihood of bugs and errors, making the code harder to maintain. In this article, we’ll explore how to avoid this pitfall and improve both productivity and code safety.

Read More

Container Efficiency in Modular Monoliths: Symfony vs. Laravel

In the evolving landscape of software development, modular monolith architectures have gained significant traction. This approach offers a balanced middle ground between traditional monolithic applications and microservices. However, choosing the right PHP framework for building modular monoliths is crucial, as it can have a profound impact on the application’s performance.  The container performance, which is critical for dependency injection and managing service lifecycles, varies significantly between frameworks such as Symfony and Laravel. Despite the rise of framework-agnostic practices, the reality is that switching frameworks can be prohibitively expensive. It’s crucial to make an informed decision when choosing a framework. This article explores a comparative analysis of container performance in Symfony and Laravel within modular monolith architectures, offering engineers valuable insights to guide their framework selection.

Read More

Rethinking Mocking: DIY Approach vs. Frameworks on examples in PHP and Typescript

In the landscape of software testing, the choice between a do-it-yourself (DIY) approach to mocking or utilizing mocking frameworks is a pivotal decision for programmers. While mocking is indispensable for code reliability, its overuse or incorrect implementation can introduce complexities and fragilities within test suites. This article navigates the balance between leveraging mocks effectively and avoiding common pitfalls, including the dangers of writing mocks in a suboptimal manner.

Read More

Tips for optimizing integration tests

While unit tests are known for their speed compared to integration tests, the latter offer heightened confidence in the system’s functionality. Thus, avoiding integration tests is not advisable; instead, it’s crucial to strike a balance by writing tests at an appropriate level to ensure high confidence in the codebase. Achieving this equilibrium between time efficiency and confidence is paramount. Rapid feedback is essential for a smooth workflow, and today, I’ll share concise tips to enhance the efficiency of your integration tests. The effort invested is worthwhile, as swift feedback is indispensable for seamless operations, and each minute of improvement is magnified by the frequency of executions and the number of developers in the company.

Read More

Modeling a future action

During modeling a business logic we have often a problem with properly highlighting a relevant future action. I mean relevant from a domain point of view. The most popular solution will be using a CLI command which will be executed by cron at a specific time. I think that this solution often hides a lot of business logic in an inappropriate place. Perhaps, there is a better way?

Read More