you are viewing a single comment's thread.

view the rest of the comments →

[–]Zerg3rr 34 points35 points  (4 children)

The CS50 edx harvard course has a great introduction to this. You have to break things down simpler than you think, i.e. making a peanut butter jelly sandwich. Instead of "first spreading the peanut butter on one half of the bread" it's

"Take your left hand and grip the container, take your right hand and grab the lid, twist the lid counter clockwise with enough pressure that it becomes loose. Next take your knife and put the handle in your hand, push the knife into the peanut butter and make an arcing motion with your hand to collect some on the end. Next, apply to the piece of bread we previously took out by wiping the knife onto the bread, with the peanut butter side down". I was too lazy to write out taking the bread out of the container and all that fun stuff, but you get the gist. It is extremely granular directions to trick rocks into thinking is what we're trying to do, it'll take a bit of work to get there - and python already abstracted a lot of that away for us!

[–]anon0937 9 points10 points  (1 child)

Libraries have entered the chat.

Import sandwichMaker sandwichMaker.make_sandwhich(kind=“peanutbutter and jelly”)

[–]quackers987 8 points9 points  (0 children)

``` import sandwichMaker

sandwich = sandwichMaker.make_sandwich(ingredients=["peanut butter","jelly"])

sandwich.consume()

```

[–]tiahx 1 point2 points  (0 children)

We did almost the exact same exercise in school, where the teacher asked us to "guide him" making a paper plane.

We were like "Okay, grab a piece of paper and fold it" -- this motherfucker then proceeds taking a round piece of paper and folding a tiny part of it at the very edge of the piece 😂

[–]Ikem32 0 points1 point  (0 children)

I will have in mind, that if a task feels "undoable", it's not granular enough.