Permalink
Browse files

## BV deep dive: learnable programming

Did some good reading and writing this morning! As ususal, I wrote much more than I read. Fun fun!
  • Loading branch information...
stevekrouse committed Jan 6, 2018
1 parent 33cb6ce commit e27cee9c7b1d176e7e49d55f639d4235ba16630d
Showing with 205 additions and 34 deletions.
  1. +1 −1 _data/git-log.json
  2. +52 −0 essays/customer-support.md
  3. +59 −0 essays/learnable-programming.md
  4. +93 −33 notes/bret-victor/learnable-programming.md
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,52 @@
---
title: Customer Support
---
# Customer Support
## How important is interface design
Sometimes I wonder how important interface design is. As Paul Chiusano says, learning a difficult but powerful interface is a one-time cost. So what's the big deal?
## Spirit and Amazon
Recently I've spent a lot of time on the phone with customer support, first with Spirit airlines, and then with Amazon.
In both cases, the requests I made were fairly straight-forward. They were of the "my flight/package was cancelled/lost and I'd like to reschedule/reorder it" variety. In the Spirit case, this required me to stay on the phone for an hour and then have a fustrating conversation with someone in broken English for 20 minutes. In the Amazon case, I was on hold for only 2 minutes and then on the phone for 10.
But if you think about it, rescheduling a flight or re-ordering a product that was lost are very similar activities to schedule a flight or ordering a packing in the first place. And Spirit and Amazon both already have interfaces for doing that. Yet in this error case both of their interfaces fell short: Spirit actually had a bug in their interface which was supposed to let me do this action, whereas Amazon's interface didn't even try to do it. It simply said, "give us a call."
So then I called customer support, and spend time on the phone, instructing a human to press buttons on a computer for me.
## The internal interface
Here's my first question: **what did the customer support rep's internally-facing interface look like?**
Did it look like my interface to amazon.com, but instead of "call us for this problem," it displayed the interface to solve that problem?
No, we can be pretty certain it didn't look like that.
We can also be pretty certain that this rep wasn't writing SQL queries directly on Amazon's database. There's an interface somewhere in the middle that Amazon's internal engineers hacked together to allow the reps to do things that normal users cannot.
Here's my next question: **why not simply allow users to do those things?**
That is, I don't call up customer support every time I want to buy a book on Amazon. That whole point of buying online is that I can do things myself, without talking to anyone. So why don't we continue in this vein and allow our customers to do what our reps do?
Which brings me to my third question: **does the reps interface allow them to do things that they _wouldn't_ want users to do?**
We can be pretty sure the answer here is yes. There are two different types of actions the rep can take that the user cannot:
1. Discretionary actions, such as giving a refund for an order that never arrived but that the system says arrived.
2. Rare actions, such as sending a free replacement for a package that the system knows has been lost.
If we had a tool that drastically decreased the cost of interface-design, we could categorically solve class 2 problems (except maybe for old people who can't learn even intuative new interfaces).
And if you dream really hard, you can even imagine a tool that would solve class 1 problems. Think about a tool that would seemingly allow you to do any action on Amazon.com but if you don't have the authorization to do it, it would somehow display that your constructed action is illegal, and possibly explain why. Then there could be a button that you click such as "request permission" that inclues a textbox where you explain why you'd like to be able to perform that action. Then a rep merely can approve or deny your request. If it's denied, *then* you can call.
## The third kind of action
One final note. A lot has been said (TODO link needed) about social engineering customer support reps to provide sensative customer information that will allow one to hack into another's account. This is because there is a third category of customer support action that I did not list above:
3. Actions that neither the customer nor customer support rep should ever take.
We all know that the internal customer support interface has many of these actions available. You may blame training or hiring if these actions are taken by reps. But I blame the interface.
@@ -0,0 +1,59 @@
---
title: New learnable programming essay idea
---
# New learnable programming essay idea
* TOC
{:toc}
This article was started from [the notes](/notes/bret-victor/learnable-programming) of a re-reading of Learnable Programming by Bret Victor.
Here's the framing. Let's start from first principles.
human <-> interface <-> computer.
Humans want to make things with comptuers. In order to make something you need to have a model of how it works in your head. This model needs to take into account technological realities:
* proccessor speed
* storage
* network speed
* computational efficiency
However, it doesn't neccesarily mean that you need to understand these realities deeply. Simply that your model helps you account for them. That is, we cannot abstract beyond the capibilities of computers.
## Interface for humans
On the one extreme to the left, you could make an interface building upon models that people already have in their heads. This is why Microsoft Word is so successful. The cursor is much like the tip of a pencil and the page is much like a physical page. The mapping is clear.
## Interface for machines
On the other extreme to the right, you could simply have the human learn how the computer works, starting from electrons up through NAND and NOR gates, to proccessors, binary, Assembly, and C. This epitomizes Bret's Alan Perlis quote, "To understand a program, you must become both the machine and the program."
## In the middle
In the middle, you have powerful models for thinking, which take technological realities into account.
Microsoft Excel. Unless you're coming from an accounting background, the grid model is new to you. (Side note: it wasn't until I learned SQL that I learned that properties are at the top and rows are entities. This array of dictionaries metaphor is quite powerful. I imagine people who grow up with Airtable or Fieldbook will learn those powerful ideas seamlessly.) There are two fascinating metaphors in Excel that are incredibly easy to pick up:
1. *Underneath* a cell can be a formula that produces it. The metaphor of "under the hood" is easily assimilated.
2. *Dragging* a formula iterates it over data, updating the references as it goes. Very easy to pick up. Then if you don't want certain references to update as you drag, you learn about the `$` operator. It's a great example of doing the commong thing automatically and letting you ask for a special case when you need it.
## Actually, there are two dimensions
1. Familiarity of model (is it a human model or comptuer model)
2. Power of model (does it enable powerful ways of thinking)
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-103157758-1', 'auto');
ga('send', 'pageview');
</script>
<script repoPath="stevekrouse/futureofcoding.org" type="text/javascript" src="/unbreakable-links/index.js"></script>
@@ -52,13 +52,13 @@ I'm really getting revved up with the idea of video games, because they align th
### Environment / langauge goals
While he starts with the environment, I'd rather start with the langauge, or in other words, *start from the user who doesn't know how to code*.
While he starts with the environment, I'd rather start from *the user* who doesn't know how to code.
I believe the core challenge of learning to program is: **the assimilation of models.**
Bret calls this: "identity and metaphor -- _how can I relate the computer's world to my own?_")
In order to be able to make anything, the user needs to have a ever-improving model of how their tools behave. For example, think about about a child assimilates the model of a hammer. It's clear from the way it's shaped from which end to pick it up. Then when you pick it up, you immediatley notice that it's much heavier on one side. And of course you've seen others people use hammers, so the model snaps right into place: swing this where I want BAM.
In order to be able to make anything, the user needs to have a ever-improving model of how their tools behave. For example, think about about a child assimilates the model of a hammer. It's clear from the way it's shaped from which end to pick it up. Then when you pick it up, you immediatley notice that it's much heavier on one side. And of course you've seen others people use hammers, so the model snaps right into place: swing this near where I want it to make a BAM.
#### Powerful mental models / ideas
@@ -71,62 +71,122 @@ Thus we want to help students assimilate *powerful* mental models, what Seymour
These are the two-sides of the *composability* coin. As we've learned from functional programming, composibility is a very powerful idea. It allows us to do *top-down design*, where one decomposes a problem into its subproblems in such a way that solving the sub-problems automatically solves the solution -- because you've pre-composed the sub-problems properly before solving them.
So now that we know composability is a powerful idea, how do we help a new user assimilate it?
TODO
So now that we know composability is a powerful idea, the question to ask is how do we help a new user assimilate it? In his article, Bret compares LOGO and Hypercard to ProcessingJS to show how limited it is on both of these fronts. However, I would be excited by a more thorough discussion on how to build intuitively for decomposition and recomposition.
Other powerful mental models/ideas include:
* referential transparency (partitioning side-effects) TODO
* referential transparency (partitioning side-effects)
* type system
* TODO
#### Technological realities
* proccessor speed
* storage
* network speed
* computational efficiency
TODO
#### Powerful ways of working
Additionally, we know about some powerful ways of working:
* creating by reacting
* creating by abstracting
* small steps
* refactoring
* creating by reacting to what's on the screen
* abstracting similar code via variables/functions
* working in small steps
* refactoring code to be more readable, faster, etc
* version control workflow branching
* planning a project, estimating time, github issues, prioritizing
#### New learnable programming essay
## The features are not the point
> We often think of a programming environment or language in terms of its features -- this one "has code folding", that one "has type inference". This is like thinking about a book in terms of its words -- this book has a "fortuitous", that one has a "munificent". What matters is not individual words, but how the words together convey a message.
Love it!
## Read the vocabulary
> Thought experiment. Imagine if you bought a new microwave, took it out of the box, and found a panel of unlabeled buttons. Imagine if the microwave encouraged you to randomly hit buttons until you figured out what they did.
Great metaphor!
The demo of hover over for documentation inline is so beautiful. Makes me wonder if we could add that to WoofJS... In Woof, the sprites are given named parameters, so that's ok. However, we could probably improve the understanding of control structures if we added side-notes about them. Currently we add those notes inline in comments which is just awkward. It would also be nice if WoofJS had live update so users could see in real time the effect of their changes - it's a bummer we reload the entire page on any change.
## Follow the flow
Ah, this section is criticizing what I just mentioned, the immediate update, in addition to not showing incremental steps.
> People understand things that they can see and touch.
For-loops are the worst. I'd definitely vote to replace them with iterating over an array. Or even a while-loop if neccesary.
Allowing the programmer to scrub through the steps is great. In particular it allows them to see how/why things loop around. This would probably entirely eliminate one of the first questions that almost every Scratch student has of how forever-loops work. This is a big deal. The more of those questions we eliminate, the less need there is of trained teachers, the more the environment can scale.
Of course, I am excited with functional programming ideas, which have a less-intuitive model of flow. Yet it enables higher comprehension and more powerful thinking once you do understand it. I think the Elm time travel debuggers and the CycleJS devtools diagrams point in interesting directions.
### Make flow visible
Really cool section! Love the metaphor to driving directions. Also love the way he abstracts over iterations of a loop. He's totally on point that this could be super helpful when you're curious when the loop goes into an inner-if statement.
### Make time tangible
This is cool too! Giving users another way to slice a program. See it from another angle.
However, there feels like a slight arbitrary-ness to some of these examples. That is, I wonder if there's a way to build a langauge in which it's easy to build this visualization tools on top of so that people could build and publish these just like they build and publish libraries and frameworks.
### Make time visible
Beautiful! This is allowing us to see the path of an object all at once on the screen. Very reminiscent of the Ladder of Abstraction and also the Elm mario time travel debugger (which was probably inspired by this essay).
### Summary — Follow the flow
> The environment can make flow tangible, by enabling the programmer to explore forward and backward at her own pace.
This is key. Time travel debugger.
> The environment can make flow visible, by visualizing the pattern of execution.
This is also key. CycleJS devtools diagram.
> The environment can represent time at multiple granularities, such as frames or event responses, to enable exploration across these meaningful chunks of execution.
Again, this sounds to me like add-ons that the community could build given a really solid underlying structure. A structure that Conal Elliot would build. Perfect abstractions.
### FRP Scratch
I'm reading this essay in part in terms of a new programming environment for children that I've been thinking about recently. Sometimes I call it an FRP Scratch. It's like Scratch but with a more functional reactive runtime, so as to enable time travel debugging and also a CycleJS-like diagram of the code.
Yet my conversation with Jason Brennan is making me rethinking directly copying Scratch as much as I was planning to. That is, there's a lot of really interesting metaphors and abstractions outside of Scratch that haven't been explored. For example: direct manipulation. But of course direct manipulation, while intuative, does seem to limit the power of the comptutational abstractions. Things to think about!
## See the state
Here's the framing:
> The computer somehow drew that picture, so the computer must have calculated all those scaleFactors itself. Are you seriously recalculating them in your head?
>
> ... setting a "breakpoint" ... is like monitoring traffic on the freeway by setting up a barricade ... writing to a "console" ... is like figuring out where your dog goes during the day by following the trail of droppings.
>
>
> The entire purpose of code is to manipulate data, and we never see the data. We write with blindfolds...
> ... Spreadsheets rule because they show the data.
> ... Edward Tufte has one primary rule... Show the data.
> ... the number one thing you can do is to show the data.
human <-> interface <-> computer
Beautiful. I'm sold. Let's show the data!
Humans want to make things with comptuers. In order to make something you need to have a model of how it works in your head.
### Show the data
On the one extreme to the left, you could make an interface building upon models that people already have in their heads. This is why Microsoft Word is so successful. The cursor is much like the tip of a pencil and the page is much like a physical page. The mapping is clear.
This becomes easier when you can step through time easily.
On the other extreme to the right, you could simply have the human learn how the computer works, starting from electrons up through NAND and NOR gates, to proccessors, binary, Assembly, and C. This epitomizes Bret's Alan Perlis quote, "To understand a program, you must become both the machine and the program."
### Show comparisons
In the middle, you have powerful models for thinking, which take technological realities into account.
![screenshot 2018-01-06 at 10 49 33 am](https://user-images.githubusercontent.com/2288939/34641266-5f0962fc-f2cf-11e7-91e6-231235e00144.png)
TODO looks like there are two dimensions here:
Woah. I forgot about this. Beautiful...
1. Familiarity of model (is it a human model or comptuer model)
2. Power of model (does it enable powerful ways of thinking)
And then when I was mesmerized by that plot, he hit me with the knockout punch:
Microsoft Excel. Unless you're coming from an accounting background, the grid model is new to you. (Side note: it wasn't until I learned SQL that I learned that properties are at the top and rows are entities. This array of dictionaries metaphor is quite powerful. I imagine people who grow up with Airtable or Fieldbook will learn those powerful ideas seamlessly.) There are two fascinating metaphors in Excel that are incredibly easy to pick up:
> Is it possible to understand a loop with, say, thousands of iterations, without drowning in thousands of numbers?
>
> Yes -- there is an entire field of study devoted to depicting large amounts of numbers. To visualize this data, we can use all of the standard techniques of data visualization.
1. *Underneath* a cell can be a formula that produces it. The metaphor of "under the hood" is easily assimilated.
2. *Dragging* a formula iterates it over data, updating the references as it goes. Very easy to pick up. Then if you don't want certain references to update as you drag, you learn about the `$` operator. It's a great example of doing the commong thing automatically and letting you ask for a special case when you need it.
And then he turns the table plot to a graph. And I died. Holy crap I really need to read this Tufte guy. Looks liek Amazon lost the package of his book in transit... Let me call them now.
### Eliminate hidden state
I love how he explains the two ways to eliminate hiddden state:
1. Make it non-hidden
2. Show it
<script>

0 comments on commit e27cee9

Please sign in to comment.