Preface
In a time when it seems there is no other topic but artificial intelligence, it may seem strange to write a book that gathers the key practices for writing good, maintainable, and, in a word, clean code. As I write this, tools are becoming well-known – perhaps they are already well-known – that assist the developer and help write code, suggesting how to complete the line of code they are writing or even writing some short methods. Opinions at the moment are very polarized, between those who fear becoming obsolete in a few weeks and those who believe their natural intelligence is superior to any artificial intelligence.
As often happens, we will probably find ourselves somewhere in the middle. While it’s true that AI can assist us in small, very specific tasks, analyzing small portions of code around the line we are writing and completing the work for us, there is still quite some time before it will write all the code for us, that is scalable, maintainable, and expandable, and without bugs – if that moment ever arrives, by the way. Writing good code involves making decisions that go beyond mere syntax and involve understanding the specific requirements and nuances of a given problem, which no AI can grasp.
Well-written code is clear, readable, and easy to understand. This is crucial for collaboration in a team, as other developers (or even yourself in the future) need to comprehend and modify the code. AI can assist in generating code, but it might not always produce code that is easy to maintain.
Bugs are inevitable in software development. Writing clean and well-organized code can significantly ease the process of debugging. Clear code is easier to navigate, making it simpler to identify and fix issues. AI tools can help with debugging, but they may not catch every type of error or understand the specific logic of your code as well as a human can.
The technical skills of a programmer are still very important and will be for a long time; writing clean code and refactoring one’s codebase will be pivotal qualities, that will make us better and more valuable professionals.