본문 바로가기

리디 접속이 원활하지 않습니다.
강제 새로 고침(Ctrl + F5)이나 브라우저 캐시 삭제를 진행해주세요.
계속해서 문제가 발생한다면 리디 접속 테스트를 통해 원인을 파악하고 대응 방법을 안내드리겠습니다.
테스트 페이지로 이동하기

Clean Code in Python 상세페이지

Clean Code in Python작품 소개

<Clean Code in Python> ▶Book Description
Python is currently used in many different areas such as software construction, systems administration, and data processing.

In all of these areas, experienced professionals can find examples of inefficiency, problems, and other perils, as a result of bad code. After reading this book, readers will understand these problems, and more importantly, how to correct them.

The book begins by describing the basic elements of writing clean code and how it plays an important role in Python programming. You will learn about writing efficient and readable code using the Python standard library and best practices for software design. You will learn to implement the SOLID principles in Python and use decorators to improve your code. The book delves more deeply into object oriented programming in Python and shows you how to use objects with descriptors and generators. It will also show you the design principles of software testing and how to resolve software problems by implementing design patterns in your code. In the final chapter we break down a monolithic application to a microservice one, starting from the code as the basis for a solid platform.

By the end of the book, you will be proficient in applying industry approved coding practices to design clean, sustainable and readable Python code.

▶What You Will Learn
⦁ Set up tools to effectively work in a development environment
⦁ Explore how the magic methods of Python can help us write better code
⦁ Examine the traits of Python to create advanced object-oriented design
⦁ Understand removal of duplicated code using decorators and descriptors
⦁ Effectively refactor code with the help of unit tests
⦁ Learn to implement the SOLID principles in Python

▶Key Features
⦁ Save maintenance costs by learning to fix your legacy codebase
⦁ Learn the principles and techniques of refactoring
⦁ Apply microservices to your legacy systems by implementing practical techniques

▶Who This Book Is For
This book will appeal to team leads, software architects and senior software engineers who would like to work on their legacy systems to save cost and improve efficiency. A strong understanding of Programming is assumed.

▶What this book covers
⦁ Chapter 1, Introduction, Code Formatting, and Tools, is an introduction to the main tools you need to set up a development environment in Python. We cover the basics a Python developer is recommended to know to start working with the language, as well as some guidelines for maintaining readable code in the project, such as tools for static analysis, documentation, type checking, and code formatting.

⦁ Chapter 2, Pythonic Code, looks at the first idioms in Python, which we will continue to use in the following chapters. We cover the particular features of Python, how they should be used, and we start building knowledge around the idea that Pythonic code is in general much better quality code.

⦁ Chapter 3, General Traits of Good Code, reviews general principles of software engineering that focus on writing maintainable code. We explore the idea and apply the concepts with the tools in the language.

⦁ Chapter 4, The SOLID Principles, covers a set of design principles for object-oriented software design. This acronym is part of the language or jargon of software engineering, and we see how each one of them can be applied to Python. Arguably not all of them are entirely applicable due to the nature of the language.

⦁ Chapter 5, Using Decorators to Improve Our Code, looks at one of the greatest features of Python. After understanding how to create decorators (for functions and classes), we put them in action for reusing code, separating responsibilities, and creating more granular functions.

⦁ Chapter 6, Getting More Out of Our Objects with Descriptors, explores descriptors in Python, which take object-oriented design to a new level. While this is a feature more related to frameworks and tools, we can see how to improve the readability of our code with descriptors, and also reuse code.

⦁ Chapter 7, Using Generators, shows that generators are probably the best feature of Python. The fact that iteration is a core component of Python could make us think that it leads to a new programming paradigm. By using generators and iterators in general, we can think about the way we write our programs. With the lessons learned from generators, we go further and learn about coroutines in Python, and the basics of asynchronous programming.

⦁ Chapter 8, Unit Testing and Refactoring, discusses the importance of unit tests in any code base that claims to be maintainable. The chapter reviews the importance of unit tests, and we explore the main frameworks for this (unittest and pytest).

⦁ Chapter 9, Common Design Patterns, reviews how to implement the most common design patterns in Python, not from the point of view of solving a problem, but by examining how they solve problems by leveraging a better and more maintainable solution. The chapter mentions the peculiarities of Python that have made some of the design patterns invisible and takes a pragmatic approach to implement some of them.

⦁ Chapter 10, Clean Architecture, focuses on the idea that clean code is the base of a good architecture. All those details we mentioned in the first chapter, and everything else revisited along the way, will play a critical role in the entire design when the system is deployed.


출판사 서평

▶ Preface
This is a book about software engineering principles applied to Python.

There are many books about software engineering, and many resources available with information about Python. The intersection of those two sets, though, is something that requires action, and that's the gap this book tries to bridge.

It would not be realistic to cover all possible topics about software engineering in a single book because the field is so wide that there are entire books dedicated to certain topics. This book focuses on the main practices or principles of software engineering that will help us write more maintainable code, and how to write it by taking advantage of the features of Python at the same time.

A word to the wise: there is no single solution to a software problem. It's usually about trade-offs. Each solution will have upsides and downsides, and some criteria must be followed to choose between them, accepting the costs and getting the benefits. There is usually no single best solution, but there are principles to be followed, and as long as we follow them we will be walking a much safer path. And that is what this book is about: inspiring the readers to follow principles and make the best choices, because even when facing difficulties, we will be much better off if we have followed good practices.

And, speaking of good practices, while some of the explanations follow established and proven principles, other parts are opinionated. But that doesn't mean it has to be done in that particular way only. The author does not claim to be any sort of authority on the matter of clean code, because such a title cannot possible exist. The reader is encouraged to engage in critical thinking: take what works the best for your project, and feel free to disagree. Differences of opinions are encouraged as long as they yield an enlightening debate.

My intention behind this book is to share the joys of Python, and idioms I have learned from experience, in the hope that readers will find them useful to elevate their expertise with the language.

The book explains the topics through code examples. These examples assume the latest version of Python at the time of this writing is used, namely Python 3.7, although future versions should be compatible as well. There are no peculiarities in the code that bind it to any particular platform, therefore with a Python interpreter, the code examples can be tested on any operating system.


In most of the examples, with the goal of keeping the code as simple as possible, the implementations and their tests are written in plain Python using just the standard libraries. In some chapters, extra libraries were needed, and in order to run the examples of those cases, instructions have been provided along with the respective requirements.txt file.

Throughout this book we will discover all the features Python has to offer to make our code better, more readable, and easier to maintain. We do so not only by exploring the features of the language, but also by analyzing how software engineering practices can be applied in Python. The reader will notice that some of the reference implementations differ in Python, other principles or patterns change slightly, and others might not be even applicable all along. Understanding each case represents an opportunity to understand Python more deeply.


저자 소개

⦁ Mariano Anaya
Mariano Anaya is a software engineer who spends most of his time creating software with Python and mentoring fellow programmers. Mariano's main areas of interests besides Python are software architecture, functional programming, distributed systems, and speaking at conferences. He was a speaker at Euro Python 2016 and 2017. To know more about him, you can refer to his GitHub account with the username rmariano. His speakerdeck username is rmariano.

목차

▶TABLE of CONTENTS
1: INTRODUCTION, CODE FORMATTING, AND TOOLS
2: PYTHONIC CODE
3: GENERAL TRAITS OF GOOD CODE
4: THE SOLID PRINCIPLES
5: USING DECORATORS TO IMPROVE OUR CODE
6: GETTING MORE OUT OF OUR OBJECTS WITH DESCRIPTORS
7: USING GENERATORS
8: UNIT TESTING AND REFACTORING
9: COMMON DESIGN PATTERNS
10: CLEAN ARCHITECTURE


리뷰

구매자 별점

0.0

점수비율
  • 5
  • 4
  • 3
  • 2
  • 1

0명이 평가함

리뷰 작성 영역

이 책을 평가해주세요!

내가 남긴 별점 0.0

별로예요

그저 그래요

보통이에요

좋아요

최고예요

별점 취소

구매자 표시 기준은 무엇인가요?

'구매자' 표시는 리디에서 유료도서 결제 후 다운로드 하시거나 리디셀렉트 도서를 다운로드하신 경우에만 표시됩니다.

무료 도서 (프로모션 등으로 무료로 전환된 도서 포함)
'구매자'로 표시되지 않습니다.
시리즈 도서 내 무료 도서
'구매자’로 표시되지 않습니다. 하지만 같은 시리즈의 유료 도서를 결제한 뒤 리뷰를 수정하거나 재등록하면 '구매자'로 표시됩니다.
영구 삭제
도서를 영구 삭제해도 ‘구매자’ 표시는 남아있습니다.
결제 취소
‘구매자’ 표시가 자동으로 사라집니다.

이 책과 함께 구매한 책


이 책과 함께 둘러본 책



본문 끝 최상단으로 돌아가기

spinner
모바일 버전