Robust Python

联合创作 · 2023-10-06 06:15

Developers currently working in a large codebase, looking to find better ways to communicate with their colleagues

Primary codebase maintainers, looking for ways to help lessen the burden of future maintainers

Self-taught developers who can write Python really well but need to better understand why we do the things we do

Software engineering graduates who need a reminder of pra...

Developers currently working in a large codebase, looking to find better ways to communicate with their colleagues

Primary codebase maintainers, looking for ways to help lessen the burden of future maintainers

Self-taught developers who can write Python really well but need to better understand why we do the things we do

Software engineering graduates who need a reminder of practical advice for development

Senior developers looking for a way to tie their design rationale to first principles of robustness

Who Should Read This Book

This book is for any Python developer who is looking to grow the code they work on in a sustainable and maintainable fashion. This is not intended to be your first Python text; I expect that you have written Python before. You should be comfortable with Python control flow, and have worked with classes before. If you are looking for a more introductory text, I suggest reading Learning Python by Mark Lutz (O’Reilly) first.

While I will be covering many advanced Python topics, the goal of this book is not to be a how-to for using all of Python’s features. Instead, the features are a backdrop for a larger conversation about robustness and how your choices impact maintainability. At times I will discuss strategies that you should rarely use, if at all. That is because I want to illustrate first principles of robustness; the journey of understanding why and how we make decisions in code is more important than knowing what tools to use in an optimal scenario. In practice, the optimal scenario is a rare occurence. Use the principles in this book to draw your own conclusions from your codebase.

This book is not a reference book. You might call it a discussion book. Each chapter should be a starting point for developers in your organization to discuss, together, how best to apply these principles. Start a book club, discussion group, or lunch and learn to foster communication. I have proposed discussion topics in each chapter to get the converstation started. When you come across these topics, I encourage you to stop and reflect on your current codebase. Talk among your peers and use these topics as a springboard for discussing the state of your code, processes, and workflows. If you are interested in a reference book about the Python language, I heartily recommend Fluent Python by Luciano Ramalho (O’Reilly; a second edition is forthcoming in late 2021).

A system can be robust in many different ways. It can be security hardened, scalable, fault-tolerant, or less likely to introduce new errors. Each one of these facets of robustness warrants a full book; this book is focused on preventing the developers who inherit your code from creating new faults in your system. I will show you how to communicate to future developers, how to make their lives easier through architectural patterns, and how to catch errors in your codebase before they make it into production. This book zeroes in on the robustness of your Python codebase, not the robustness of your system as a whole.

I will be covering a wealth of information, from many different areas of software, including software engineering, computer science, testing, functional programming, and object-oriented programming (OOP). I do not expect you to have a background in these fields. There are sections where I explain things at a beginner level; this is often to deconstruct how we think about core fundamentals of the language. This is, for the most part, an intermediate-level text.

This book focuses on writing software over time. If a lot of your code is a prototype, throwaway, or disposable in any other fashion, the advice in this book will end up creating more work than is necessary for your project. Likewise if your project is small—say, under one hundred lines of Python. Making code maintainable does add complexity; there’s no doubt about that. However, I’ll guide you through minimizing that complexity. If your code lives longer than a few weeks or grows to a considerable size, you need to consider the sustainability of your codebase.

Patrick Viafore has been working in the software industry for 13+ years, working on mission critical software systems, including in lightning detection, telecommunications and operating systems. His work in static typed languages has influenced his approach to dynamic languages and how we can make them safer and more robust. He also is an organizer of the HSV.py meetup, where h...

Patrick Viafore has been working in the software industry for 13+ years, working on mission critical software systems, including in lightning detection, telecommunications and operating systems. His work in static typed languages has influenced his approach to dynamic languages and how we can make them safer and more robust. He also is an organizer of the HSV.py meetup, where he can observe common Python obstacles, from beginners to experts. His goal is to make computer science/software engineering topics more approachable to the developer community.

Patrick currently works at Canonical, developing pipelines/tools to deploy Ubuntu images to public cloud providers. He also does software consulting and contracting through his business Kudzera, LLC.

浏览 1
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑 分享
举报