top | item 21293505

Coffee Is Hard

768 points| mrleiter | 6 years ago |stilldrinking.org

219 comments

order
[+] godot|6 years ago|reply
As a geek and a fan of 80s-90s PC games (not just Sierra but also LucasArts adventure games and so on), this was a super entertaining read on its own; but I also enjoyed some of these insights about life in general from it:

> Living is mostly a series of repetitive and unrelated tasks. It makes sense that the most tedious things to code are the tedious things that just have to be done. There are no life lessons or gymnastic skills involved in doing dishes, there’s no underlying theory of housework that will reveal itself after a thousand vacuum cleanings. Making coffee is a boring sequence of steps people feel stupid for getting wrong, even though they’re statistically doomed to screw it up now and then. The hard parts of of life are driving to work, eating properly, flossing, ....

Perhaps I found it particular insightful because I just became a parent a year ago. Prior to this, I thought I had optimized my life so well that most tedious work were gone from my life; with the peak being having switched to remote work and not having to even commute anymore.

Then I became a parent, and had to come to terms again with having to do a long series of repetitive and routine work every day -- washing bottles, dishes, changing diapers, etc. It was a bit of a cultural shock to my system since over the past 10 years I had slowly gotten used to / gradually removed or optimized aspects that are frictions / repetitiveness / tedious routines from my life; and suddenly it's 10x of it all coming back. Over the past year, I've come to realize this is what life is, which is exactly as the author said.

[+] monktastic1|6 years ago|reply
At the risk of sounding hippie, "tedious" and "boring" are emotional reactions to the chores, and not attributable to the chores themselves. We don't have to do that.

"Everything in life is miraculous. It rests within the power of each of us to awaken from a dragging nightmare of life made up of unimportant tasks and tedious useless little habits to see life as it really is, and to rejoice in its exquisite wonderfulness." ― James Branch Cabell, The Cream of the Jest

Not that I've remotely mastered it, but I think there's a lot of wisdom in there.

[+] DantesKite|6 years ago|reply
It's interesting how all the tedious tasks listed are a product of modernity. Vacuuming, driving to work, flossing, doing dishes, etc.

I wonder how repetitive life feels for humans who still have to hunt for their food.

Not to say that we should shift back to a hunter-gatherer society, but I wonder how much of the mundaneness of life is something we brought on ourselves and not actually an implicit part of existence.

[+] AdmiralAsshat|6 years ago|reply
This reminds me of Scribblenauts. There was an interview with one of the devs at the E3 before it was released and he discussed how much time went into the game simply to pad the internal "dictionary" and conjure up not just things, but also make sure that those things could interact with other things (e.g. "bread" should be able to interact with "toaster" to make "toast").

I don't remember if it was the dev talking about his own team, or if he was talking about players interacting with the demo, but he mentioned that some people were attempting to summon a list of ingredients (flour, eggs, sugar, milk, etc.) and throw them into a bowl and then into a heat source to see if they could make cookies within the game.

[+] gameguy43|6 years ago|reply
Amped to see Still Drinking on HN again.

If you enjoy devouring this guys writing, buy his book, “And Then I Thought I Was A Fish” (I think it’s the “novel” he references the game being based on?). I really really liked it. Link at the bottom of the original post.

The other book is just a collection of blog posts. It’s /okay/. But I really really liked ATITIWAF. The kind of book that makes you want to try your hand at writing.

—a random internet fan.

[+] icebraining|6 years ago|reply
Never read the book, but I'm a fan of his blog! I keep an excerpt of one of his posts pinned on my notes app:

"The only reason coders' computers work better than non-coders' computers is coders know computers are schizophrenic little children with auto-immune diseases and we don't beat them when they're bad."

https://www.stilldrinking.org/programming-sucks

[+] halleonard|6 years ago|reply
That book is so crazy good! I started reading and read it all the way through in one setting and then passed it off to all of my friends. Remarkable writing and I also felt it to be quite wise.
[+] caseymarquis|6 years ago|reply
Having enjoyed the article, it also reminded me why I never once finished making a game.

Instead of seeing the example code and thinking 'Ah, yes, that code gets something done in a straight-forward way.', I instead think, 'I'm pretty sure I could build a scripting engine and turn most of that code into ajax calls to json files. Of course, I'd then have to build an in-game editor which allowed you to modify the contents of the json files while playing the game with hot-swapping content. Huh, art? Plot? Fun? Oh, yeah, I guess I'll probably need those... eventually...'

Fortunately, trying (and failing) to make games led me to realize that I really love programming and building maintainable systems.

[+] jasonkester|6 years ago|reply
The Coffee part of this article resonates with me.

I have a stovetop espresso machine, and I'm constantly amazed at the new and ingenuous ways I come up with to mess it up. Making coffee before you've had your morning coffee is the great connundrum of our generation. Here's a short list of failure modes I've run up against:

  - Machine on stove, no water
  - Machine on stove, no coffee grounds
  - Machine on stove, completely empty
  - Coffee and water in machine, machine in refrigerator
  - Coffee grounds in water reservoir
  - Coffee grounds in brewed coffee reservoir
  - Brewing correctly, brewed coffee reservoir still filled with water from washing
  - Brewing correctly, head off to work
  - Brewing correctly, coffee grounds returned to microwave
That's just a subset, and amazingly I still come up with a new one every few weeks.
[+] jmiskovic|6 years ago|reply
The coffee part also resonated stongly with me, for a completely different reason :)

I spent last year thinking on how to implement a text-only simulation that could cope with just about any situation. Most of my models were mentally evaluated on this "simple" task of making coffee. The design I came up with (still to be implemented) is not code driven, but data driven. Instead of executing bunch of nested if-elses, I'd have a big list of tuples that contain <action, preconditions, reaction>. When action is performed upon object, this list is traversed. For each element, it's preconditions are compared to current world state. Based on this criteria the most suitable element is selected, and it's reaction is applied to modify world's state.

Your list could be used as preconditions for action of brewing coffee; each would produce different results ranging from nice coffee to yucky mud or broken machine. I'd like to include a nice built-in editor that could be utilized to quickly modify or add reactions, objects, or world state variables. I have most of it figured out but it's a lot of work to put together all the pieces.

[+] jdkee|6 years ago|reply
Set theory is your friend. :)
[+] alchemism|6 years ago|reply
There is a famous Zen saying (which) describes nothing-yet-everything about this:

“Before Enlightenment, chop wood and carry water.

After Enlightenment, chop wood and carry water.”

[+] bravura|6 years ago|reply
One day the Master [Joshu] announced that a young monk had reached an advanced state of enlightment. The news caused some stir. Some of the monks went to see the young monk [Kyogen]. "We heard you are enlightened. Is that true?" they asked.

"It is," he replied.

"And how do you feel?"

"As miserable as ever," said the monk.

[+] TurkishPoptart|6 years ago|reply
I really like this guy's writing and am grateful that he shared some of the coding challenges. I'd really like to be able to program games like this, and while I'm not a programmer, I'd like to learn how. In TFA he shares some of the code to check the coffee "state":

>'LOOK AT COFFEE MAKER': () => { if( State.scene.state.coffeedrunk ) { return "The coffee maker has done its job and mercifully drained the last life out of the old and savaged grounds." } else if( State.scene.state.brewed ) { return "The coffee maker has a fresh pot of what is likely coffee in it." } else if( State.scene.state.brewing ) { return "The coffee maker is brewing." } else if( State.scene.state.waterinmaker ) { return "The coffee maker has fresh water in it, and is ready to brew a terrible cup of coffee." } else { return "Makes coffee. Whodathunk? There's no water in it, and you don't have any fresh coffee, but the grounds already in there have only been used twice and can't be THAT moldy." } }

This is JavaScript right? Is that how these sorts of games are coded? Would learning this be the best way to go about creating games? Thanks.

[+] nebulous1|6 years ago|reply
If you want to create a game you could go with GameMaker or Construct 2 or Adventure Game Studio (if you want an adventure game like SQ1 that he's describing). These are applications that provide you with an interface you can interact with, along with an associated programming language in order to make things happen. So you can draw levels and place objects with your mouse, and then make them move with a script.

GameMaker has a non-programming method but I don't know how capable it really is. I wouldn't worry too much about what language you learn, at your stage it's more about the general knowledge of how to get things moving. Transitioning to another language at a later point won't be difficult.

[+] throwaway66920|6 years ago|reply
When you think about game design you have two big buckets. Writing code to make mechanics work, and writing code to make new content. This kind of game is almost entirely the latter because it’s not much more than handling one off edge cases and is very simple.

I would recommend using https://love2d.org/ to get started. This is a simple language built around a 2D game engine with (I think) many examples to follow

[+] brians|6 years ago|reply
I’d start without the animations, in something like Inform 7: http://inform7.com/

It’s easy to learn small things, reasonable to scale to harder things, and the award winning games regularly publish their sources—so you can copy and tweak and learn.

[+] whatshisface|6 years ago|reply
It looks like JavaScript to me. Yes, these games are usually coded in scripting languages like JS or Python, even back in the day they were programmed in custom scripting languages running on the engines of yore. Finally, yes, these kinds of games are a great way to learn programming because they map very well on to basic control flow constructs (if, else, while) and don't usually require additional computer science knowledge.
[+] pugworthy|6 years ago|reply
Not sure why this isn't handled in some kind of data-driven way, rather than a bunch of one off code.

The truth is, the author is coding an irrational and illogical system, and what this is basically is a big old set of special cases.

But then keep in mind the whole piece is satire.

[+] aidenn0|6 years ago|reply
As an example of one of the more notorious puzzles in the Sierra games of yesteryear, in Space Quest, you have a sand skimmer (think Luke's sand speeder).

When you get to where you are going, you need to sell it for money. If you get out without removing your keys, it is stolen. Then someone offers you enough money to continue on in the game. If you say yes, then much later in the game you die because you don't have a jetpack. If you say no, they offer to throw in their old jetpack. There are literally no hints that a jetpack would be related to selling your skimmer. You just have to reload old saves and try random things until you get one. And hope you have enough saves that you didn't overwrite one from before you sold the skimmer, or you need to start the whole game over.

[+] SamBam|6 years ago|reply
Having played most of the Sierra and LucasArts games when I was much younger, I feel, though cannot confirm, that there was a shift in these kinds of games such that you couldn't actually progress too far beyond a fail state.

That is, by about Space Quest II or III, you could still take an action that would lead to your death within a minute or so, but you could no longer take actions that would lead you to dying/being unable to finish many, many scenes later.

Can anyone confirm this?

And I feel like the later LucasArts games (Day of the Tentacle, etc) you could never actually be in a fail state.

[+] raldi|6 years ago|reply
This is a major piece of the linked article.
[+] password1|6 years ago|reply
It was so well written that he made me want to play his purposefully frustrating game and I'm still disappointed he didn't provide a link to download it.
[+] whatshisface|6 years ago|reply
The first puzzle is the search for the game itself.
[+] nateburke|6 years ago|reply
“You are the master of your universe, and yet you are dripping with rat blood and feces. Your enormous mind literally vegetating by your own hand. I have no doubt that you would be bored senseless by therapy, the same way I’m bored when I brush my teeth and wipe my ass. Because the thing about repairing, maintaining, and cleaning is it’s not an adventure. There’s no way to do it so wrong you might die. It’s just work. And the bottom line is, some people are okay going to work, and some people … well, some people would rather die. Each of us gets to choose.”

—the psychologist from ‘Pickle Rick’

[+] SamBam|6 years ago|reply
Always pining for more adventure games that remind me of the Sierra/LucasArts games of my youth. Can we start a thread here of great modern examples?

I recently played Machinarium, and enjoyed it a lot. My wife and I played it for many evenings on the couch, and computer games are not her thing at all.

I'm finishing up Infamous Machine on my Android phone. It's a fairly silly, small game, but a direct homage to LucasArts games like Day of the Tentacle.

[+] ergothus|6 years ago|reply
> Most treasured memories are agonies that won’t get out of the mind and have to get turned into a character-building story to maintain sanity,

My world is changed by how obvious yet insightful this is.

[+] deckar01|6 years ago|reply
Waiting for a Haskell programmer to explain why this is an artifact of procedural languages and that making coffee should be abstracted as the death of coffee caused by hot water.
[+] phlakaton|6 years ago|reply
Coffee is just a fixpoint of the coffee-maker state transition monad; what's the problem?
[+] platz|6 years ago|reply
I think you're confusing Haskell with the second law of thermodynamics and that the universe started in an extremely low entropy state resulting in the arrow of time which causes the coffee to do it's thing
[+] zem|6 years ago|reply
they'll only explain if you force them to
[+] deng|6 years ago|reply
I really recommend the author's book "And then I thought I was a fish". Not only is it incredibly funny, in my opinion this is one of the best descriptions of a drug-induced psychosis out there. It is really pretty rare that someone can remember that much from such an episode and also has the ability to put it to paper.
[+] timClicks|6 years ago|reply
I still regret that I was never able to finish any of those games. Leisure Suit Larry, Police Quest, Space Quest and others. I poured hours into them and never got to the end. The worst was Kings Quest V. I really wanted to get that one, but I'm still left with not much more than regret, guilt and anger.
[+] 40four|6 years ago|reply
We played through Kings Quest (V? I can't remember) as a class when I was in grade school. My math/ science teacher had a copy and would let us play for a few minutes at the end of the day after assignments were done.

We did eventually beat it after much trial and error, but only with the help of a cheat sheet she had printed off :) I do remember it being brutally hard.

[+] acomjean|6 years ago|reply
Adventure game frustration was solved, and used to make some classics.

https://grumpygamer.com/puzzle_dependency_charts

some adventure game puzzles became way too obtuse to be fun.

https://www.oldmanmurray.com/features/77.html

[+] shurcooL|6 years ago|reply
This seems like a high quality article and has many upvotes, but I found it hard to read, and unfortunately ads made it even harder, so I couldn't get through it. I wonder if I'm in the minority because I don't use an ad blocker?
[+] pavel_lishin|6 years ago|reply
Oh my god, it's so bad with the adblocker disabled. Does the author know?
[+] rsync|6 years ago|reply
"There are no life lessons or gymnastic skills involved in doing dishes, there’s no underlying theory of housework that will reveal itself after a thousand vacuum cleanings."

This is false.

Doing dishes can involve gymnastic skills at any moment and the deepest truths of life, the universe - and everything - can be found in the simplest of chores.

[+] ctdonath|6 years ago|reply
I'd be happy to articulate the hard way to make a really good cup of coffee, starting with ordering green coffee beans and proceeding thru barista tools few are familiar with. (Might take a while to write.) Plenty of ways for the process to go wrong, including lethally.
[+] bluejay2387|6 years ago|reply
Take a look at rules engines and Expert Systems technology. Its a more declarative way to handle complex logic that allows you to state facts and let a inference engine handle the nested nature of dependent logical conditions. It will decrease the amount of work needed to code this part of your game. With your current approach you end up in the logic programming version of Node's call back hell before we had tools like async await. As an aside, I run into developers taking the same approach with business logic in enterprise apps all the time -- with the same consequences.
[+] erikpukinskis|6 years ago|reply
Callback hell is easily avoided by naming callbacks.

Async/await has its own footguns, except they’re so difficult to debug that you need static analysis tools (Typescript or ESLint) to use them safely.

It’s one of that most special class of APIs that let you add a bug in one part of the system (e.g. forgetting an await) that causes a totally different part of the system to fail inscrutably. (Although really it’s Promises that unlock this ability, but potato/potahto.)

Callbacks are easily debugged with just a normal JavaScript interpreter.