fluent_c_-_principles_practices_and_patterns_table_of_contents

Fluent C - Principles, Practices, and Patterns Table of Contents

Return to Fluent C, C Language Design Patterns, C Language, C Language Bibliography, C Language Courses, C Language DevOps - C Language CI/CD, C Language Security - C Language DevSecOps, C Language Functional Programming, C Language Concurrency, C Language Data Science - C Language and Databases, C Language Machine Learning, C Language Glossary, Awesome C Language, C Language GitHub, C Language Topics

“ (FlueC 2023)

Table of Contents

Preface vii

Part I. C Patterns

1. Error Handling . . . 3

Running Example 5

Function Split 6

Guard Clause 9

Samurai Principle 12

Goto Error Handling 16

Cleanup Record 19

Object-Based Error Handling 22

Summary 26

Further Reading 27

Outlook 27

2. Returning Error Information29

Running Example 30

Return Status Codes 32

Return Relevant Errors 39

Special Return Values 45

Log Errors 48

Summary 55

Further Reading 55

Outlook 56

iii

3. Memory Management . 57

Data Storage and Problems with Dynamic Memory 59

Running Example 61

Stack First 62

Eternal Memory 65

Lazy Cleanup 69

Dedicated Ownership 72

Allocation Wrapper 76

Pointer Check 81

Memory Pool 84

Summary 90

Further Reading 90

Outlook 91

4. Returning Data from C Functions . . . . 93

Running Example 94

Return Value 95

Out-Parameters 99

Aggregate Instance 103

Immutable Instance 108

Caller-Owned Buffer 111

Callee Allocates 116

Summary 120

Outlook 120

5. Data Lifetime and Ownership . . . . 121

Stateless Software-Module 123

Software-Module with Global State 127

Caller-Owned Instance 132

Shared Instance 138

Summary 144

Further Reading 145

Outlook 145

6. Flexible APIs . 147

Header Files 149

Handle 152

Dynamic Interface 156

Function Control 159

Summary 163

Further Reading 163

Outlook 164

iv | Table of Contents

7. Flexible Iterator Interfaces165

Running Example 167

Index Access 168

Cursor Iterator 172

Callback Iterator 177

Summary 182

Further Reading 183

Outlook 183

8. Organizing Files in Modular Programs . . . 185

Running Example 187

Include Guard 189

Software-Module Directories 192

Global Include Directory 197

Self-Contained Component 201

API Copy 207

Summary 216

Outlook 216

9. Escaping

Running Example 219

Avoid Variants 220

Isolated Primitives 224

Atomic Primitives 227

Abstraction Layer 231

Split Variant Implementations 236

Summary 242

Further Reading 243

Outlook 243

Part II. Pattern Stories

10. Implementing Logging Functionality . . . 247

The Pattern Story 247

File Organization 248

Central Logging Function 249

Logging Source Filter 250

Conditional Logging 252

Multiple Logging Destinations 253

File Logging 254

Cross-Platform Files 255

Table of Contents | v

Using the Logger 259

Summary 259

11. Building a User Management System . . . 261

The Pattern Story 261

Data Organization 261

File Organization 263

Authentication: Error Handling 264

Authentication: Error Logging 266

Adding Users: Error Handling 267

Iterating 269

Using the User Management System 272

Summary 272

12. Conclusion . . 275

What You've Learned 275

Further Reading 275

Closing Remarks 276

Index . . . . . 277

vi | Table of Contents

Fair Use Sources

C Language: C Fundamentals, C Inventor - C Language Designer: Dennis Ritchie in 1972; C Standards: ANSI X3J11 (ANSI C); ISO/IEC JTC 1 (Joint Technical Committee 1) / SC 22 (Subcommittee 22) / WG 14 (Working Group 14) (ISO C); C Keywords, C Pointers, C Data Structures - C Algorithms, C Syntax, C Memory Management, C Recursion, C on Android, C on Linux, C on macOS, C on Windows, C Installation, C Containerization, C Configuration, C Compiler, C IDEs (CLion), C Development Tools, C DevOps - C SRE, C Data Science - C DataOps, C Machine Learning, C Deep Learning, C Concurrency, C History, C Bibliography, Manning C Programming Series, C Glossary, C Topics, C Courses, C Standard Library, C Libraries, C Frameworks, C Research, C GitHub, Written in C, C Popularity, C Awesome List, C Versions. (navbar_c)

Design Patterns: Design Patterns - Elements of Reusable Object-Oriented Software by GoF, Awesome Design Patterns, Awesome Software Design, Pattern, Design, Anti-Patterns, Code Smells, Best Practices, Software Architecture, Software Design, Design Principles, Design Patterns Bibliography, C Language Design Patterns, C++ Design Patterns, C# Design Patterns, Golang Design Patterns, Java Design Patterns, JavaScript Design Patterns, Kotlin Design Patterns, Node.js Design Patterns, Python Design Patterns, TypeScript Design Patterns, Scala Design Patterns, Swift Design Patterns. (navbar_designpatterns)


© 1994 - 2024 Cloud Monk Losang Jinpa or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.


fluent_c_-_principles_practices_and_patterns_table_of_contents.txt · Last modified: 2024/05/01 04:47 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki