Kartik Agaram
Ivan Reese
Ivan Reese
Kartik Agaram
Ivan Reese
Ivan Reese
Ivan Reese
Kartik Agaram
Kartik Agaram
Ivan Reese
Ivan Reese
Kartik Agaram
Kartik Agaram
Ivan Reese
Ivan Reese
Kartik Agaram
Ivan Reese
Kartik Agaram
Kartik Agaram
Kartik Agaram
Ivan Reese
Kartik Agaram
Ivan Reese
Konrad Hinsen
07/01/2024, 6:20 AMIvan Reese
Beni Cherniavsky-Paskin
07/01/2024, 4:24 PMrect(x, y, w, h)
is one of the particular examples it attacks/dissects.
Would you agree order of statements is essential complexity (for your pedagogical goals) whereas order of (x, y, w, h) is incidental complexity?
Or do you lump both into same mental "it matters" bucket?
⢠Using named arguments and/or IDE hints/visualizations (a-la Bret) would make argument order clearer.
⢠Having defaults would allow you to start from rect{}
and learn things you can tweak one-by-one e.g. rect{x=40}
and so on...
https://code.world/ is a well-documented functional (haskell) drawing environment; it's not that order doesn't matter ā but that you explicitly say how to compose them.
⢠This gives a more principled way to label x,y,w,h: Instead of passing x,y treat them as separate translation: https://code.world/#P06ggNifxerLPWXTe_4vgmQ
⢠You can go further and eliminate even the rectangle(w, h)
arguments by starting from a (1,1) square and translating/scaling it: https://code.world/#P9QuT0QUN62BK0RmB1px5mw
⢠This still leaves x-before-y convention in many places. It'd easy enough to define translatedX(pic, dx)
etc. helpers to effectively name args one by one ā by I think that's going too far, (x,y) tuples are important mental construct.
⢠Order of r1 & r2
does matter if they overlap, try swapping here: https://code.world/#POHjNuz9Uu64FI9TAgTxhPg
(cf. Bret's section on "Recomposition"; CodeWorld is good at that š)Beni Cherniavsky-Paskin
07/01/2024, 4:44 PM|>
pipeline operator:
rectangle brown 40 200
|> moveDown 80
In CodeWorld's case, that gets painful enough that the guide has to teach how to read nesting early on (plus editor coloring paren levels): https://code.world/doc.html?shelf=help/codeworld.shelf#expressionstructure/nestingexpressions
@Ivan Reese will be amused they draw block diagrams, as something the student should imagine, while editor remains textual: ("the š° is a lie"?)Beni Cherniavsky-Paskin
07/01/2024, 4:46 PMcolored(translated(scaled(square, 12, 2), 4, 3), red)
but if they did this, one could read each transformation and its params together:
colored(red, translated(4, 3, scaled(12, 2, square)))
Beni Cherniavsky-Paskin
07/01/2024, 4:52 PMKartik Agaram
Kartik Agaram
Kartik Agaram
Ivan Reese
Konrad Hinsen
07/02/2024, 6:01 AM