Better Python Code: A Guide for Aspiring Experts

Mertz, David

  • 出版商: Addison Wesley
  • 出版日期: 2023-11-24
  • 售價: $1,950
  • 貴賓價: 9.5$1,853
  • 語言: 英文
  • 頁數: 288
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 0138320942
  • ISBN-13: 9780138320942
  • 相關分類: Python程式語言
  • 立即出貨

相關主題

商品描述

Python is one of the most widely used programming languages in the world. It is used everywhere from primary school education to workaday web development, to the most advanced scientific research institutes of the world. However, like all programming languages, Python has a collection of "Pythonic" ways of accomplishing tasks that are easy to overlook, especially when habits are borrowed wholesale from work in other programming languages.

Better Python Code is a guide to Pythonic programming. The book presents common mistakes that Python developers make--even Python developers who have used the language for years--often because Python sometimes presents "attractive nuisances." Throughout, the book is a guide to better programming in the core Python language.

Each section shows a concrete but concise example of some misunderstanding or bad habit in action. Each section contains a description of what is wrong with the sample code and a suggestion for one or more better ways to code equivalent functionality without the initial pitfall. Every pitfall addressed in this book reflects foibles, errors, and misunderstandings that the author as seen in concrete, widely used code bases written by experienced developers, over his 25 years of writing Python.

Both beginners and developers with decades of experience will learn to correct limitations in the code they write after reflecting on these discussions.

商品描述(中文翻譯)

Python是世界上使用最廣泛的程式語言之一。它被應用於從小學教育到日常網頁開發,甚至是世界上最先進的科學研究機構。然而,就像所有程式語言一樣,Python有一系列「Pythonic」的方式來完成任務,這些方式很容易被忽視,特別是當習慣從其他程式語言中全盤借用時。

《更好的Python程式碼》是一本關於Pythonic程式設計的指南。本書介紹了Python開發人員常犯的錯誤,即使是使用該語言多年的開發人員也會犯這些錯誤,這往往是因為Python有時會呈現出「有吸引力的麻煩」。整本書都是關於如何在核心Python語言中進行更好的程式設計的指南。

每個章節都展示了一個具體但簡潔的例子,展示了某種誤解或不良習慣的實際應用。每個章節都包含對示例程式碼的問題所在的描述,並提供一個或多個更好的編碼等效功能的建議,以避免最初的陷阱。本書中提到的每個陷阱都反映了作者在撰寫Python程式碼的25年中,從經驗豐富的開發人員撰寫的廣泛使用的程式碼庫中看到的怪癖、錯誤和誤解。

無論是初學者還是有數十年經驗的開發人員,在思考這些討論後,都將學會如何改進他們所撰寫的程式碼中的限制。

作者簡介

David Mertz has been a member of the Python community for 25 years. He has taught Python to scientists, developers coming from other languages, and to programming neophytes. He was a director of the Python Software Foundation (PSF) for six years and continues to serve on, or chair, a variety of PSF working groups. David is the author of several technical books and has given keynote addresses at numerous international programming conferences.

作者簡介(中文翻譯)

David Mertz在Python社群中已經有25年的經驗。他曾教授Python給科學家、從其他語言轉換過來的開發者以及程式設計新手。他曾擔任Python軟體基金會(PSF)的董事長六年,並繼續在各種PSF工作小組中擔任成員或主席。David是幾本技術書籍的作者,並在許多國際程式設計會議上發表主題演講。