hackworthltd / primer-app

Primer's React frontend application.
GNU Affero General Public License v3.0
4 stars 0 forks source link

Tree reading order guides #85

Open dhess opened 3 years ago

dhess commented 3 years ago

(I just had a thought and want to jot it down before I forget. This is not yet fully fleshed out.)

It occurred to me that we as programmers have an implicit understanding of how to "read" trees — where to start, where to go next, etc. But a beginner will probably look at a tree and have no idea where to start, or in what order to let their eye visit the nodes.

We should think about drawing animations that show the reading flow through the tree in various situations. These might be different orders depending on whether you're looking at a type tree, an expression tree, different kinds of expression trees (e.g., lambda definitions vs function applications), etc.

annedino4 commented 3 years ago

I agree. Before we implement the animations, should we consider making the tress more readable for beginners? They can actually read most of the trees except match and function application:

Some suggestions for rendering the trees, I know there might be some tradeoffs of representing the "correct concept", what do you think?

Match:

match2 match1

Function application:

FUNCTION APPLICATION DESIGN
dhess commented 3 years ago

OK, let's explore rendering match trees in #88.