معرفی کتاب «Beginning Ada Programming : From Novice to Professional» نوشتهٔ Michael E، Gerber و Andrew T. Shvets، منتشرشده توسط نشر Apress : Imprint: Apress در سال 2020. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است.
آغاز یادگیری برنامهنویسی به زبان آدا (Ada) با کتاب «Beginning Ada Programming: From Novice to Professional» نوشتهٔ اندرو تی. شوتس، سفری است که شما را از یک تازهکار به برنامهنویسی مسلح به ابزارهای قدرتمند برای ساخت نرمافزارهای ایمن و قابلاطمینان تبدیل میکند. این کتاب با رویکردی گامبهگام و مثالهای عملی، دنیای منحصربهفرد زبانی را به شما نشان میدهد که در قلب سیستمهای حیاتی مانند هواپیماها و ماهوارهها قرار دارد.
دربارهٔ کتاب «Beginning Ada Programming» —
«Beginning Ada Programming: From Novice to Professional» یک منبع آموزشی جامع برای آشنایی با زبان برنامهنویسی آدا و جدیدترین نسخهٔ پایدار آن است. این کتاب که توسط انتشارات معتبر اسپرینگر (Springer) در سال ۲۰۲۰ منتشر شده، با هدف راهنمایی ملایم خواننده در میان مباحث گوناگون این زبان طراحی شده است. نویسنده با درک این که مخاطبان زمان آزاد زیادی برای مطالعه ندارند، مطالب را به شکلی قابلهضم و با بیانی روان ارائه کرده تا مفاهیم بهراحتی جذب شوند. سبک نگارش کتاب بهگونهای است که با جزئیات کامل، چرایی و چگونگی عملکرد آدا را توضیح میدهد و خواننده را به آزمایش و حتی خراب کردن کدها تشویق میکند، چراکه یادگیری بدون خطا، فرآیندی یکنواخت و کسلکننده خواهد بود. ساختار کتاب بهدقت طراحی شده تا هر فصل بر اساس مطالب فصل قبل بنا شود و در عین حال، هر مثال کد بهطور مستقل اجرا شود. این کتاب از مباحث مقدماتی مانند انواع دادههای پایه، ساختارهای کنترلی و روالها آغاز شده و بهتدریج به مفاهیم پیشرفتهتر مانند برنامهنویسی شیگرا، مدیریت استثناها، پردازش همروند با استفاده از تسکها و حتی مفاهیم منحصربهفردی مانند اثبات درستی قراردادها (Contracts and Proofs) میپردازد. همچنین راهنماییهای لازم برای نصب کامپایلر و اشکالزدایی کدها در کتاب گنجانده شده است.
دربارهٔ نویسنده
نویسندهٔ این کتاب، اندرو تی. شوتس (Andrew T. Shvets)، از همان ابتدای ورود به دنیای برنامهنویسی به نوشتن نرمافزاری علاقهمند بود که بتوان درستی آن را اثبات کرد. این علاقهمندی او را به سمت زبان آدا و بهویژه نسخهٔ قدرتمند آن یعنی اسپارک (SPARK/Ada) سوق داد و در آنجا پاسخ سوالات خود را یافت. این دغدغهٔ فکری نویسنده بهوضوح در سراسر کتاب مشهود است و بر جنبههای ایمنی و قابلیتاطمینان زبان آدا تأکید میکند.
چرا باید «Beginning Ada Programming» را بخوانید؟
این کتاب دستاوردهای ارزشمندی را برای خواننده به ارمغان میآورد که از جملهٔ آنها میتوان به موارد زیر اشاره کرد:
- درک مفاهیم بنیادین آدا: با انواع دادههای پایه، ساختارهای کنترلی، روالها و توابع بهشکلی کامل و اصولی آشنا میشوید.
- تسلط بر انواع دادههای پیشرفته: نحوهٔ کار با آرایهها، رکوردها، انواع ارجاعی (Access Types) و برنامهنویسی شیگرا در آدا را فرا میگیرید.
- پردازش همروند و ورودی/خروجی: مبانی ورودی/خروجی، تعامل با سیستمعامل، پردازشهای همروند با تسکها و حتی برنامهنویسی شبکه را یاد خواهید گرفت.
- آشنایی با مفاهیم پیشرفته و منحصربهفرد: با مفاهیمی مانند «قراردادها و اثباتها» (Contracts and Proofs) در آدا ۲۰۱۲ آشنا میشوید که به شما امکان میدهند کدهایی با استحکام بالا بنویسید.
- یادگیری از طریق عمل: با مثالهای مستقل و کاربردی که هر کدام بهتنهایی اجرا میشوند، دانش خود را بهصورت عملی تثبیت میکنید.
این کتاب برای چه کسانی مناسب است؟
این کتاب دقیقاً برای برنامهنویسانی نوشته شده است که هیچ آشنایی قبلی با زبان آدا ندارند و به دنبال یک منبع گامبهگام و روان برای شروع هستند. همچنین برای افرادی که تجربهٔ برنامهنویسی، بهویژه در حوزهٔ برنامهنویسی علمی، دارند و میخواهند با یکی از قدرتمندترین زبانهای برنامهنویسی برای سیستمهای حیاتی آشنا شوند، منبعی ایدهآل محسوب میشود.
سوالات متداول
آیا برای مطالعهٔ این کتاب به پیشنیاز برنامهنویسی نیاز است؟
با اینکه کتاب بهگونهای نوشته شده که مفاهیم را از پایه توضیح دهد، داشتن تجربهٔ اولیه در برنامهنویسی، بهویژه در حوزهٔ برنامهنویسی علمی، برای درک بهتر مباحث و سرعت بخشیدن به فرآیند یادگیری بسیار مفید خواهد بود.
آیا مباحث مربوط به جدیدترین استانداردهای زبان آدا در کتاب پوشش داده شده است؟
بله، یکی از اهداف اصلی این کتاب، راهنمایی خواننده برای آشنایی با جدیدترین نسخهٔ پایدار و قابلدسترس زبان آدا است و مفاهیم مهمی مانند «قراردادها و اثباتها» که در نسخهٔ آدا ۲۰۱۲ معرفی شدهاند، در آن بهطور کامل پوشش داده شدهاند.
آیا کتاب به موضوع نصب و راهاندازی محیط برنامهنویسی آدا نیز پرداخته است؟
کتاب شامل دستورالعملهای لازم برای دریافت و نصب یک کامپایلر آدا و همچنین روشهای اشکالزدایی کدها است و در پیوستهای آن، نحوهٔ نصب در سیستمعاملهای لینوکس و ویندوز بهتفصیل توضیح داده شده است.
Discover the Ada programming language by being gently guided through the various parts of the language and its latest available stable release. The goal in this book is to slowly ease you into the different topics. It is understood that you do not always have ample free time, so the text is easy to digest and concepts are spoon fed to the reader. Starting with the simplest of topics, detailed explanations demonstrate the how and why of Ada. You are strongly encouraged to experiment and break things (without which the learning process is linear and quite dull). At the end of Beginning Ada Programming, you will have an excellent understanding of the general topics that make up the Ada programming language and can tackle far more challenging topics. Each chapter builds on what was previously described. Furthermore, each code example is independent of others and will run all by itself. Instructions are provided where you can obtain an Ada compiler and how to debug your code. Code Repository --- https://github.com/Apress/beginning-ada-programming Table of Contents 5 About the Author 13 About the Technical Reviewer 14 Acknowledgments 15 Part I: Introductory Topics 16 Chapter 1: Introduction 17 What You Will Get Out of This Book 17 The Current State of Software Development 17 The Benefits That Ada Brings to the Table 20 How Did This Language Get Its Name? 22 Why Write This Book 22 Myths About Ada 23 Layout of This Book 26 Standards in This Book 27 Getting Started 27 The Obligatory “Hello World” Example 28 What Do the File Endings Mean? 29 Contacting the Author and Source Code 32 Lab 32 Chapter 2: Basic Types 33 What You Will Get Out of This Chapter 33 The Basics of Variable Creation and Assignment 33 Numbers – Integers 34 What Are Attributes? 35 Three Types of Integers? 36 There Are No Long_Long_Naturals or Long_Long_Positives! 37 There Is Also a Long_Integer... 37 Numbers – Floats 38 Boolean Type 41 Default Values 42 Strings 45 Wordy Class Paths 48 Characters 50 Lab 51 Chapter 3: Basic Control Structures 53 What You Will Get Out of This Chapter 53 Edsger W. Dijkstra 53 If Statement 54 Parentheses and If Statements 56 Case Statement 56 While Loop 59 For Loop 62 Going Back 63 Infinite Loop 63 A Simple Loop and an Infinite Loop 64 Do Not GOTO! 65 Lab 65 Chapter 4: Procedures and Functions 67 What You Will Get Out of This Chapter 67 Difference Between a Procedure and a Function 67 Getting Information In and Out of Procedures and Functions 68 How to Declare and Implement Procedures and Functions 69 Uninitialized Values Are Risky 73 The Declare Block 74 Recursion 76 Recursion: Functions or Procedures? 77 Lab 81 Chapter 5: Arrays, Records, and Access Types 82 What You Will Get Out of This Chapter 82 A Very Simple Array 83 An Array of Strings 86 Runtime Allocation of Arrays 88 Creating and Populating Records 90 Creating Array of Records 93 Access Types 95 Lab 102 Chapter 6: Basics of Object-Oriented Programming (OOP) 104 What You Will Get Out of This Chapter 104 Packages and Objects in a Nutshell 104 Not Every Problem Is a Nail and OOP Is Not a Universal Hammer 106 The Guts of a Package 106 How to Use a Package 110 State, Information Hiding, Constructors, and Destructors 112 Lab 121 Part II: Intermediate Topics 122 Chapter 7: Exception Handling 123 What You Will Get Out of This Chapter 123 Description of Exceptions 123 When to Use Exceptions 124 Catching Exceptions 125 The Ever-Helpful Compiler 126 Throwing Existing Exceptions 128 Throwing and Making Your Own Exceptions 129 Lab 132 Chapter 8: The Basics of I/O and Interacting with the Operating System 133 What You Will Get Out of This Chapter 133 Reading from a Text File 134 Writing to a Text File 135 Executing Commands 139 Command-Line Arguments 141 Entering Runtime Text 143 Lab 144 Chapter 9: String Operations 145 What You Will Get Out of This Chapter 145 How to Concatenate and Split Apart Strings 146 How to Search Inside Strings 148 More Advanced Text Manipulation Techniques 150 How to Execute Regular Expressions 153 Regular Expressions 153 Lab 158 Chapter 10: Data Containers 159 What You Will Get Out of This Chapter 159 How to Work with a Queue 160 Arrays or Vectors? 164 How to Work with a List 165 How to Work with a Hashmap 168 Lab 176 Part III: Advanced Topics 177 Chapter 11: Multiprocessing with Tasks 178 What You Will Get Out of This Chapter 178 What Is a Task 179 Hello World Task 180 Infinite Loops and Tasks 182 Tasks Are Limited Types 182 Multiple Tasks 182 Sending Messages to Tasks 185 Queues and Tasks 187 The Select Structure 195 How Long Should You Make the Delay? 198 Sharing Resources Among Tasks Without Messages 198 Critical Region 205 Lab 205 Chapter 12: Advanced Types 206 What You Will Get Out of This Chapter 206 In-Depth Look at Ada Types 207 Number Types 207 Array Types 210 Enumerated Types 210 Is It 0 or 1? 4 or 10? 212 Limited Types 213 Subtypes 214 Ada Types in Improving Development 217 Converting Between Types 219 Ada.Unchecked_Conversion 219 Custom Floats 226 Lab 228 Chapter 13: Advanced OOP 230 What You Will Get Out of This Chapter 230 Inheritance 231 For the Times That Inheritance Is a Poor Approach 236 Polymorphism 237 Polymorphism in Different Programming Languages 239 Operator/Function Overloading 239 To Use “Use” or Not? 249 Generic Packages 250 Please Do Not Make Every Package Generic 256 How to Better Specify Different Format Types 257 Generic Functions and Procedures 258 Comparing Records Inside Generic Packages 260 Lab 262 Chapter 14: Contracts and Proofs 263 What You Will Get Out of This Chapter 263 Contracts on Functions and Procedures 263 All of the Aspects 265 Verifying a Range of Values 268 Using Custom Methods in Verification 271 Lab 273 Chapter 15: Networking and Advanced I/O 274 What You Will Get Out of This Chapter 274 TCP Protocol 274 UDP Protocol 281 Further Networking Reading 285 Networking Theory Resources 285 Practical Networking Resources 285 Lab 286 Chapter 16: Project Organization 287 What You Will Get Out of This Chapter 287 Application Folder Structure 288 “.hidden” Files in Project Directories 288 Project File 291 Making Builds 295 Command Arguments 296 Cleaning Up Builds 297 Advantages of Using Project Files 299 Further Documentation 300 Source Control 300 Is It Source Control or Configuration Management or Something Else? 301 Lab 303 Chapter 17: Libraries 304 What You Will Get Out of This Chapter 304 Library Source 304 Building the Library Object 312 Using the Library Object 314 Static Library 314 Shared Library 321 Another Option 323 Conclusion 324 Lab 324 Appendix A: Installing GNAT in Linux and Unix 325 Appendix B: Installing GNAT in Windows 329 Appendix C: Reserved Keywords 331 Appendix D: Debugging Ada Applications 333 An Overview of GDB and Its Commands 334 Debugger Commands 335 LLDB Debugger 337 A Debugging Session 337 Index 344 Discover the Ada programming language by being gently guided through the various parts of the language and its latest available stable release. The goal in this book is to slowly ease you into the different topics. It is understood that you do not always have ample free time, so the text is easy to digest and concepts are spoon fed to the reader. Starting with the simplest of topics, detailed explanations demonstrate the how and why of Ada. You are strongly encouraged to experiment and break things (without which the learning process is linear and quite dull). At the end of Beginning Ada Programming , you will have an excellent understanding of the general topics that make up the Ada programming language and can tackle far more challenging topics. Each chapter builds on what was previously described. Furthermore, each code example is independent of others and will run all by itself. Instructions are provided where you can obtain an Ada compiler and how to debug your code. What You Will Learn Master basic types, control structures, procedures, and functions in Ada Use Ada arrays, records, and access types Implement OO programming using Ada Handle the basics of I/O and interfacing with the operating system Take advantage of string operators, data containers, multiprocessing with tasks, and more Work with contracts and proofs, networks, and various Ada libraries Who This Book Is For Programmers who are new to Ada, with at least some experience in programming, especially scientific programming. Front Matter ....Pages i-xvii Front Matter ....Pages 1-1 Introduction (Andrew T. Shvets)....Pages 3-18 Basic Types (Andrew T. Shvets)....Pages 19-38 Basic Control Structures (Andrew T. Shvets)....Pages 39-52 Procedures and Functions (Andrew T. Shvets)....Pages 53-67 Arrays, Records, and Access Types (Andrew T. Shvets)....Pages 69-90 Basics of Object-Oriented Programming (OOP) (Andrew T. Shvets)....Pages 91-108 Front Matter ....Pages 109-109 Exception Handling (Andrew T. Shvets)....Pages 111-120 The Basics of I/O and Interacting with the Operating System (Andrew T. Shvets)....Pages 121-132 String Operations (Andrew T. Shvets)....Pages 133-146 Data Containers (Andrew T. Shvets)....Pages 147-164 Front Matter ....Pages 165-165 Multiprocessing with Tasks (Andrew T. Shvets)....Pages 167-194 Advanced Types (Andrew T. Shvets)....Pages 195-218 Advanced OOP (Andrew T. Shvets)....Pages 219-251 Contracts and Proofs (Andrew T. Shvets)....Pages 253-263 Networking and Advanced I/O (Andrew T. Shvets)....Pages 265-277 Project Organization (Andrew T. Shvets)....Pages 279-295 Libraries (Andrew T. Shvets)....Pages 297-317 Back Matter ....Pages 319-343