
۴۴٬۰۰۰تومان
نوع فایل دانلود: EPUB
پس از خرید، یک فایل EPUB دریافت میکنید.
این فایل با Calibre، Apple Books و سایر کتابخوانهای دیجیتال مناسب است.
مهندسی نرمافزار و بهترین شیوههای کدنویسی را یاد بگیرید تا کد پایتون را درست و بدون خطا بنویسید. در این کتاب میبینید چطور کدتان را بهدرستی اشکالزدایی، سازماندهی، تست و نگهداری کنید؛ همهی اینها به کدنویسی بهتر و کارآمدتر میانجامد. مهندسی نرمافزار سخت است. برنامههایی با طول قابل توجه، ذاتاً مستعد انواع خطا هستند. چرخهی توسعه پر از دامهایی است که برنامهنویس تازهکار از آنها بیخبر است. با این حال، در کتابهای پایتون توجه کمی به این جنبهی اجرای درست کد شده است. در بهترین حالت، در یک کتاب پایتون مبتدی، یک فصل دربارهی اشکالزدایی یا تست واحد هست. اما در دنیای واقعی، سهم زمانی که صرف اجرای درست کد میشود خیلی بیشتر است. کتاب بهترین شیوههای حرفهای پایتون میخواهد این مشکل را حل کند. شما یاد میگیرید: تکنیکهای رایج اشکالزدایی که به پیدا کردن و از بین بردن خطاها کمک میکنند؛ تکنیکهایی برای تشخیص آسانتر باگها؛ بهترین شیوهها برای پیشگیری از باگها؛ انجام تست خودکار؛ کشف سریعتر مشکلات؛ بهترین شیوهها برای نگهداری یک پروژه در بلندمدت؛ تکنیکهایی برای کنترل نگه داشتن پروژهتان. فصل ۲: استثناها در پایتون. استثناها نقصهایی هستند که از آنها خبر داریم؛ خواندن کد؛ SyntaxError؛ بهترین شیوهها برای اشکالزدایی SyntaxErrorها؛ بررسی پیام خطا؛ نوع خطا؛ توضیح خطا؛ تریسبک؛ استنتاج؛ گرفتن استثناها؛ بهترین شیوهها برای اشکالزدایی IOErrorها؛ خطاها و نقصها؛ نقصها از کجا میآیند؟؛ کد درست؛ بهترین شیوهها؛ فصل ۳: خطاهای معنایی در پایتون؛ مقایسهی خروجی مورد انتظار و خروجی واقعی؛ نقصها؛ نقص در انتساب متغیرها؛ مقداردهی اولیهی چندباره؛ انتساب تصادفی؛ مقایسهی تصادفی. مرور دستورهای IPython. کاوش فضای نام؛ کاوش فضای نام با dir()؛ کاوش فضای نام اشیاء؛ کاوش ویژگیها در یک برنامهی پایتون؛ جایگزینهای dir در IPython؛ مکانیک فضای نام؛ پایتون از فضای نام برای توابع خودش استفاده میکند؛ تغییر یک فضای نام؛ فضای نام و حوزهی محلی؛ فضای نام یک ویژگی اصلی پایتون است؛ استفاده از اشیاء خودتوضیحگر؛ دسترسی به docstringها با help()؛ خلاصهی اشیاء در IPython؛ تحلیل نوع اشیاء؛ بررسی هویت شیء؛ بررسی نمونهها و زیرکلاسها؛ کاربرد عملی دروننگری؛ پیدا کردن غلطهای تایپی با دروننگری. مشکل را برای کس دیگری توضیح دهید. برنامهنویسی دونفره؛ بازبینی کد؛ خواندن؛ پاکسازی؛ روش علمی و سایر بهترین شیوهها؛ بهترین شیوهها؛ فصل ۵: اشکالزدایی با دستورهای print؛ تشخیص اینکه آیا کد اجرا شده؛ چاپ محتوای متغیرها؛ چاپ زیبای ساختارهای داده؛ سادهسازی دادهی ورودی؛ شروع با کمینهی ورودی؛ افزودن تدریجی دادهی ورودی بیشتر؛ روشن و خاموش کردن خروجی print؛ کد کامل؛ مزایا و معایب استفاده از دستورهای print؛ بهترین شیوهها؛ فصل ۶: اشکالزدایی با توابع دروننگری؛ کدنویسی اکتشافی در IPython؛ کاوش فایلها و پوشهها. در یک نگاه؛ فهرست مطالب؛ دربارهی نویسنده؛ دربارهی بازبین فنی؛ سپاسگزاری؛ پیشگفتار؛ فصل ۱: مقدمه؛ درسی در فروتنی؛ دلیل نیاز به بهترین شیوهها در پایتون؛ ریشهی بهترین شیوهها؛ هک کردن؛ مهندسی نرمافزار؛ اجایل؛ مهارتورزی نرمافزار؛ این کتاب برای چه کسانی است؛ موضوع این کتاب چیست؛ بخش ۱: اشکالزدایی؛ بخش ۲: تست خودکار؛ بخش ۳: نگهداری؛ مزایای بیشتر؛ بازی MazeRun؛ چطور از این کتاب استفاده کنیم؟؛ نصب پایتون ۳؛ نصب کتابخانهی Pygame؛ نصب یک ویرایشگر متن؛ دانلود نمونههای کد منبع؛ بخش اول: اشکالزدایی. متغیرهای اشتباه در یک عبارت. جابهجایی لیترالها در عبارت؛ نقص در ایندکسگذاری؛ ساخت ایندکسهای اشتباه؛ استفاده از ایندکسهای اشتباه؛ نقص در دستورهای کنترل جریان؛ نقص در عبارات بولین؛ نقص مربوط به تورفتگی؛ نقص در استفاده از توابع؛ جا انداختن فراخوانی تابع؛ نبود دستور return؛ ذخیرهنکردن مقدار بازگشتی؛ انتشار خطا؛ بهترین شیوهها؛ فصل ۴: اشکالزدایی با روش علمی؛ بهکارگیری روش علمی؛ بازتولید خطا؛ خودکارسازی خطا؛ جداسازی نقص؛ راهبرد سادهسازی؛ راهبرد جستجوی دودویی؛ گرفتن کمک؛ کمی استراحت کردن.
Learn software engineering and coding best practices to write Python code right and error free. In this book you'll see how to properly debug, organize, test, and maintain your code, all of which leads to better, more efficient coding. Software engineering is difficult. Programs of any substantial length are inherently prone to errors of all kinds. The development cycle is full of traps unknown to the apprentice developer. Yet, in Python textbooks little attention is paid to this aspect of getting your code to run. At most, there is a chapter on debugging or unit testing in your average basic Python book. However, the proportion of time spent on getting your code to run is much higher in the real world. Pro Python Best Practices aims to solve this problem. You will: Learn common debugging techniques that help you find and eliminate errors Gain techniques to detect bugs more easily ver best="" practices="" to="" prevent="" bugscarry="" out="" automated="" testing="" discover="" problems="" faster Use best practices to maintain a project over a long time Learn techniques to keep your project under control.;Chapter 2: Exceptions in PythonExceptions Are Defects We Know About; Reading the Code; SyntaxError; Best Practices for Debugging SyntaxErrors; Examining the Error Message; The Error Type; The Error Description; The Traceback; Deduction; Catching Exceptions; Best Practices for Debugging IOErrors; Errors and Defects; Where Do Defects Come From?; The Correct Code; Best Practices; Chapter 3: Semantic Errors in Python; Comparing Expected and Factual Output; Defects; Defects in Variable Assignments; Multiple Initialization; Accidental Assignment; Accidental Comparison.;Overview of IPython CommandsExploring Namespaces; Exploring Namespaces with dir(); Exploring Namespaces of Objects; Exploring Attributes in a Python Program; Alternatives to dir in IPython; Namespace Mechanics; Python Uses Namespaces for Its Own Functions; Modifying a Namespace; Namespaces and Local Scope; Namespaces Are a Core Feature of Python; Using Self-Documenting Objects; Accessing Docstrings with help(); Object Summaries in IPython; Analyzing Object Types; Checking Object Identity; Checking Instances and Subclasses; Practical Use of Introspection; Finding Typos with Introspection.;Explain the Problem to Someone ElsePair Programming; Code Reviews; Reading; Cleaning Up; The Scientific Method and Other Best Practices; Best Practices; Chapter 5: Debugging with print Statements; Diagnose Whether Code Was Executed; Print the Content of Variables; Pretty-Printing Data Structures; Simplify Input Data; Start with Minimal Input; Gradually Add More Input Data; Switching print Output On and Off; Complete Code; Pros and Cons of Using print Statements; Best Practices; Chapter 6: Debugging with Introspection Functions; Explorative Coding in IPython; Exploring Files and Directories.;At a Glance; Contents; About the Author; About the Technical Reviewer; Acknowledgments; Preface; Chapter 1: Introduction; A Lesson in Humility; The Case for Best Practices in Python; The Origin of Best Practices; Hacking; Software Engineering; Agile; Software Craftsmanship; Who This Book Is For; What This Book Is About; Part 1: Debugging; Part 2: Automated Testing; Part 3: Maintenance; Further Benefits; The MazeRun Game; How to Use This Book?; Install Python 3; Install the Pygame Library; Install a Text Editor; Download the Source Code Examples; Part I: Debugging.;Wrong Variables in an ExpressionSwapped Literals in Expression; Defects in Indexing; Creating Wrong Indices; Using Wrong Indices; Defects in Control Flow Statements; Defects in Boolean Expressions; Defects with Indentation; Defects in Using Functions; Omitting a Function Call; Missing Return Statement; Not Storing the Return Value; Error Propagation; Best Practices; Chapter 4: Debugging with the Scientific Method; Applying the Scientific Method; Reproducing the Error; Automating the Error; Isolating the Defect; The Strip-Down Strategy; The Binary Search Strategy; Getting Help; Taking a Break.