15:46 

bret victor троллирует khanacademy

Shrddr
аптека улица фонарь
A simple program:



The third line declares a variable named "scaleFactor", which varies with each iteration of the loop.



Take a moment to look at that line, and think about these questions:

  • What values does scaleFactor take on? 1? 100? -1? pi / 2?

  • What is scaleFactor at the beginning of the loop? At the end?

  • How does scaleFactor change over the course of the loop? Linearly up? Linearly down? Does the change get faster or slower?

Wait. Wait a minute. Were you trying to answer those questions by doing arithmetic in your head? The computer somehow drew that picture, so the computer must have calculated all those scaleFactors itself. Are you seriously recalculating them in your head?

Now imagine if scaleFactor also depended on some other variables, or some other functions, or external input. There would be no way to easily answer those questions.

Other than setting a "breakpoint", which is like monitoring traffic on the freeway by setting up a barricade.
Or writing to a "console", which is like figuring out where your dog goes during the day by following the trail of droppings.


worrydream.com/LearnableProgramming/

URL
Комментарии
2012-10-01 в 01:02 

"How to become a Millionaire"

Комментирование для вас недоступно.
Для того, чтобы получить возможность комментировать, авторизуйтесь:
 
РегистрацияЗабыли пароль?

worst things beautiful

главная