dashseat / understanding-lua

A visual narrative of programming within the Dashseat metaphor
Other
0 stars 0 forks source link

On basic I/O #18

Open stuartpb opened 6 years ago

stuartpb commented 6 years ago

Trello Cards and Comments from "Basic I/O" List

Let's talk output

I've now explained enough to introduce the last component you need to write practical programs that interact with the outside world

stdout appears behind me

I used to believe stdout was important because you need it to see results in actual programming, but the thing is - these comics are not following normal code. We can visually see any value I hold in my hands- we don't need to go into how to expose these values to the outside world until later.


I can make a comment in the early chapters, in which I sort of explain the structure of the book and the environment, how if the user wants to follow along, they can skip ahead to take a glimpse of the part where I get the print function, and then insert a print(thing) for any thing they want to see at a point in execution.


Also, stdin input appears on it (in a different color?) so things are less confusing

Let's also talk input

You often don't need input when you can just change your code, but while we're here, we might as well.

Stdin

Standard in is a typewriter. It has parts that are controlled by the io library functions, like an arm that eats the paper you've typed and puts it into work-space.