I think the real question is whether you're allowed to optimize by working on remembering everything the first time, or whether it's a given that you'll forget, and you are trying to optimize the process that handles forgotten items. The author hasn't really framed the problem fully.
It's why recipes are so good! I forget to make them also for things I make frequently, but then when I stop making the thing, a few years go by, and I'm like... wish I'd wrote a recipe for that.
Save the overhead of looking into the fridge. Go straight to the grocery store, buy it all. Eat, repeat, sleep. Come home and realize you're not out of eggs and bacon. Store this information in the session. Eat, repeat, sleep. Realize that session data is cleared during the nightly reboot. Repeat.
Optimize for time? Probably my local diner. Optimize for cost? Probably my local diner (assuming I don't want this every day). Optimize for taste? Probably my local diner. Optimize for cleanup? Definitely my local diner.
I would use whatever is available at home to serve my breakfast needs. Question the requirements. But pay attention to them so I can plan accordingly next time I go to the store.
Alternative answer: do just as described in your scenario, but pay close attention to, and find deep meaning in, every moment. No time wasted, perfectly optimized.
Dependencies between ingredients can be precomputed while at the store (by the character). However, which eggs you buy don't change _which_ butter you'll use next.
In waterfalls, the dependencies between data can cascade (fetch A may contain info about what to fetch next, 1+N problem).
Create a store “service” and keep ordering things when you need them. Problem: the store has to be colocated in your house or you end up waiting for instacart each time. But at least you can keep working while people are fetching ingredients. Oh, and it costs money.
Gather bacon, eggs and butter the night before. Put them on a George Foreman grill next to my bed. Put the grill on a timer so it turns on a few minutes before my alarm. I wake up and eat a delicious breakfast in bed.
Congrats. I didn't see a lot of vegan food in ordinary stores in the US and assumed that context. Canada seems well supplied.
I can get a lot of vegan foods in nearby stores here in Poland but yeast flakes are a bit hard to get. And scrambled tofu with onion doesn't really need them anyway.
I live in a rural area, and the closest town has those things. Toronto, where I was born, is my closest big city (1.5 hours by car) & it has loads of vegan everything.
Just in time delivery of ingredients via drone, wired into an Alexa or Home device, or tuned into AI and IOT Fridges which know your meal plan and pre-order ingredients to arrive at your window as you're getting ready to cook.
Before doing anything, stare into the fridge for at least 45 seconds.
Make The List (butter? bacon? eggs? dignity?).
One trip only, no bonus, suffering trips.
Multitask: fry bacon while scrambling eggs. Become an unstoppable force.
Never trust the fridge again.
i somehow feel like there’s a trick here…but i’ll take a stab anyways. the eggs, the butter, the bacon, these are all nice to haves. the real problem is hunger. what is already in the fridge that can solve the problem?
Move to a farm and produce infinite resources.
Alternative, make yourself a prevention alarm that makes sure you always have what you need.
The way I see it is more about preventing that to happen rather than improving the process, but pretty sure is not what you are looking for haha
So I guess this is an analogy to repeated server requests from fetch waterfalls in React.
The obvious answer of „buying the groceries in advance“ would then be the analogy to RSC.
I wonder what a good analogy for a localfirst approach would be.
This feels like it’s about lifting fetch state and not chasing waterfalls.
That said the tech escape of starting a farm with pigs for bacon, chickens for egg, and cows milk to churn butter is a sneaky fun option. I guess this would be the local first option.
By the time I went for bacon, I would have died from starvation. But that begs another question: how would you pre-pack things while still allow for customization? Makes me things you cannot pre-pack *or ship* without constraints.
I think this is way I'm handling the task right now. No checklist, no preparation. Just jump on to code directly, and will ask for unclarified things when realizing, can not imagine the cases from beginning, etc...
Moving to the store only optimizes the distance-to-the-food problem, you‘d still need to go to multiple isles at random to get what you want. You also need to optimize for storage, which in this case is the fridge. An empty fridge is not optimized.
Assuming this is a daily occurrence, start a farm on your property with livestock. That way, you don't have to walk to the store to get butter, eggs, or bacon 🧠
If the store is close and I'm forgetful why have a fridge?
A fridge is worth apx £200, eggs/salted butter last for 2 weeks at room temp (UK, not US). Bacon doesn't last but I can eat a whole pack of bacon.
Full meal with a pack of bacon ~£4. ~$1.30 without.
Comments
You don't have to eat bacon today!
we have a supplier deliver stuff to our home every 2 weeks and get rice enough for a whole year at once
[No eggs]
Find something else to eat, get eggs for tomorrow.
Enjoy them.
After that, not being so hungry,
you go to the store,
and dont feel rushed.
And you get it right for the next meal 🍜
They make breakfast at the grocery store and send me the ingredients that they use as they figure out that they’re needed.
In waterfalls, the dependencies between data can cascade (fetch A may contain info about what to fetch next, 1+N problem).
This seems like a suboptimal optimization.
But a good show, and worth watching.
sorry, i was violently pulled away from my keyboard before i could finish my sentence
I can get a lot of vegan foods in nearby stores here in Poland but yeast flakes are a bit hard to get. And scrambled tofu with onion doesn't really need them anyway.
I wanna try this one
https://www.loveandlemons.com/carrot-lox/
I'll accept my VC funding now.
Before doing anything, stare into the fridge for at least 45 seconds.
Make The List (butter? bacon? eggs? dignity?).
One trip only, no bonus, suffering trips.
Multitask: fry bacon while scrambling eggs. Become an unstoppable force.
Never trust the fridge again.
Alternative, make yourself a prevention alarm that makes sure you always have what you need.
The way I see it is more about preventing that to happen rather than improving the process, but pretty sure is not what you are looking for haha
Get pancakes too.
The obvious answer of „buying the groceries in advance“ would then be the analogy to RSC.
I wonder what a good analogy for a localfirst approach would be.
Store=Server
Eggs,Butter,Bacon=Components
right? RIGHT?
🫶
That said the tech escape of starting a farm with pigs for bacon, chickens for egg, and cows milk to churn butter is a sneaky fun option. I guess this would be the local first option.
also this has nothing to do with your post but TIL there's a `.mov` TLD lol
And order brekky - and a cuppa !!
A fridge is worth apx £200, eggs/salted butter last for 2 weeks at room temp (UK, not US). Bacon doesn't last but I can eat a whole pack of bacon.
Full meal with a pack of bacon ~£4. ~$1.30 without.
Sell the fridge, eat 50-150 meals.
Looking out of the kitchen window at the beautiful waterfall in my backyard, I go over the recipe in my head.
Do we have butter? Not in the fridge! I send my second girlfriend to the store to get butter.
This way I can wait on all of them simultaneously, I'm a genius.
"Beep, beep, beep". I wake up. It was all a dream. I don't have three girlfriends, I'm not living in a house with a waterfall. I live in the store.