Bitsmi Blog

1.- Código Limpio

09-02-2025 - Xavier Salvador

Clean Code.

Anyone reading this book:

  1. Is a programmer.
  2. Is a programmer who wants to be a better programmer.

After reading this book:

  1. We will be able to tell the differences between good code and bad code.
  2. We will know how to write good code.
  3. We will know how to transform bad code into good keeping its business requirements.

There will be code

Code represents the details of a requirement.

From a historical perspective, the discipline of requirements specification with well specified requirements are as formal as code and can act as a group of executable tests of that code.

Bad code

Bad code can bring down a company.

Wading: Finding bad code written without being understood what is describing this code.

If the team continues working on it but any clean approach is postponed with “We will review it later” it will never be achieved and the mess will continue to grow.

Leblanc’s Law: “Later equals never”.

The total cost of owning a mess

Mess code is a natural process.

When a team is working in a code during the first years, any move in it is faster and smoother.

Later, after some time, when trying to apply any change and trying to understand what several parts are doing, it gets more difficult to change, update or evolve the code.

Then the Mess is built.

From this point, the team’s productivity is declining to the absolute zero despite management tries to fix it by adding more staff who are not really aware of the inner meaning of the source code.

So as a conclusion, spending time keeping your code clean is not only cost effective but professional survival as a company as well as a professional programmer.

Attitude

Despite the efforts of managers and marketers to always achieve the goals according to a narrow and specific schedule, it is part of our job to raise the hand and defend code quality with passion not only to avoid the creation of a “mess” short term but to get a better maintenance of the code long term.

The Primal Conundrum

It has be understood as a first amendment:

“To avoid the creation of a Mess and the only way to achieve any deadline according to a schedule is to keep the code as clean as possible at all times”.

The Art of Clean Code

Writing clean code requires the disciplined use of myriad little techniques applied through the concept of “cleanliness” where the “code-sense” is the key.

A programmer with this “code-sense” will be able to confront the “mess” and choose the best variation preserving the transformation of the code from here to there ending in an elegantly coded system more readable and functionally working exactly as the original mess.

more…

0.- Introduction

08-02-2025 - Antonio Archilla

Summary

These group of posts pretend to be a quick summary to check when required to gather and review the most important concepts of the book.

It is recommended to read the book to get more detailed information about the topic that the reader wants to review.

Introduction

For coding is not enough to gain knowledge of principles, patterns, practices and heuristics.

It requires a continuing try and failure because Clean Code is a hard work process to learn from it.

The book has been split in three main parts:

  1. The first part describes the principles, patterns and practices of writing clean code.

  2. Study cases with different complexity. It will be an intense and demanding part. Main reason why is that each case analysed is an exercise in cleaning some code that has problems and transforming it into a code with less problems than the original version.

  3. Heuristics and Smells. It is related to the relationship between the heuristics and the discrete decisions made while doing some clean up of the source code.

As a general rule, it is recommended by the author to read the WHOLE book and practice as much as possible to gain a much richer understanding of these principles, patterns and heuristics.

more…

Tabla de Códigos ASCII – American Standard Code for Information Interchange

08-12-2024 - Xavier Salvador

Estándar Americano de Codificación para el Intercambio de Información

Pronunciación: as-ki

ASCII es un estándar de representar caracteres y símbolos en forma electrónica. Emplea estándares incrementando la eficiencia y elimina errores. Utilizar estándares requiere disciplina y a veces restringe la creatividad.

Sin embargo, es muy útil para la comunicación entre usuarios. Internet requiere aún más enfoque en estándares porque en muchos casos, se trata de usuarios de idiomas diferentes.

Las personas que tuvieron la visión de Internet, establecieron una plataforma de comunicación global. El uso de los estándares es una manera de cumplir con este objetivo.

more…

IntelliJ Hotkeys Cheatsheet

27-10-2024 - Xavier Salvador

more…

Tabla de códigos HTML

27-10-2024 - Xavier Salvador

Tabla de ASCII estándar, nombres de entidades HTML, ISO 10646, ISO 8879, ISO 8859-1 romano 1 con soporte para todos los navegadores.

more…

Ubuntu - Referencia de comandos útiles

20-10-2024 - Antonio Archilla

more…

Docker - Referencia de comandos

20-10-2024 - Antonio Archilla

more…

Validation groups

29-09-2024 - Antonio Archilla

jakarta.validation.groups allow us to configure the constraints to be validated depending on the context. For example, in some situations may have sense only to validate certain constraints when a domain entity is being created (not managed) and not when is updated (managed), the ID and creation / update timestamps for example. In that case we can define the constraints that will be executed in each case using different groups

more…

Mocking external services with Wiremock

25-08-2024 - Antonio Archilla

If we need to mock an external service during application development, we can configure a Wiremock container as part of the docker-compose-DEV.yaml service stack:

more…

Introduction to dependency injection

29-06-2024 - Antonio Archilla

Spring Dependency Injection capabilities allow us to manage bean bindings in different ways. Here is a basic guide on how to:

  • Having a single bean candidate and a single injection point, that is the base case when we define a bean and use @Autowired annotation to inject it

  • Having multiple bean candidates of the same type and a single injection point. Here we can define a default bean or use identifiers to select which one will be injected

  • Having zero bean candidates for a type and a single injection point, which means that we can have optional beans

  • Having multiple bean candidates of the same type and a multiple injection point, allowing accessing all beans for the specified type in the same injection point

  • Having conditional bean candidates that are only available when a condition is met

  • Create and inject prototype scoped beans

more…

results matching ""

    No results matching ""