Comments (2)
The journey I've typically used to explain this is:
- We know about dependency injection, when people take dependency injection to extremes they end up with too many parameters, they often extract a context object to contain them all (prompt discussion about global state, about the down-sides of God objects, ...).
- Context is a place to shove global-like data that we want to use a lot of places. But we generally shouldn't.
- Introduce
With
-prefixed functions (and maybe contrast with other persistent data structures / builders / ...) - Talk through
WithValue
with a user ID as an example - Talk through
WithTimeout
andDone
as just a library written usingWithValue
.
@bazmurphy had also encountered React's Context hooks which implement a similar pattern.
from immersive-go-course.
that is a good thought, IMO.
I am sure we must be using timeout somewhere. we certainly have material on the need for timeouts in the primer, don't we?
i think we could probably weave this into at least one of the exercises. maybe with some explicit demos of client cancellation as well, and a description of why that's useful.
from immersive-go-course.
Related Issues (20)
- Broken images
- Scrolling is really slow and jerky/jittery in Chrome on macOS HOT 1
- Intro transaction concept
- Replace "just run Postgres" with a more meaningful MySQL set-up in multiple-servers
- Prep: Make clear learning objectives and expected knowledge outcomes from How Computers Really Work reading
- Introduce preparing a post-incident review as part of troubleshooting HOT 1
- Write up example of a protobuf migration HOT 1
- Consider grouping workbooks by topic rather than style of work HOT 4
- Mark up projects with metadata HOT 1
- Mark up primers with metadata
- kafka-cron part 2 - put in a diagram of intended architecture
- Migrate projects, primers, and paths into the curriculum repo
- Put together an "intro to Rust" equivalent to our "intro to Go" in the prep HOT 1
- Evaluate intro projects for Rust
- Write up sample solutions to intro projects in Rust
- Write up build systems primer
- Write up intro to nix
- Write up "navigating Kubernetes" project
- Expand interface project "Implementing a custom filter" to explain filters/chaining/layering
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from immersive-go-course.