Skip to content

Commit

Permalink
Write introduction chapter (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
soareschen authored Apr 8, 2024
1 parent 6526ea7 commit 0c7205a
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 3 deletions.
2 changes: 1 addition & 1 deletion book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ authors = ["Soares Chen"]
language = "en"
multilingual = false
src = "content"
title = "Context-Generic Programming Patterns"
title = "Context-Generic Programming Patterns (DRAFT)"

[rust]
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion content/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
- [Logging Entry Types](./logging-entry-types.md)
- [Logger Delegation](./logger-delegation.md)

# Related Work
# Related Concepts

- [Object-Oriented Programming](./object-oriented-programming.md)
- [Dependency Injection](./dependency-injection.md)
Expand Down
46 changes: 45 additions & 1 deletion content/introduction.md
Original file line number Diff line number Diff line change
@@ -1 +1,45 @@
# Introduction
# Introduction

This book covers the design patterns for _context-generic programming_ (CGP), a new programming paradigm for Rust.

At its core, context-generic programming allows us to write _modular_ code that are _generic_ over different _contexts_.
Thoughout the book, we will slowly uncover what that really means.

## Work In Progress

This book is currently a work in progress. A majority of the chapter is yet to be written.
Please come back later to check out a completed version of this book.

## Scope of This Book

This book is written in the style of a reference material for readers with all levels of expertise.
As a result, it may not be as easy to understand for beginners who need a little more introduction
to more basic programming techniques in Rust.

A separate book will be written in the future, to provide beginner-friendly tutorials for learning context-generic programming.

## Chapter Outlines

The first section of this book, _Core Concepts_, will introduce core concepts of CGP.
We will learn about what is a context, and what are consumer and provider traits.

In the next section, _Basic Patterns_, we will cover the basic design patterns that enable us to write
context-generic code.

Following that, _Design Patterns_ will introduce general design patterns that are built on top of the
foundation of context-generic programming.

The section _Domain-Specific Patterns_ will cover use-case-specific design patterns, such as error handling and logging.

Finally, the secion _Related Concepts_ will compare context-generic programming with related concepts,
such as the similarity and differences of context-generic programming as compared to object-oriented programming.

## Contribution

This book is open sourced under the MIT license on [GitHub](https://github.com/contextgeneric/context-generic-programming-patterns).

Anyone is welcome to contribute by submitting [pull requests](https://github.com/contextgeneric/context-generic-programming-patterns/pulls)
for grammatical correction, content improvement, or adding new design patterns.

A [GitHub Discussions](https://github.com/contextgeneric/context-generic-programming-patterns/discussions) forum is available for readers
to ask questions or have discussions for topics covered in this book.

0 comments on commit 0c7205a

Please sign in to comment.