Better Python Code: A Guide for Aspiring Experts
暫譯: 更好的 Python 程式碼:志向專家的指南

Mertz, David

  • 出版商: Addison Wesley
  • 出版日期: 2023-11-24
  • 售價: $1,850
  • 貴賓價: 9.5$1,758
  • 語言: 英文
  • 頁數: 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 語言中進行更好程式設計的指南。

每個部分都展示了一個具體但簡潔的例子,說明某些誤解或壞習慣的實際情況。每個部分都包含了對示例代碼中錯誤的描述,以及一個或多個更好的編碼方式的建議,以實現等效的功能而不陷入最初的陷阱。本書中提到的每一個陷阱都反映了作者在其 25 年的 Python 編寫經驗中,從經驗豐富的開發者所寫的具體、廣泛使用的代碼庫中看到的缺陷、錯誤和誤解。

無論是初學者還是擁有數十年經驗的開發者,在反思這些討論後,都將學會修正他們所寫代碼中的限制。

作者簡介

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 是幾本技術書籍的作者,並在多個國際程式設計會議上擔任主題演講者。