
Why you should stop using these “main practices” (they are actually worse!) | by the coders stop | April 2025

5 hours ago
The development of software is flooded with so-called “most important practices” “of the conventions that the teams adopt in order to write a better, more holdable code. Although many practices of this type are precious, some have become a dogma despite more problems than they solve.
As a person who consulted for dozens of development teams in various industries, I have repeatedly seen the same counterproductive practices followed faithfully because they are labeled as “Best”.
// The "best practice" approach with excessive layers
Client Request
â Controller
â Service
â Manager
â Repository
â Data Access Object
â ORM/Database
Why this is considered a better practice: The separation of concerns is fundamental for good software design. The creation of distinct layers for different responsibilities seems to promote better organization, better testability and reuse of the code. The more separation there is, the better the architecture – or it is more that conventional wisdom goes.
Why is it often worse: Many modern applications are implementing many more layers than necessary, creating a labyrinth of classes delegate which add any real value:
// Example of excessive layering
// Controller
@RestController
public class UserController {
private final UserService userService;public UserController(UserService userService) {
this.userService = userService;
}
@GetMapping("/users/{id}")
public UserDto getUser(@PathVariable Long id) {
return userService.getUserById(id);
}
}
// Service
@Service
public class UserService {
private final UserManager userManager;
public UserService(UserManager userManager) {
this.userManager = userManager;
}
public UserDto getUserById(Long id) {
return userManager.findUserById(id);
}
}
// Manager
@Component
public class UserManager {
private final UserRepository userRepository;
public UserManager(UserRepository userRepository) {
this.userRepository = userRepository;
}
publicâ¦