Principles, Practices, and Patterns
Christopher Preschern

#Fluent
#C_language
#C_programming
#API
یافتن راهنمای تخصصی درباره زبان برنامهنویسی C کار سادهای نیست. در حالیکه منابع زیادی برای زبانهای شیءگرا در دسترس است، برای زبان C بهطور شگفتآوری منابع محدودی وجود دارد. این راهنمای عملی، چه برای مبتدیان و چه برای برنامهنویسان باتجربه C، راهکارهایی درباره تصمیمگیریهای طراحی ارائه میدهد—و نشان میدهد چگونه میتوان این تصمیمها را بهتدریج و بهصورت کد اجرایی پیادهسازی کرد، بهویژه در ساخت برنامههای بزرگمقیاس.
کریستوفر پرشرن، از اعضای برجسته جامعه الگوهای طراحی، به پرسشهایی مانند ساختاردهی صحیح برنامههای C، مدیریت خطاها، یا طراحی واسطهای انعطافپذیر پاسخ میدهد. چه به دنبال یک الگوی خاص باشید و چه مروری کلی بر گزینههای طراحی برای موضوعی مشخص، این کتاب به شما میآموزد چگونه دانش طراحی را بهطور عملی و خاص برای زبان C بهکار بگیرید.
در این کتاب با الگوهای طراحی زیر آشنا میشوید:
شما این کتاب را برداشتهاید تا یک گام در مهارتهای برنامهنویسی خود پیش بروید—و این تصمیم خوبی است، چون بدون شک از دانش عملی ارائهشده در این کتاب بهره خواهید برد. اگر در برنامهنویسی C باتجربه هستید، با جزئیات تصمیمات طراحی خوب و مزایا و معایب آنها آشنا میشوید. اگر هم در برنامهنویسی C تازهکار هستید، این کتاب راهنماییهایی درباره تصمیمهای طراحی به شما ارائه میدهد و نشان میدهد چگونه این تصمیمها بهتدریج در قالب مثالهای واقعی برای ساخت برنامههای بزرگتر بهکار میروند.
کتاب به پرسشهایی از این قبیل پاسخ میدهد:
errno استفاده کنم؟Expert advice on C programming is hard to find. While much help is available for object-oriented programming languages, there's surprisingly little for the C language. With this hands-on guide, beginners and experienced C programmers alike will find guidance about design decisions, including how to apply them bit by bit to running code examples when building large-scale programs.
Christopher Preschern, a leading member of the design patterns community, answers questions such as how to structure C programs, cope with error handling, or design flexible interfaces. Whether you're looking for one particular pattern or an overview of design options for a specific topic, this book shows you how to implement hands-on design knowledge specifically for the C programming language.
You'll find design patterns for:
You picked up this book to move your programming skills one step forward. That is good, because you’ll definitely benefit from the hands-on knowledge provided in this book. If you have a lot of experience programming in C, you’ll learn the details of good design decisions and about their benefits and drawbacks. If you are fairly new to C programming, you’ll find guidance about design decisions, and you’ll see how these decisions are applied bit by bit to running code examples for building larger scale programs.
The book answers questions such as how to structure a C program, how to cope with error handling, or how to design flexible interfaces. As you learn more about C programming, questions often pop up, such as the following:
Table of Contents
Part I. C Patterns
Chapter 1. Error Handling
Chapter 2. Returning Error Information
Chapter 3. Memory Management
Chapter 4. Returning Data from C Functions
Chapter 5. Data Lifetime and Ownership
Chapter 6. Flexible APIs
Chapter 7. Flexible Iterator Interfaces
Chapter 8. Organizing Files in Modular Programs
Chapter 9. Escaping #ifdef Hell
Part II. Pattern Stories
Chapter 10. Implementing Logging Functionality
Chapter 11. Building a User Management System
Chapter 12. Conclusion
How to Read This Book
You should already know C programming basics. You should know the C syntax and how it works—for example, this book won’t teach you what a pointer is or how to use it. This book delivers hints and guidance on advanced topics.
The chapters in this book are self-standing. You can read them in an arbitrary order, and you can simply pick out the topics you are interested in. You’ll find an overview of all patterns in the next section, and from there you can jump to the patterns you are interested in. So if you know exactly what you are looking for, you can start right there.
If you are not looking for one particular pattern, but instead want to get an overview of possible C design options, read through Part I of the book. Each chapter there focuses on a particular topic, starting with basic topics like error handling and memory managment, and then moving to more advanced and specific topics like interface design or platform-independent code. The chapters each present patterns related to that topic and a running code example that shows bit by bit how the patterns can be applied.
Part II of this book shows two larger running examples that apply many of the patterns from Part I. Here you can learn how to build up some larger piece of software bit by bit through the application of patterns.
'Fluent C' is an excellent introduction to C design patterns. There are many issues any professional C developer will encounter: how can memory be used efficiently? How can data structures be processed? How can error cases be trapped and logged? 'Fluent C' will show you how to handle these and many other problems step-by-step.
More than that, it will show you how an experienced C developer will examine and solve problems. You will see how real-world projects have tackled complex issues, with detailed information about large open source projects. You will see how C professionals:
'Fluent C' assumes a foundational knowledge of the C language and, for new developers, is best paired with an introductory C text. It's a book worthy of space on any professional C developer's bookshelf.
Recommended.
--David Griffiths, author of Head First C
'Fluent C' is your guide to making robust C language programs.
-- Robert Hanmer, software architect and author of pattern books
Christopher Preschern is a leading member of the design patterns community. He actively takes part in the organization of design pattern conferences and in initiatives to improve pattern writing. As a C programmer at the company ABB he gathered and documented hands-on knowledge on how to write industrial strength code. He lectured at the technical university of Graz courses on coding & quality and he holds a PhD in computer science.









