1 00:00:06,270 --> 00:00:08,610 At the beginning of the week, I showed you this picture. 2 00:00:08,610 --> 00:00:14,380 And I talked about how the structure of this part of the course is really 3 00:00:14,380 --> 00:00:18,710 going to be defined. By the cross product of recipes, like how 4 00:00:18,710 --> 00:00:24,140 to design functions and how to design world programs, with data definitions 5 00:00:24,140 --> 00:00:27,450 with different structure. During the week we saw how to design 6 00:00:27,450 --> 00:00:33,184 simple atomic data definitions, interval data definitions, enumerations, and 7 00:00:33,184 --> 00:00:37,190 itemizations. And then we designed one function using 8 00:00:37,190 --> 00:00:41,020 each of those data definitions. We basically completed the red box in 9 00:00:41,020 --> 00:00:44,000 this week. Next week we'll do the green box. 10 00:00:45,470 --> 00:00:50,390 That point that you can think about the organization of the first part of the 11 00:00:50,390 --> 00:00:55,330 course in terms of a cross product between the form of the data and the how 12 00:00:55,330 --> 00:01:00,250 to design functions recipe. That point's important but there's a much 13 00:01:00,250 --> 00:01:05,170 more important point that underlies that. Think about the examples we've seen this 14 00:01:05,170 --> 00:01:08,420 week. Think about the city name example and the 15 00:01:08,420 --> 00:01:11,560 best function. The inherent structure of the domain 16 00:01:11,560 --> 00:01:16,310 information in that case was atomic. So we represented it using simple atomic 17 00:01:16,310 --> 00:01:18,950 data. And that meant the template had a certain 18 00:01:18,950 --> 00:01:22,630 form, dot, dot, dot x. And that told us something about the 19 00:01:22,630 --> 00:01:25,190 function and something about the test as well. 20 00:01:26,350 --> 00:01:28,436 And that happened with all of the data definitions. 21 00:01:28,436 --> 00:01:32,920 With seednum, the inherent structure of the information is a contiguous range of 22 00:01:32,920 --> 00:01:36,260 numbers. So in that case, we use an interval. 23 00:01:36,260 --> 00:01:40,330 That formed the template a certain way, it formed the body of the function a 24 00:01:40,330 --> 00:01:43,620 certain way, and it told us something about the test, in that case, that there 25 00:01:43,620 --> 00:01:47,540 should be three of them. Every example we saw this week, it was 26 00:01:47,540 --> 00:01:51,920 the same phenomenon. Which is that once we identify the 27 00:01:51,920 --> 00:01:56,130 structure of the information, the inherent structure of the information, 28 00:01:56,130 --> 00:01:59,780 that gives us the structure of the data used to represent it. 29 00:01:59,780 --> 00:02:02,500 Which gives us the structure of the template. 30 00:02:02,500 --> 00:02:07,090 Which gives us the structure of the function and also we get guidance about 31 00:02:07,090 --> 00:02:11,184 the tests for that function. So identifying the structure of the 32 00:02:11,184 --> 00:02:16,770 information is really a key step or maybe the key step in the program design. 33 00:02:16,770 --> 00:02:20,200 At least for many kinds of programs, the ones we're going to look at for the first 34 00:02:20,200 --> 00:02:23,210 part of this course. As data definitions get more 35 00:02:23,210 --> 00:02:26,770 sophisticated, what you're going to see is that there are different choices you 36 00:02:26,770 --> 00:02:30,880 can make about the data that you'll use to represent information. 37 00:02:30,880 --> 00:02:35,620 And by making different choices, you actually have a lot of influence on the 38 00:02:35,620 --> 00:02:39,130 rest of the program. Because of this fact that the structure 39 00:02:39,130 --> 00:02:42,230 of the data determines the structure of the template, determines the structure of 40 00:02:42,230 --> 00:02:46,930 the functions. So, designing data is a very high point 41 00:02:46,930 --> 00:02:51,490 of leverage for designing programs. There are some programs for which that's 42 00:02:51,490 --> 00:02:56,590 less true but for very many programs, this approach that we're taking in this 43 00:02:56,590 --> 00:03:01,280 first part of the course, this data driven approach, does a very good job of 44 00:03:01,280 --> 00:03:03,700 producing the structure of large parts of the program. 45 00:03:05,560 --> 00:03:09,620 What we'll see later in the course is some examples where the control structure 46 00:03:10,700 --> 00:03:15,285 becomes dominant and what we'll learn in that part of the course is how to blend 47 00:03:15,285 --> 00:03:19,950 templates based with control structure together with templates based on type 48 00:03:19,950 --> 00:03:24,620 comments or templates based on a form of data to produce the dominant structure of 49 00:03:24,620 --> 00:03:28,040 our program. But even in those programs, the form of 50 00:03:28,040 --> 00:03:32,620 the information determines the form of the data and the form of the data 51 00:03:32,620 --> 00:03:36,920 determines the form of many of the functions that operate on the data. 52 00:03:36,920 --> 00:03:41,400 So identifying the form of the information remains a key step in the 53 00:03:41,400 --> 00:03:45,010 design of programs. That's going to be true throughout the 54 00:03:45,010 --> 00:03:47,020 course and throughout all programs you write. 55 00:03:49,820 --> 00:03:52,260 So have fun with the homework assignments, and I'll see you next week.