3

Causes of Bad Code

In the previous chapters, we discussed coding standards in C++ and the core development principles. As we delve into refactoring existing code, it is crucial to understand what leads to subpar or bad code. Recognizing these causes enables us to avoid repeating the same mistakes, address existing issues, and prioritize future improvements effectively.

Bad code can result from various factors, ranging from external pressures to internal team dynamics. One significant factor is the need to deliver the product quickly, especially in fast-paced environments such as start-ups. Here, the pressure to release features rapidly often leads to compromises in code quality as developers might cut corners or skip essential best practices ...

Get Refactoring with C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.