Skip to content

Instantly share code, notes, and snippets.

@davidbella
Created September 24, 2013 03:02
Show Gist options
  • Save davidbella/6679856 to your computer and use it in GitHub Desktop.
Save davidbella/6679856 to your computer and use it in GitHub Desktop.
Alien Sandwich
1. Place the plate in front of you, such that the concave face of the plate is pointing up
2a. The loaf of bread is the plastic packaging containing the soft spongelike rectangle. The bread is already sliced, meaning there will be several individual slices within the packaging.
2b. Hold the loaf of bread such that the packaging is pointing up so that the bread does not fall out.
2c. Remove any plastic pieces that are keeping the plastic sealed around the loaf of bread.
2d. Open the plastic packaging and remove two slices of bread from the top of the loaf.
2e. Optionally reseal the packaging on the loaf of bread
3. The knife is the long, thin, metal object. This will be used to transfer both the peanut butter and jelly onto the bread slices. More on this soon.
3a. The knife has two ends. One end is to be held in your hand, while the other end will be used to make contact with the peanut butter or jelly while transferring it to the bread.
4a. For each of the two cylindrical containers (one named "Peanut Butter", one named "Jelly")
4b. The container has two fundamental pieces: a base, containing the food, and a top, which is used to seal the food inside.
4c. Hold the container with the top pointing up and unscrew it. This will involve holding the base with one hand, holding the top with the other hand, and then rotating the top counter-clockwise in relation to the base.
4d. Hold the knife by the handle and dip it into the base of the container. The objective here will be to grab and lift some amount of food out of the container and onto the knife. The amount is largely based on your preference, but a good starting point will be about an ounce or two.
4e. If there are two unused pieces of bread, either one will do for this next step. If there is one piece of bread left, it is often preferable to use that one.
4f. Apply the food to your previously chosen slice of bread. This will involve using the larger, flatter side (either of the two sides) of the slice of bread and spreading the food out onto it using the knife. Usually a thin covering is all that is needed, however, feel free to apply any quantity to your own preference. Try to cover the entire surface area of the chosen side of the slice of bread.
5. Take the two slices of bread and put them together in such a way that the two pieces of bread are stacked together, and the peanut butter slice and the jelly slice are facing inwards towards each other.
Meta -- Just a few of my thoughts here, since I am going to write them down in my notes anyway, I figured I might as well include them here.
- I felt it was necessary to explain the orientation of the physical objects. The top of the plate, jars, and bread seemed important so we don't open jars upside down, etc.
- It was strange explaining the reasoning behind something like having a "base" to hold the food, and a "top" to seal it in
- Describing the right quantity of peanut butter or jelly took some thought, and even then trying to describe the "thinness" of it on the slice of bread.
- I feel the Perl coming back out in me with all of section 4 - I was a really big fan of using foreach as much as possible.
- "Fixing" some of the description in the foreach section. I wanted to make sure you use either slice first, then use the remaining, unused slice second.
- Spreading peanut butter or jelly on the correct surface of the bread, and only on one side, and then putting the correct surfaces together was an interesting thought.
- As someone who worked with less technical people on business related logic a lot, I always had a very high appreciation of my one coworker who had a gift for describing the business logic very, very concisely. I always preferred working with her as opposed to those that were much more ambiguous. It was interesting to put myself in a bit of a role reversal here and try to be the one describing the "business logic" to the alien (computer/programmer).
@gsaltintas
Copy link

Nice example, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment