معرفی کتاب «Ultimate Go Notebook» نوشتهٔ William Kennedy و Hoanh An، منتشرشده توسط نشر Ardan Labs Press در سال 2021. این کتاب در 350 صفحه، فرمت pdf، زبان انگلیسی ارائه شده است. «Ultimate Go Notebook» در دستهٔ برنامهنویسی قرار دارد.
کتاب «Ultimate Go Notebook» نوشتهٔ ویلیام کندی و هوآنه آن، راهنمای رسمی و همراه برای دورهٔ معروف Ultimate Go در آزمایشگاه آردان (Ardan Labs) است. این کتاب با تمرکز بر تصمیمگیریهای مهندسی در سطح خرد (micro-level)، به برنامهنویسان میآموزد که چگونه کدهای اصیلتر (idiomatic) و با کارایی بالاتری در زبان گو (Go) بنویسند.
دربارهٔ کتاب Ultimate Go Notebook
کتاب «دفترچهٔ نهایی گو» که در سال ۲۰۲۱ توسط انتشارات Ardan Labs Press منتشر شده است، به عنوان یک منبع مرجع کامل برای تمام مباحث مطرحشده در کلاس Ultimate Go طراحی شده است. این کتاب با ایجاد مدلهای ذهنی و فلسفهٔ طراحی صحیح، ذهن خواننده را برای درک عمیقتر مطالب آماده میکند و مفاهیمی چون نوعشناسی (types)، جداسازی (decoupling)، مدیریت خطا (error handling) و همروندی (concurrency) را به شکلی بنیادین پوشش میدهد. یکی از نقاط قوت برجستهٔ این کتاب، پرداختن به مباحث پیشرفته و بهروزی مانند «جنریکها» (Generics) است که با ارائهٔ نحوهٔ نوشتن توابع و انواع جنریک در نسخهٔ٫۱۸ گو، دانش برنامهنویسان را به روز نگه میدارد. همچنین چهار فصل تخصصی به مباحث حیاتی پروفایلگیری (profiling)، رهگیری (tracing) و تحلیل پشتهی خطا (stack traces) اختصاص یافته است که مهارتهای اشکالزدایی (debugging) را در توسعهدهندگان به سطح بالاتری ارتقا میدهد. این کتاب نه تنها برای شرکتکنندگان در کلاس، بلکه برای هر توسعهدهندهای که به دنبال درکی فراتر از مبانی گو است، ارزشی فوقالعاده دارد.
دربارهٔ نویسنده
ویلیام کندی (William Kennedy)، نویسندهٔ اصلی این کتاب، شریک مدیریتی در شرکت Ardan Labs و یکی از برجستهترین مربیان زبان گو در جهان است. او که از سال ۲۰۱۴ به آموزش گو به هزاران توسعهدهنده در سراسر جهان پرداخته، به عنوان یکی از بنیانگذاران گروه GoBridge نیز فعالیت میکند. کندی نویسندهٔ کتاب «Go in Action» و وبلاگ «GoingGo.Net» است و به دلیل رویکرد عمیق خود در تدریس مفاهیم زبان، شهرت فراوانی دارد. هوآنه آن (Hoanh An)، نویسندهٔ دیگر کتاب، مهندس نرمافزاری است که راهنمای مطالعاتی Ultimate-Go را در گیتهاب با بیش از ۱۴ هزار ستاره ایجاد کرده است.
چرا باید Ultimate Go Notebook را بخوانید؟
مطالعهٔ این کتاب به شما کمک میکند تا درک عمیقی از طراحی و پیادهسازی نرمافزارهای کارآمد با زبان گو پیدا کنید.
- نوشتن کد اصیل و کارآمد: با تمرکز بر تصمیمات مهندسی در سطح خرد، میآموزید که چگونه کدی بنویسید که هم از نظر عملکرد و هم از نظر ساختار، در سطح بالایی قرار داشته باشد.
- درک مفاهیم پیشرفته: با مباحثی مانند جنریکها و نحوهٔ استفاده از آنها در نسخههای جدید گو، و همچنین تکنیکهای حرفهای پروفایلگیری و اشکالزدایی آشنا میشوید.
- ایجاد مدلهای ذهنی صحیح: کتاب با ایجاد یک چارچوب فکری و فلسفهٔ طراحی، به شما کمک میکند تا تصمیمات بهتری در مورد ساختار کد و معماری پروژههای خود بگیرید.
- مرجعی کامل برای مباحث کلاس Ultimate Go: این کتاب به عنوان یادداشتهای شخصی شما عمل کرده و تمام مطالب مطرحشده در دوره را به صورت مرجعی جامع در اختیارتان قرار میدهد.
- ارتقاء به سطح یک توسعهدهندهٔ حرفهای: با تسلط بر اصول و تکنیکهای مطرح شده، به سطحی از دانش دست مییابید که برای نقشهایی مانند بازبینیکننده کد (code reviewer)، طراح و معمار نرمافزار ضروری است.
این کتاب برای چه کسانی مناسب است؟
کتاب «Ultimate Go Notebook» برای طیف گستردهای از برنامهنویسان طراحی شده است. این کتاب برای توسعهدهندگانی که حداقل چند ماه تا چند سال تجربهٔ کدنویسی با گو دارند و به دنبال دانشی عمیقتر از مبانی زبان هستند، بسیار مناسب است. همچنین برای کسانی که از زبانهای دیگر به گو روی آوردهاند و میخواهند با اصول و مبانی منحصربهفرد این زبان آشنا شوند، منبعی ارزشمند محسوب میشود. اگرچه این کتاب به عنوان همراه دورهٔ Ultimate Go طراحی شده، اما برای هر کسی که به دنبال درک بهتر مفاهیم پیشرفتهای مانند همروندی، مدیریت داده و ابزارهای گو است، کاربردی و مفید خواهد بود.
سوالات متداول
آیا برای استفاده از این کتاب حتماً باید در کلاس Ultimate Go شرکت کرده باشم؟
خیر، اگرچه این کتاب به عنوان همراه رسمی کلاس Ultimate Go طراحی شده است، اما برای افرادی که در این کلاس شرکت نکردهاند نیز ارزش زیادی دارد. کتاب شامل مباحث پیشرفتهای است که در سایر کتابهای موجود به آنها پرداخته نشده و میتواند به عنوان یک منبع مستقل برای یادگیری عمیق گو مورد استفاده قرار گیرد.
آیا این کتاب برای مبتدیانی که تازه برنامهنویسی را شروع کردهاند مناسب است؟
این کتاب بیشتر برای توسعهدهندگان سطح متوسط طراحی شده است که حداقل چند ماه تجربهٔ کار با گو یا زبانهای مشابه دارند. با این حال، برای مبتدیانی که با مفاهیم پایهٔ برنامهنویسی (مانند کار با فایلها، حافظه و HTTP) آشنایی دارند، میتواند منبعی بسیار عالی برای پیشرفت سریع باشد.
تفاوت این کتاب با سایر کتابهای آموزش گو در چیست؟
این کتاب بر خلاف بسیاری از منابع، صرفاً به آموزش سینتکس (نحو) زبان نمیپردازد، بلکه بر تصمیمات مهندسی در سطح خرد و فلسفهٔ طراحی گو تمرکز دارد. رویکرد منحصربهفرد آن در ایجاد مدلهای ذهنی صحیح و پوشش مباحث پیشرفتهای مانند پروفایلگیری و کار با جنریکها، آن را به منبعی متمایز برای کسانی که به دنبال درکی عمیقتر هستند، تبدیل کرده است.
The Ultimate Go Notebook is the official companion book for the Ardan Labs Ultimate Go class. With this book, you will learn how to write more idiomatic and performant code with a focus on micro-level engineering decisions. This notebook has been designed to provide a reference to everything mentioned in class, as if they were your own personal notes. Our classes challenge every student to think about what they are doing and why and so does this book. The first chapter helps you prepare your mind by establishing the mental models and design philosophy for the material you are about to review. You will learn about the mechanics and semantics behind types, decoupling, error handling, concurrency, and more. GENERICS! Learn about the new syntax coming to Go 1.18 for writing generic functions and types. Four chapters on profiling, tracing, and stack traces help you learn critical debugging skills that will make you a more productive Go developer. The last chapter features the many blog posts that are referenced throughout the book. If you have taken the class before, this notebook will be an invaluable resource for reminders on the content. If you have never taken the class, there is still tremendous value in this book as it covers more advanced topics not found in other books today. “If you want to be a better Go developer, code reviewer, designer and architect, this is the book you want.” When coming from another language, developers often struggle to grasp the fundamentals that make Go useful and unique. This book builds layers of foundational knowledge that will give you a deeper understanding into data semantics, decoupling, concurrency and tooling that is provided with the language. Welcome Intended Audience Acknowledgements Table Of Contents Chapter 1: Introduction 1.1 Reading Code 1.2 Legacy Software 1.3 Mental Models 1.4 Productivity vs Performance 1.5 Correctness vs Performance 1.6 Understanding Rules 1.7 Differences Between Senior vs Junior Developers 1.8 Design Philosophy 1.8.1 Integrity 1.8.2 Readability 1.8.3 Simplicity 1.8.4 Performance 1.8.5 Micro-Optimizations 1.8.6 Data-Orientation 1.8.7 Interface And Composition 1.8.8 Writing Concurrent Software 1.8.9 Signaling and Channels Chapter 2: Language Mechanics 2.1 Built-in Types 2.2 Word Size 2.3 Zero Value Concept 2.4 Declare and Initialize 2.5 Conversion vs Casting 2.6 Struct and Construction Mechanics 2.7 Padding and Alignment 2.8 Assigning Values 2.9 Pointers 2.10 Pass By Value 2.11 Escape Analysis 2.12 Stack Growth 2.13 Garbage Collection 2.14 Constants 2.15 IOTA Chapter 3: Data Structures 3.1 CPU Caches 3.2 Translation Lookaside Buffer (TLB) 3.3 Declaring and Initializing Values 3.4 String Assignments 3.5 Iterating Over Collections 3.6 Value Semantic Iteration 3.7 Pointer Semantic Iteration 3.8 Data Semantic Guideline For Built-In Types 3.9 Different Type Arrays 3.10 Contiguous Memory Construction 3.11 Constructing Slices 3.12 Slice Length vs Capacity 3.13 Data Semantic Guideline For Slices 3.14 Contiguous Memory Layout 3.15 Appending With Slices 3.16 Slicing Slices 3.17 Mutations To The Backing Array 3.18 Copying Slices Manually 3.19 Slices Use Pointer Semantic Mutation 3.20 Linear Traversal Efficiency 3.21 UTF-8 3.22 Declaring And Constructing Maps 3.23 Lookups and Deleting Map Keys 3.24 Key Map Restrictions Chapter 4: Decoupling 4.1 Methods 4.2 Method Calls 4.3 Data Semantic Guideline For Internal Types 4.4 Data Semantic Guideline For Struct Types 4.5 Methods Are Just Functions 4.6 Know The Behavior of the Code 4.7 Interfaces 4.8 Interfaces Are Valueless 4.9 Implementing Interfaces 4.10 Polymorphism 4.11 Method Set Rules 4.12 Slice of Interface 4.13 Embedding 4.14 Exporting Chapter 5: Software Design 5.1 Grouping Different Types of Data 5.2 Don’t Design With Interfaces 5.3 Composition 5.4 Decoupling With Interfaces 5.5 Interface Composition 5.6 Precision Review 5.7 Implicit Interface Conversions 5.8 Type assertions 5.9 Interface Pollution 5.10 Interface Ownership 5.11 Error Handling 5.12 Always Use The Error Interface 5.13 Handling Errors Chapter 6: Concurrency 6.1 Scheduler Semantics 6.2 Concurrency Basics 6.3 Preemptive Scheduler 6.4 Data Races 6.5 Data Race Example 6.6 Race Detection 6.7 Atomics 6.8 Mutexes 6.9 Read/Write Mutexes 6.10 Channel Semantics 6.11 Channel Patterns 6.11.1 Wait For Result 6.11.2 Fan Out/In 6.11.3 Wait For Task 6.11.4 Pooling 6.11.5 Drop 6.11.6 Cancellation 6.11.7 Fan Out/In Semaphore 6.11.8 Bounded Work Pooling 6.11.9 Retry Timeout 6.11.10 Channel Cancellation Chapter 7: Testing 7.1 Basic Unit Test 7.2 Table Unit Test 7.3 Web Call Mocking 7.4 Internal Web Endpoints 7.5 Basic Sub-Tests Chapter 8: Benchmarking 8.1 Basic Benchmark 8.2 Basic Sub-Benchmarks 8.3 Validate Benchmarks Chapter 9: Generics 9.1 Basic Syntax 9.2 Underlying Types 9.3 Struct Types 9.4 Behavior As Constraint 9.5 Type As Constraint 9.6 Multi-Type Parameters 9.7 Field Access 9.8 Slice Constraints 9.9 Channels 9.10 Hash Tables Chapter 10: Profiling 10.1 Introduction 10.1.1 The Basics of Profiling 10.1.2 Types of Profiling 10.1.3 Hints to interpret what I see in the profile 10.1.4 Rules of Performance 10.1.5 Go and OS Tooling 10.2 Example Code 10.3 Benchmarking 10.4 Memory Profiling 10.5 Inlining 10.6 Escape Analysis Chapter 11: Profiling Live Code 11.1 Example Code 11.2 Generating a GC Trace 11.3 Generating Load And Evaluation 11.4 Adding Profile Endpoints 11.5 Viewing Memory Profile 11.6 Removing Allocations Chapter 12: Tracing 12.1 Example Code 12.2 Generating Traces 12.3 Viewing Traces 12.4 Fan-Out 12.5 Cache Friendly 12.6 Fan-Out Results 12.7 Pooling 12.8 Pooling Results 12.9 GC Percentage 12.10 Tasks And Regions Chapter 13: Stack Traces / Core Dumps 13.1 ABI Changes In 1.17 13.2 Basic Example 13.3 Word Packing 13.4 Go 1.17 ABI Changes 13.5 Generating Core Dumps Chapter 14: Blog Posts 14.1 Stacks And Pointer Mechanics 14.2 Escape Analysis Mechanics 14.3 Scheduling In Go: OS Scheduler 14.4 Scheduling In Go: Go Scheduler 14.5 Scheduling In Go: Concurrency 14.6 Garbage Collection Semantics **__The Ultimate Go Notebook__** is the official companion book for the Ardan Labs Ultimate Go class. With this book, you will learn how to write more idiomatic and performant code with a focus on micro-level engineering decisions. This notebook has been designed to provide a reference to everything mentioned in class, as if they were your own personal notes. * The first chapter helps you prepare your mind by establishing the mental models and design philosophy for the material you are about to review. * You will learn about the mechanics and semantics behind types, decoupling, error handling, concurrency, and more. * GENERICS! Learn about the new syntax coming to Go 1.18 for writing generic functions and types. * Four chapters on profiling, tracing, and stack traces help you learn critical debugging skills that will make you a more productive Go developer. * The last chapter features the many blog posts that are referenced throughout the book. __“If you want to be a better Go developer, code reviewer, designer and architect, this is the book you want.”__