Название: Your Code as a Crime Scene: Use Forensic Techniques to Arrest Defects, Bottlenecks, and Bad Design in Your Programs, 2nd Edition Автор: Adam Tornhill Издательство: Pragmatic Bookshelf Год: February 2024 (P1.0) Страниц: 319 Язык: английский Формат: pdf (true) Размер: 50.5 MB
Jack the Ripper and legacy codebases have more in common than you'd think. Inspired by forensic psychology methods, you can apply strategies to identify problems in your existing code, assess refactoring direction, and understand how your team influences the software architecture. With its unique blend of criminal psychology and code analysis, Your Code as a Crime Scene arms you with the techniques you need to take on any codebase, no matter what programming language you use.
Software development might well be the most challenging task humanity ever attempted. As systems scale up, they also become increasingly complex, expensive to maintain, and difficult to reason about. We can always write more tests, try to refactor, and even fire up a debugger to understand complex coding constructs. That's a great starting point, but you can do so much better.
Take inspiration from forensic psychology techniques to understand and improve existing code. Visualize codebases via a geographic profile from commit data to find development hotspots, prioritize technical debt, and uncover hidden dependencies. Get data and develop strategies to make the business case for larger refactorings. Detect and fix organizational problems from the vantage point of the software architecture to remove bottlenecks for the teams.
Software development is made of people. From the perspective of a compiler, code is a technical construct, one formal notation to be translated into another so that it can run. The compiler’s view is simple and certain: just as with ones and zeroes, code compiles or it doesn’t. From the perspective of an organization, however, code’s complexity is drawn in shades of gray. Software is a socio-technical construct, where team dynamics, deadlines, personal preferences, skills, and organizational values leave their mark on a codebase and its history.
And this is the perspective Adam takes in this book. The new edition of Your Code as a Crime Scene retains the soul and wisdom of the first edition, while updating its examples and extending its reach. Adam shows us that to truly understand a codebase, we cannot simply view it through the keyhole of our editor in the moment of editing. We need a larger and more holistic view, one that invites novel ways of thinking about and visualizing code.
Our source code has a spatial structure—top to bottom, left to right, indented and aligned—but we can invent and use spatial metaphors to further enrich our mental models and reveal the shape of our system—cities, graphs, maps, enclosures, fractals, and more. And where there is space, there is also time. To gain a deeper understanding of our code and its development, we need to learn to see it as temporal, not just spatial. There is a story that led to the code we see today; there are stories that may flow from it in future. A system is no more a static snapshot of its code than a film is a single frame. Adam shows that, buried within your version-control system, you have more than a repository: you have a history. Buried in the commits and the diffs is a story of what changed and when, who made changes and why. This is where you will find the system.
Among the hotspots and dead spots, trends and coupling, you can find connections to requirements, to technical debt, to team structure, to project practices, to defects, to technology evolution, to programming paradigms, to organizational change, and more. With the forensic tools and mindset Adam presents, you can see what’s happened and what’s happening and, therefore, what might happen and how you and others can change that.
Who Should Read This Book? To get the most out of this book, you’re probably a programmer, software architect, or technical leader. Perhaps you’re looking for effective ways to uncover the secrets of an existing codebase. Or, you might be embarking on a legacy migration project and looking for guidance. You might also strive to reduce defects, helping both yourself and your team to succeed. Maybe you’re under pressure to deliver more code faster and want to figure out how to strike a balance between adding new features vs. improving existing code. No matter the scenario, you care about good code. Great—you’re reading the right book.
It doesn’t matter what language you program in. Our case studies mix Java, Go, jаvascript, Python, C++, Clojure, C#, and several other languages. However, the big advantage of crime-scene techniques is that you don’t have to know any of these languages to follow along. All techniques are language-independent and will work no matter what technology you use. We also make sure to focus the discussions on principles rather than specifics. The hands-on examples interact with version-control systems. To get the most out of the book, you should know the basics of Git, Subversion, Mercurial, or a similar tool.
Внимание
Уважаемый посетитель, Вы зашли на сайт как незарегистрированный пользователь.
Мы рекомендуем Вам зарегистрироваться либо войти на сайт под своим именем.
Информация
Посетители, находящиеся в группе Гости, не могут оставлять комментарии к данной публикации.