1 00:00:12,000 --> 00:00:17,199 hello and welcome back 2 00:00:14,400 --> 00:00:19,920 to a fantastic afternoon of pike online 3 00:00:17,199 --> 00:00:23,920 education track and it is my absolute 4 00:00:19,920 --> 00:00:27,519 pleasure to welcome katie bell uh to the 5 00:00:23,920 --> 00:00:29,279 stage our virtual stage um katie's going 6 00:00:27,519 --> 00:00:30,720 to be talking about real python made of 7 00:00:29,279 --> 00:00:32,640 blocks 8 00:00:30,720 --> 00:00:34,160 which is a fantastic thing for any 9 00:00:32,640 --> 00:00:36,320 python to be made out of 10 00:00:34,160 --> 00:00:38,800 um i'm not at all biased because i've 11 00:00:36,320 --> 00:00:41,440 been playing way too much duplo uh with 12 00:00:38,800 --> 00:00:44,399 my kiddo um but 13 00:00:41,440 --> 00:00:46,559 katie uh i have a fantastic bio here of 14 00:00:44,399 --> 00:00:51,600 katie which she gave me full permission 15 00:00:46,559 --> 00:00:54,000 to add some um uh made-up facts spurious 16 00:00:51,600 --> 00:00:57,199 stats into i i haven't taken her up on 17 00:00:54,000 --> 00:00:59,199 that opportunity but who knows uh so 18 00:00:57,199 --> 00:01:01,920 let's see katie's 10-year career as a 19 00:00:59,199 --> 00:01:03,280 software engineer has been pretty darn 20 00:01:01,920 --> 00:01:05,280 fun 21 00:01:03,280 --> 00:01:06,799 i i love that i love it uh she helped 22 00:01:05,280 --> 00:01:08,720 develop google docs and later was on 23 00:01:06,799 --> 00:01:10,320 call for some of google's biggest cloud 24 00:01:08,720 --> 00:01:12,560 infrastructure as a site reliability 25 00:01:10,320 --> 00:01:14,240 engineer she sold some serious technical 26 00:01:12,560 --> 00:01:16,720 and operational challenges at campaign 27 00:01:14,240 --> 00:01:19,280 monitor as the lead engineering uh 28 00:01:16,720 --> 00:01:20,880 productivity team and she helped get the 29 00:01:19,280 --> 00:01:25,040 education startup rock learning off the 30 00:01:20,880 --> 00:01:26,640 ground as their first employee represent 31 00:01:25,040 --> 00:01:28,479 today you'll find her freelancing for 32 00:01:26,640 --> 00:01:30,479 startups as well as working on her own 33 00:01:28,479 --> 00:01:31,840 projects um 34 00:01:30,479 --> 00:01:34,000 more recently she's been teaching 35 00:01:31,840 --> 00:01:35,840 programming to beginners for a long time 36 00:01:34,000 --> 00:01:39,759 and is now an instructor at general 37 00:01:35,840 --> 00:01:42,320 assembly i am super super excited to 38 00:01:39,759 --> 00:01:44,799 hear this talk katie 39 00:01:42,320 --> 00:01:46,320 tell me all about blocks in in my new 40 00:01:44,799 --> 00:01:47,280 favorite thing 41 00:01:46,320 --> 00:01:48,399 cool 42 00:01:47,280 --> 00:01:50,720 well i'm not going to start off with 43 00:01:48,399 --> 00:01:52,320 blocks um start off talking about myself 44 00:01:50,720 --> 00:01:53,439 i've been teaching python for a while as 45 00:01:52,320 --> 00:01:55,920 mentioned 46 00:01:53,439 --> 00:01:57,920 mostly i was teaching high school kids 47 00:01:55,920 --> 00:01:59,840 more recently i've been teaching python 48 00:01:57,920 --> 00:02:00,880 to adults as an instructor for general 49 00:01:59,840 --> 00:02:03,600 assembly 50 00:02:00,880 --> 00:02:07,439 and anyone who's been teaching coding to 51 00:02:03,600 --> 00:02:09,039 beginners will know this that coding is 52 00:02:07,439 --> 00:02:11,440 hard coding is 53 00:02:09,039 --> 00:02:14,000 really hard um there's a lot of stuff 54 00:02:11,440 --> 00:02:15,760 that has to go on in your brain while 55 00:02:14,000 --> 00:02:17,280 you are doing coding 56 00:02:15,760 --> 00:02:18,560 while you're writing code and while 57 00:02:17,280 --> 00:02:21,360 you're reading and understanding and 58 00:02:18,560 --> 00:02:23,120 debugging code there's a lot going on so 59 00:02:21,360 --> 00:02:25,040 if you're an experienced developer you 60 00:02:23,120 --> 00:02:26,720 might not realize just how hard it is 61 00:02:25,040 --> 00:02:28,080 for beginners so let's go through a bit 62 00:02:26,720 --> 00:02:30,720 of an example 63 00:02:28,080 --> 00:02:33,280 uh here's a little python program 64 00:02:30,720 --> 00:02:34,720 uh has a while loop uh and it asks 65 00:02:33,280 --> 00:02:36,720 repeatedly 66 00:02:34,720 --> 00:02:38,560 to for the user to type in what did you 67 00:02:36,720 --> 00:02:41,360 roll as in a dice roll 68 00:02:38,560 --> 00:02:43,440 uh and if you type in you know what what 69 00:02:41,360 --> 00:02:45,360 dice rolls you got uh it tries to keep 70 00:02:43,440 --> 00:02:48,000 track of how many sixes you've rolled in 71 00:02:45,360 --> 00:02:50,080 a row uh and when you reach three sixes 72 00:02:48,000 --> 00:02:52,000 in a row it stops asking and says that's 73 00:02:50,080 --> 00:02:52,800 three sixes in a row 74 00:02:52,000 --> 00:02:54,400 and 75 00:02:52,800 --> 00:02:55,680 if you understand python and you 76 00:02:54,400 --> 00:02:57,519 understand all of the syntax and 77 00:02:55,680 --> 00:02:58,879 everything that's going on uh your brain 78 00:02:57,519 --> 00:03:00,480 can focus on 79 00:02:58,879 --> 00:03:02,159 what these variables are and what 80 00:03:00,480 --> 00:03:04,239 they're doing actually takes quite a lot 81 00:03:02,159 --> 00:03:06,720 of mental capacity to sort of step 82 00:03:04,239 --> 00:03:08,800 through and go okay i start the program 83 00:03:06,720 --> 00:03:11,680 the sixes variable is zero okay if they 84 00:03:08,800 --> 00:03:14,400 type in a six then that adds one and now 85 00:03:11,680 --> 00:03:16,159 the sixes variable is one if i type in 86 00:03:14,400 --> 00:03:18,800 another six now it's two but if then 87 00:03:16,159 --> 00:03:21,519 they type something else then it's it's 88 00:03:18,800 --> 00:03:23,200 not six it resets sixes to zero 89 00:03:21,519 --> 00:03:25,040 and if they type in something else yep 90 00:03:23,200 --> 00:03:27,120 it's still zero okay if they type in a 91 00:03:25,040 --> 00:03:28,480 six that's one if they type in another 92 00:03:27,120 --> 00:03:30,720 six that's two 93 00:03:28,480 --> 00:03:32,720 okay and then it's three and then that 94 00:03:30,720 --> 00:03:36,000 stops the while loop and then it prints 95 00:03:32,720 --> 00:03:37,760 a message okay reading code 96 00:03:36,000 --> 00:03:39,840 means keeping all of this like variable 97 00:03:37,760 --> 00:03:41,680 state uh in your head as well as 98 00:03:39,840 --> 00:03:43,360 following the the way that the program 99 00:03:41,680 --> 00:03:44,560 is executing 100 00:03:43,360 --> 00:03:46,879 if you are 101 00:03:44,560 --> 00:03:49,120 a beginner to code it's really hard to 102 00:03:46,879 --> 00:03:51,120 even think about those things because 103 00:03:49,120 --> 00:03:52,640 you're too busy trying to remember all 104 00:03:51,120 --> 00:03:55,360 of the stuff that's going on in the code 105 00:03:52,640 --> 00:03:57,120 like what is a variable like why is this 106 00:03:55,360 --> 00:03:59,599 print but not with a printer what do the 107 00:03:57,120 --> 00:04:01,519 quotes mean there's parentheses there's 108 00:03:59,599 --> 00:04:03,680 equals and and double equals and they're 109 00:04:01,519 --> 00:04:05,200 different but like why does equals not 110 00:04:03,680 --> 00:04:08,000 mean that the things are equal it's 111 00:04:05,200 --> 00:04:09,920 actually changing something i forgot 112 00:04:08,000 --> 00:04:12,159 the colon and the while and nothing 113 00:04:09,920 --> 00:04:15,519 works and the indenting is wrong uh and 114 00:04:12,159 --> 00:04:17,280 it gets really quite a lot now if you 115 00:04:15,519 --> 00:04:18,880 happen to be a high school student in 116 00:04:17,280 --> 00:04:22,240 your seven or eight and you're maybe 12 117 00:04:18,880 --> 00:04:23,759 to 14 years old uh then maybe you can't 118 00:04:22,240 --> 00:04:25,600 even think about these things because 119 00:04:23,759 --> 00:04:27,440 just using a computer is taking so much 120 00:04:25,600 --> 00:04:28,880 of your brain or your reading and 121 00:04:27,440 --> 00:04:31,520 spelling actually takes quite a lot of 122 00:04:28,880 --> 00:04:34,479 concentration um or even typing and 123 00:04:31,520 --> 00:04:37,600 finding where the colon button is on the 124 00:04:34,479 --> 00:04:39,520 keyboard is hard enough already and it 125 00:04:37,600 --> 00:04:41,520 is just too much 126 00:04:39,520 --> 00:04:44,160 for your brain to cope with at any one 127 00:04:41,520 --> 00:04:46,320 time right this is called cognitive load 128 00:04:44,160 --> 00:04:47,919 i have a limited amount of working 129 00:04:46,320 --> 00:04:50,479 memory and when you are learning new 130 00:04:47,919 --> 00:04:52,320 concepts and absorbing new ideas you 131 00:04:50,479 --> 00:04:54,560 need to be storing that information in 132 00:04:52,320 --> 00:04:56,800 working memory until you can build it as 133 00:04:54,560 --> 00:04:58,720 a long-term memory and a long-term skill 134 00:04:56,800 --> 00:05:01,280 so your brain is working really hard to 135 00:04:58,720 --> 00:05:03,120 try and learn a lot of new things at the 136 00:05:01,280 --> 00:05:06,720 same time and this is part of what makes 137 00:05:03,120 --> 00:05:09,280 learning to code really quite difficult 138 00:05:06,720 --> 00:05:12,000 uh so we don't teach kids to code or 139 00:05:09,280 --> 00:05:14,160 anyone to code just all at once we break 140 00:05:12,000 --> 00:05:16,560 it down into steps oh and you might have 141 00:05:14,160 --> 00:05:18,400 not noticed that even with thinking 142 00:05:16,560 --> 00:05:20,720 about all of those different things 143 00:05:18,400 --> 00:05:22,800 there's still a bug in the code where if 144 00:05:20,720 --> 00:05:24,320 you run it it never actually finishes it 145 00:05:22,800 --> 00:05:26,160 never prints three sixes in a row no 146 00:05:24,320 --> 00:05:27,919 matter how many sixes you get and then 147 00:05:26,160 --> 00:05:29,520 trying to figure that out is another 148 00:05:27,919 --> 00:05:31,039 step that's really hard 149 00:05:29,520 --> 00:05:32,560 and it turns out to be because this 150 00:05:31,039 --> 00:05:34,560 input returns a string and we're 151 00:05:32,560 --> 00:05:35,919 comparing the string to an integer and 152 00:05:34,560 --> 00:05:37,120 the code doesn't actually do what we 153 00:05:35,919 --> 00:05:38,800 expect it to do 154 00:05:37,120 --> 00:05:40,479 so this is all 155 00:05:38,800 --> 00:05:41,759 really hard 156 00:05:40,479 --> 00:05:44,400 and too much stuff for your brain to 157 00:05:41,759 --> 00:05:46,880 keep track of at the same time 158 00:05:44,400 --> 00:05:49,440 so we break coding down in two steps we 159 00:05:46,880 --> 00:05:51,840 don't try and teach code all at once we 160 00:05:49,440 --> 00:05:53,680 don't throw large amounts of code at the 161 00:05:51,840 --> 00:05:55,919 students and we don't get them to build 162 00:05:53,680 --> 00:05:58,080 really complicated programs right from 163 00:05:55,919 --> 00:06:00,160 the start you start with hello world you 164 00:05:58,080 --> 00:06:02,639 start with simple variables and ifs you 165 00:06:00,160 --> 00:06:04,400 start with programs that have just text 166 00:06:02,639 --> 00:06:06,240 input and output before you try and deal 167 00:06:04,400 --> 00:06:09,360 with things with graphics you can build 168 00:06:06,240 --> 00:06:12,080 it up step by step 169 00:06:09,360 --> 00:06:14,400 but this is a little bit demoralizing 170 00:06:12,080 --> 00:06:15,520 and frustrating right learning to code 171 00:06:14,400 --> 00:06:17,759 from scratch 172 00:06:15,520 --> 00:06:20,000 it takes a long time and a lot of energy 173 00:06:17,759 --> 00:06:21,600 and a lot of effort just to get to the 174 00:06:20,000 --> 00:06:24,880 point where you can build mildly 175 00:06:21,600 --> 00:06:27,039 interesting text input output programs 176 00:06:24,880 --> 00:06:29,440 and it's really hard to build up enough 177 00:06:27,039 --> 00:06:31,440 python skills to be able to actually 178 00:06:29,440 --> 00:06:33,600 build all of the cool and interesting 179 00:06:31,440 --> 00:06:35,440 things that you can do with python you 180 00:06:33,600 --> 00:06:37,840 can build web apps you can build games 181 00:06:35,440 --> 00:06:39,759 with pygame uh you can build cool things 182 00:06:37,840 --> 00:06:42,639 with micro python um 183 00:06:39,759 --> 00:06:44,240 and you can analyze data and 184 00:06:42,639 --> 00:06:46,400 make interesting sort of scientific 185 00:06:44,240 --> 00:06:48,319 analysis out of it right using numpy and 186 00:06:46,400 --> 00:06:50,000 scipy but actually getting to the point 187 00:06:48,319 --> 00:06:53,120 where you have enough python skill to do 188 00:06:50,000 --> 00:06:56,000 that is a slow and frustrating process 189 00:06:53,120 --> 00:06:58,319 so again we don't teach things 190 00:06:56,000 --> 00:06:59,440 in that order most students in primary 191 00:06:58,319 --> 00:07:01,599 school 192 00:06:59,440 --> 00:07:03,840 nowadays are starting to learn coding in 193 00:07:01,599 --> 00:07:05,120 a simpler way first instead of starting 194 00:07:03,840 --> 00:07:06,960 with hello world and building up the 195 00:07:05,120 --> 00:07:10,080 syntax step at a time you start with 196 00:07:06,960 --> 00:07:12,560 something like scratch scratch is much 197 00:07:10,080 --> 00:07:15,280 much easier for students to pick up at 198 00:07:12,560 --> 00:07:16,639 first right you don't have to remember 199 00:07:15,280 --> 00:07:19,680 the syntax 200 00:07:16,639 --> 00:07:21,440 you don't even have to remember what 201 00:07:19,680 --> 00:07:23,039 blocks are available to you what 202 00:07:21,440 --> 00:07:24,720 functions and what components are 203 00:07:23,039 --> 00:07:27,120 available to you because they are all 204 00:07:24,720 --> 00:07:28,800 listed there and you can go and find the 205 00:07:27,120 --> 00:07:31,039 ones that you need if you're not sure 206 00:07:28,800 --> 00:07:32,880 what a block does you get very immediate 207 00:07:31,039 --> 00:07:34,080 feedback to try out that block and see 208 00:07:32,880 --> 00:07:36,639 what it does 209 00:07:34,080 --> 00:07:38,319 you don't need to keep in your head 210 00:07:36,639 --> 00:07:39,919 all of the things that the program is 211 00:07:38,319 --> 00:07:42,880 doing because most of the things that 212 00:07:39,919 --> 00:07:45,280 the program does are visual things you 213 00:07:42,880 --> 00:07:47,199 can see where the cat is moving across 214 00:07:45,280 --> 00:07:48,720 the screen uh you don't need to keep in 215 00:07:47,199 --> 00:07:51,360 your head you know what the xy 216 00:07:48,720 --> 00:07:53,120 coordinates are of the cat 217 00:07:51,360 --> 00:07:55,199 but more importantly you get to build 218 00:07:53,120 --> 00:07:56,240 cool things you can build games and 219 00:07:55,199 --> 00:07:57,440 things that you can show off to your 220 00:07:56,240 --> 00:08:01,039 friends and 221 00:07:57,440 --> 00:08:03,680 coding is this uh empowering experience 222 00:08:01,039 --> 00:08:05,360 where you can solve problems on your own 223 00:08:03,680 --> 00:08:06,240 where you can discover things on your 224 00:08:05,360 --> 00:08:08,479 own 225 00:08:06,240 --> 00:08:09,759 and build cool things uh very very 226 00:08:08,479 --> 00:08:13,440 quickly 227 00:08:09,759 --> 00:08:15,599 right it still works as a step towards 228 00:08:13,440 --> 00:08:16,479 building other coding skills if you 229 00:08:15,599 --> 00:08:19,280 learn 230 00:08:16,479 --> 00:08:21,680 uh how variables work and how ifs work 231 00:08:19,280 --> 00:08:23,520 and how loops work in scratch 232 00:08:21,680 --> 00:08:25,199 in theory it should make it easier to 233 00:08:23,520 --> 00:08:27,599 then move on to 234 00:08:25,199 --> 00:08:29,759 python text-based coding 235 00:08:27,599 --> 00:08:31,520 and let you build cool things there 236 00:08:29,759 --> 00:08:34,240 without having to learn quite as much 237 00:08:31,520 --> 00:08:36,399 new stuff at the same time 238 00:08:34,240 --> 00:08:38,080 but what i find in practice is even 239 00:08:36,399 --> 00:08:41,839 after learning scratch 240 00:08:38,080 --> 00:08:43,599 this gap is still really really big you 241 00:08:41,839 --> 00:08:45,600 go from building cool games in scratch 242 00:08:43,599 --> 00:08:47,200 and when you start off with python it 243 00:08:45,600 --> 00:08:49,279 takes a long time to get to the point 244 00:08:47,200 --> 00:08:51,760 where you can actually build interesting 245 00:08:49,279 --> 00:08:53,279 and cool things in python 246 00:08:51,760 --> 00:08:54,480 you need to build up 247 00:08:53,279 --> 00:08:57,040 the syntax 248 00:08:54,480 --> 00:08:58,480 the control structures the variables the 249 00:08:57,040 --> 00:09:00,720 data types 250 00:08:58,480 --> 00:09:02,160 and then land functions and then you can 251 00:09:00,720 --> 00:09:03,519 start to look at all of the cool things 252 00:09:02,160 --> 00:09:05,279 that you might build now there are some 253 00:09:03,519 --> 00:09:06,720 exceptions to this micropython in 254 00:09:05,279 --> 00:09:08,480 particular lets you start to do you know 255 00:09:06,720 --> 00:09:10,560 blinky leds very quickly 256 00:09:08,480 --> 00:09:12,240 um but for most of the cool things that 257 00:09:10,560 --> 00:09:14,160 you might want to build with python it's 258 00:09:12,240 --> 00:09:16,320 actually really hard to get there 259 00:09:14,160 --> 00:09:18,959 and it's hard enough that in my 260 00:09:16,320 --> 00:09:21,680 experience with most teachers 261 00:09:18,959 --> 00:09:23,519 it's really hard to do that in the year 262 00:09:21,680 --> 00:09:25,120 seven and eight curriculum where you're 263 00:09:23,519 --> 00:09:26,560 expected to teach general purpose 264 00:09:25,120 --> 00:09:28,320 programming languages or text-based 265 00:09:26,560 --> 00:09:30,240 programming languages but with the 266 00:09:28,320 --> 00:09:32,240 limited amount of class time you get and 267 00:09:30,240 --> 00:09:34,720 with the skills that the average you 268 00:09:32,240 --> 00:09:36,800 know year seven or eight student has 269 00:09:34,720 --> 00:09:38,399 it's really hard to get all of your 270 00:09:36,800 --> 00:09:40,080 students to the point where they can 271 00:09:38,399 --> 00:09:41,200 build something cool and interesting and 272 00:09:40,080 --> 00:09:44,320 exciting 273 00:09:41,200 --> 00:09:46,560 in text-based programming 274 00:09:44,320 --> 00:09:48,399 so how do we bridge 275 00:09:46,560 --> 00:09:50,320 this gap how can we take students that 276 00:09:48,399 --> 00:09:52,080 were maybe already excited about 277 00:09:50,320 --> 00:09:54,320 building applications in scratch and 278 00:09:52,080 --> 00:09:55,279 scratch is already quite difficult to 279 00:09:54,320 --> 00:09:57,760 build things in right because 280 00:09:55,279 --> 00:09:59,600 programming is hard um but how do we 281 00:09:57,760 --> 00:10:01,519 bridge that gap so that they can start 282 00:09:59,600 --> 00:10:02,800 learning python and building cool things 283 00:10:01,519 --> 00:10:04,800 in python 284 00:10:02,800 --> 00:10:06,560 without it becoming this sort of slow 285 00:10:04,800 --> 00:10:09,120 and frustrating experience 286 00:10:06,560 --> 00:10:10,079 now i'm not the first person to try and 287 00:10:09,120 --> 00:10:12,240 do this 288 00:10:10,079 --> 00:10:14,320 by any means blockly is a really great 289 00:10:12,240 --> 00:10:16,800 tool for this we saw in renee's talk 290 00:10:14,320 --> 00:10:18,880 this morning that building micropython 291 00:10:16,800 --> 00:10:21,040 programs with blockly is perfectly 292 00:10:18,880 --> 00:10:23,200 feasible and this is much easier for 293 00:10:21,040 --> 00:10:24,640 students to get started with they can 294 00:10:23,200 --> 00:10:25,360 see the blocks that are available to 295 00:10:24,640 --> 00:10:28,000 them 296 00:10:25,360 --> 00:10:31,760 they can build programs out of blocks it 297 00:10:28,000 --> 00:10:33,680 avoids typing it avoids syntax errors 298 00:10:31,760 --> 00:10:35,279 and it avoids that process of having to 299 00:10:33,680 --> 00:10:36,959 memorize all of the things that you need 300 00:10:35,279 --> 00:10:39,200 to be able to type to be able to write a 301 00:10:36,959 --> 00:10:41,360 program 302 00:10:39,200 --> 00:10:43,760 it doesn't quite go far enough to make 303 00:10:41,360 --> 00:10:45,839 it really a smooth transition into 304 00:10:43,760 --> 00:10:47,600 python if you learn to code 305 00:10:45,839 --> 00:10:49,519 some things with blocky it does blockly 306 00:10:47,600 --> 00:10:51,600 it does help you get towards 307 00:10:49,519 --> 00:10:53,519 writing anything else in python but it 308 00:10:51,600 --> 00:10:55,519 doesn't quite go far enough or at least 309 00:10:53,519 --> 00:10:58,480 as far as i wanted it to do 310 00:10:55,519 --> 00:11:00,880 and so i decided that i wanted to build 311 00:10:58,480 --> 00:11:04,480 something else that would be another 312 00:11:00,880 --> 00:11:06,959 attempt at trying to bridge this gap 313 00:11:04,480 --> 00:11:09,519 something where it's easy to get started 314 00:11:06,959 --> 00:11:10,320 it's easy to pick up and start using it 315 00:11:09,519 --> 00:11:12,480 but 316 00:11:10,320 --> 00:11:14,959 it is a smoother transition to go from 317 00:11:12,480 --> 00:11:17,680 there into text based python and a 318 00:11:14,959 --> 00:11:19,279 smoother transition to go on to build 319 00:11:17,680 --> 00:11:21,120 all kinds of cool things with all the 320 00:11:19,279 --> 00:11:23,839 full flexibility 321 00:11:21,120 --> 00:11:25,680 of what python can do and all the cool 322 00:11:23,839 --> 00:11:27,279 programs you can do once you learn to 323 00:11:25,680 --> 00:11:30,640 code 324 00:11:27,279 --> 00:11:33,360 sorry i call this project split code uh 325 00:11:30,640 --> 00:11:35,279 it is a work in progress um it's 326 00:11:33,360 --> 00:11:36,160 currently under construction but all of 327 00:11:35,279 --> 00:11:38,160 the things that i'm going to show you 328 00:11:36,160 --> 00:11:39,600 today are already things that work uh 329 00:11:38,160 --> 00:11:41,519 things that are real that you can write 330 00:11:39,600 --> 00:11:43,920 real python programs with 331 00:11:41,519 --> 00:11:46,079 so let's talk about what we are aiming 332 00:11:43,920 --> 00:11:48,160 to build uh with blue code what i am 333 00:11:46,079 --> 00:11:49,839 aiming to build here so the four things 334 00:11:48,160 --> 00:11:52,240 i'm aiming to solve right one it needs 335 00:11:49,839 --> 00:11:54,320 to be really easy to get started is to 336 00:11:52,240 --> 00:11:56,399 have low cognitive load you don't need 337 00:11:54,320 --> 00:11:58,800 to learn or memorize 338 00:11:56,399 --> 00:12:00,480 or or comprehend a lot of things to get 339 00:11:58,800 --> 00:12:01,519 started and start to write your first 340 00:12:00,480 --> 00:12:03,360 programs 341 00:12:01,519 --> 00:12:06,480 i also want it to have a really smooth 342 00:12:03,360 --> 00:12:09,040 transition into text-based python as 343 00:12:06,480 --> 00:12:11,760 much as we can it should also have 344 00:12:09,040 --> 00:12:13,680 really fast feedback and the ability to 345 00:12:11,760 --> 00:12:16,000 write code and iterate and see what your 346 00:12:13,680 --> 00:12:18,000 code is doing 347 00:12:16,000 --> 00:12:21,120 without having to learn how to use a 348 00:12:18,000 --> 00:12:22,720 fully featured debugger 349 00:12:21,120 --> 00:12:24,399 and it should also have 350 00:12:22,720 --> 00:12:27,440 as close as possible 351 00:12:24,399 --> 00:12:30,079 to the features and flexibility that 352 00:12:27,440 --> 00:12:32,639 real text-based python has 353 00:12:30,079 --> 00:12:34,240 and make it as unlimited as it possibly 354 00:12:32,639 --> 00:12:35,920 can be so this is a pretty ambitious set 355 00:12:34,240 --> 00:12:38,480 of goals i've not achieved all of the 356 00:12:35,920 --> 00:12:40,560 goals uh yet but let's take a look 357 00:12:38,480 --> 00:12:42,480 at the first one and see what we've got 358 00:12:40,560 --> 00:12:45,600 so far 359 00:12:42,480 --> 00:12:48,000 all right let's go and play a video 360 00:12:45,600 --> 00:12:50,000 um so on the left side here we have 361 00:12:48,000 --> 00:12:52,079 like in scratch a set of all of the 362 00:12:50,000 --> 00:12:53,279 blocks uh that we can use it's not a 363 00:12:52,079 --> 00:12:54,639 complete set 364 00:12:53,279 --> 00:12:56,320 but most of the blocks that you need to 365 00:12:54,639 --> 00:12:58,000 get started are there 366 00:12:56,320 --> 00:13:00,240 and we can drag and drop them in and we 367 00:12:58,000 --> 00:13:02,320 don't need to type any of these things 368 00:13:00,240 --> 00:13:04,240 dragging two blocks in lets me run my 369 00:13:02,320 --> 00:13:06,480 first hello world program or i could 370 00:13:04,240 --> 00:13:07,920 edit the text make it actually a hello 371 00:13:06,480 --> 00:13:09,440 world program 372 00:13:07,920 --> 00:13:11,839 and run it again 373 00:13:09,440 --> 00:13:14,240 and this is all happening in the browser 374 00:13:11,839 --> 00:13:16,880 it is running a real true version of c 375 00:13:14,240 --> 00:13:20,399 python in the browser uh to be able to 376 00:13:16,880 --> 00:13:22,079 do this uh really quickly uh so we can 377 00:13:20,399 --> 00:13:24,240 build up a program 378 00:13:22,079 --> 00:13:25,440 with a combination of drag and drop uh 379 00:13:24,240 --> 00:13:28,800 and typing 380 00:13:25,440 --> 00:13:31,519 uh and enter you know interactive stuff 381 00:13:28,800 --> 00:13:33,279 uh in the terminal there 382 00:13:31,519 --> 00:13:35,920 one of the key differences between this 383 00:13:33,279 --> 00:13:36,639 and other block based languages is that 384 00:13:35,920 --> 00:13:38,800 the 385 00:13:36,639 --> 00:13:41,519 way that you do mathematical expressions 386 00:13:38,800 --> 00:13:43,120 is more closely related to how they work 387 00:13:41,519 --> 00:13:44,560 in maths class or how they work in 388 00:13:43,120 --> 00:13:46,240 regular python 389 00:13:44,560 --> 00:13:48,079 you assemble a maths expression just 390 00:13:46,240 --> 00:13:51,760 with like numbers variables and 391 00:13:48,079 --> 00:13:54,480 operators um just like that uh it has 392 00:13:51,760 --> 00:13:56,880 uh order of operations uh same way again 393 00:13:54,480 --> 00:13:58,880 straight up creating python code here if 394 00:13:56,880 --> 00:14:00,560 you don't remember how to type the star 395 00:13:58,880 --> 00:14:02,160 to do a multiply 396 00:14:00,560 --> 00:14:03,680 you can also type the word multiply or 397 00:14:02,160 --> 00:14:04,720 you can even type work type the word 398 00:14:03,680 --> 00:14:06,000 times 399 00:14:04,720 --> 00:14:07,519 in the same way if you want to use later 400 00:14:06,000 --> 00:14:09,600 less than or greater than and you don't 401 00:14:07,519 --> 00:14:11,440 remember you know which symbol does that 402 00:14:09,600 --> 00:14:13,519 you can just type less than or greater 403 00:14:11,440 --> 00:14:15,920 than and it will order complete uh to 404 00:14:13,519 --> 00:14:17,760 find the thing that you're looking for 405 00:14:15,920 --> 00:14:19,760 all right so you can assemble 406 00:14:17,760 --> 00:14:21,680 uh by writing text 407 00:14:19,760 --> 00:14:25,360 so you have a cursor you can move the 408 00:14:21,680 --> 00:14:26,959 cursor around with uh the arrow keys uh 409 00:14:25,360 --> 00:14:28,959 to find where you want to enter things 410 00:14:26,959 --> 00:14:30,639 and just start typing to enter things in 411 00:14:28,959 --> 00:14:32,399 with autocomplete but if you don't know 412 00:14:30,639 --> 00:14:34,800 what to type you can just go and find 413 00:14:32,399 --> 00:14:35,839 the block and drag it in um 414 00:14:34,800 --> 00:14:38,320 things like 415 00:14:35,839 --> 00:14:39,920 nesting and indenting all just work kind 416 00:14:38,320 --> 00:14:41,040 of the way that you would expect them to 417 00:14:39,920 --> 00:14:42,480 work 418 00:14:41,040 --> 00:14:45,680 okay 419 00:14:42,480 --> 00:14:47,920 and now we go to the next slide 420 00:14:45,680 --> 00:14:50,560 next slide please there we go 421 00:14:47,920 --> 00:14:52,079 uh so it avoids like most block-based 422 00:14:50,560 --> 00:14:54,480 programs it avoids all of the common 423 00:14:52,079 --> 00:14:56,800 problems that really 424 00:14:54,480 --> 00:14:58,399 hit students at the beginning with 425 00:14:56,800 --> 00:15:00,399 syntax errors you 426 00:14:58,399 --> 00:15:02,639 cannot write these syntax errors you 427 00:15:00,399 --> 00:15:04,560 can't write a single equals by accident 428 00:15:02,639 --> 00:15:06,160 because it will auto-complete to a 429 00:15:04,560 --> 00:15:08,880 double equals for you 430 00:15:06,160 --> 00:15:10,320 um and you can't accidentally kind of 431 00:15:08,880 --> 00:15:13,040 assemble the programs in ways that don't 432 00:15:10,320 --> 00:15:14,959 make sense so the one of the frustrating 433 00:15:13,040 --> 00:15:16,800 things with text programming is that you 434 00:15:14,959 --> 00:15:19,760 can just type anything into the text 435 00:15:16,800 --> 00:15:21,199 editor and 90 99 of the things that you 436 00:15:19,760 --> 00:15:23,199 could possibly type will be invalid 437 00:15:21,199 --> 00:15:25,760 programs right whereas not so with block 438 00:15:23,199 --> 00:15:27,360 based uh editing most of the things that 439 00:15:25,760 --> 00:15:28,880 you can put together are valid programs 440 00:15:27,360 --> 00:15:30,959 not all of them are but the vast 441 00:15:28,880 --> 00:15:33,920 majority 442 00:15:30,959 --> 00:15:35,839 okay so that's how it is to get started 443 00:15:33,920 --> 00:15:37,519 uh it's easy to write valid programs 444 00:15:35,839 --> 00:15:39,360 it's easy to find the pieces that you 445 00:15:37,519 --> 00:15:40,880 need to put together to write valid 446 00:15:39,360 --> 00:15:42,959 programs 447 00:15:40,880 --> 00:15:44,560 but as for a smooth transition to 448 00:15:42,959 --> 00:15:46,480 text-based python 449 00:15:44,560 --> 00:15:49,120 the fact that you can navigate around 450 00:15:46,480 --> 00:15:52,480 with the cursor that you can enter the 451 00:15:49,120 --> 00:15:54,320 code by typing with an autocomplete 452 00:15:52,480 --> 00:15:55,600 it means that you get used to this idea 453 00:15:54,320 --> 00:15:58,160 that i can just type code with the 454 00:15:55,600 --> 00:16:00,560 keyboard uh it takes fewer keystrokes it 455 00:15:58,160 --> 00:16:02,880 takes less uh weird punctuation 456 00:16:00,560 --> 00:16:04,639 characters that are hard to type um but 457 00:16:02,880 --> 00:16:06,480 you are still typing in code into the 458 00:16:04,639 --> 00:16:09,839 editor in the same way 459 00:16:06,480 --> 00:16:12,800 uh it looks and feels closer 460 00:16:09,839 --> 00:16:15,199 to uh the way that text-based code what 461 00:16:12,800 --> 00:16:18,000 looks and feels uh in a regular editor 462 00:16:15,199 --> 00:16:20,079 so here's an example of um one flavor of 463 00:16:18,000 --> 00:16:22,399 blockly the blockley is quite flexible 464 00:16:20,079 --> 00:16:24,959 and you can make it look as more or less 465 00:16:22,399 --> 00:16:27,199 like python as you build it up 466 00:16:24,959 --> 00:16:28,880 but i find that the the split code one 467 00:16:27,199 --> 00:16:32,079 in the middle is a sort of closer 468 00:16:28,880 --> 00:16:33,680 representation to the way that uh code 469 00:16:32,079 --> 00:16:35,680 works in a text editor it's obviously 470 00:16:33,680 --> 00:16:37,600 not exactly the same 471 00:16:35,680 --> 00:16:40,240 but the way that you edit it and the way 472 00:16:37,600 --> 00:16:42,480 that you write it is very very similar 473 00:16:40,240 --> 00:16:44,959 to a text-based program 474 00:16:42,480 --> 00:16:47,839 so if you were to learn to code in 475 00:16:44,959 --> 00:16:50,079 python through the split code ui 476 00:16:47,839 --> 00:16:52,560 because it reads and feels and writes in 477 00:16:50,079 --> 00:16:53,759 a very similar way to text-based python 478 00:16:52,560 --> 00:16:56,560 um 479 00:16:53,759 --> 00:16:59,040 it's a not more natural transition into 480 00:16:56,560 --> 00:17:01,519 writing python in a text file 481 00:16:59,040 --> 00:17:03,440 you wouldn't need to learn how operators 482 00:17:01,519 --> 00:17:05,600 and the order of operations works 483 00:17:03,440 --> 00:17:07,280 particularly with things like and and or 484 00:17:05,600 --> 00:17:09,520 you wouldn't need to learn how the 485 00:17:07,280 --> 00:17:11,199 control structures work with indenting 486 00:17:09,520 --> 00:17:13,439 or the different kinds of data types in 487 00:17:11,199 --> 00:17:15,199 python or the python functions and 488 00:17:13,439 --> 00:17:17,360 libraries that are available to you the 489 00:17:15,199 --> 00:17:18,799 only part you would really need to learn 490 00:17:17,360 --> 00:17:20,559 is the detail 491 00:17:18,799 --> 00:17:22,480 of the syntax and which punctuation 492 00:17:20,559 --> 00:17:24,319 characters mean which things you'd also 493 00:17:22,480 --> 00:17:26,000 need to learn string escaping because 494 00:17:24,319 --> 00:17:29,200 adding quotes into a string in the split 495 00:17:26,000 --> 00:17:30,640 code ui doesn't need escaping so to get 496 00:17:29,200 --> 00:17:32,400 that 497 00:17:30,640 --> 00:17:34,000 transition into text 498 00:17:32,400 --> 00:17:35,679 the only parts that you really need to 499 00:17:34,000 --> 00:17:37,520 learn are just those parts that are very 500 00:17:35,679 --> 00:17:39,120 specific to writing in text and writing 501 00:17:37,520 --> 00:17:41,840 with syntax 502 00:17:39,120 --> 00:17:44,080 so all these kinds of errors um 503 00:17:41,840 --> 00:17:46,320 are things that trip up beginners a lot 504 00:17:44,080 --> 00:17:47,679 but if you were already familiar with 505 00:17:46,320 --> 00:17:49,200 how ifs work and you were already 506 00:17:47,679 --> 00:17:52,000 familiar with how strings work and 507 00:17:49,200 --> 00:17:53,679 variables and functions um it is easier 508 00:17:52,000 --> 00:17:55,360 to learn the syntax than it is to try 509 00:17:53,679 --> 00:17:57,520 and learn the syntax at the same as time 510 00:17:55,360 --> 00:17:59,120 as learning everything else 511 00:17:57,520 --> 00:18:01,760 okay 512 00:17:59,120 --> 00:18:03,440 moving on to fast feedback and iteration 513 00:18:01,760 --> 00:18:05,120 uh this is one of the bits that i am the 514 00:18:03,440 --> 00:18:07,280 most excited about 515 00:18:05,120 --> 00:18:08,799 one of the nice things about python and 516 00:18:07,280 --> 00:18:11,440 one of the reasons that we like to teach 517 00:18:08,799 --> 00:18:14,480 python is because you have this 518 00:18:11,440 --> 00:18:16,480 very fast feedback with the python reply 519 00:18:14,480 --> 00:18:18,480 right you can type in some code and 520 00:18:16,480 --> 00:18:20,559 immediately see and find out what that 521 00:18:18,480 --> 00:18:22,240 code is doing you can type in a little 522 00:18:20,559 --> 00:18:24,559 bit of maths and find out what the 523 00:18:22,240 --> 00:18:26,720 calculation is 524 00:18:24,559 --> 00:18:28,480 in my experience the students might use 525 00:18:26,720 --> 00:18:30,400 this a little bit at first but they very 526 00:18:28,480 --> 00:18:32,160 quickly stop using it because it is a 527 00:18:30,400 --> 00:18:34,880 difficult context switch to make from 528 00:18:32,160 --> 00:18:38,160 like writing code in a file and running 529 00:18:34,880 --> 00:18:40,240 it to writing the same code over again 530 00:18:38,160 --> 00:18:42,559 in a rebel just to try it out and 531 00:18:40,240 --> 00:18:44,880 experiment with it and they don't really 532 00:18:42,559 --> 00:18:46,480 use the rebel very often even when it 533 00:18:44,880 --> 00:18:49,360 would actually help them figure out what 534 00:18:46,480 --> 00:18:51,280 their code is doing uh in a much more uh 535 00:18:49,360 --> 00:18:53,200 real-time kind of way 536 00:18:51,280 --> 00:18:55,440 and actually making that transition into 537 00:18:53,200 --> 00:18:56,400 the repel and away from the text code uh 538 00:18:55,440 --> 00:18:57,840 is difficult 539 00:18:56,400 --> 00:18:58,799 uh even though the refer could be really 540 00:18:57,840 --> 00:19:00,320 useful 541 00:18:58,799 --> 00:19:02,960 it also involves typing out your code 542 00:19:00,320 --> 00:19:05,120 again a lot of the time uh when you're 543 00:19:02,960 --> 00:19:06,559 struggling with typing even into a text 544 00:19:05,120 --> 00:19:08,320 file the idea of typing something and 545 00:19:06,559 --> 00:19:10,960 then it you know it's it's gone 546 00:19:08,320 --> 00:19:13,600 immediately is a little frustrating 547 00:19:10,960 --> 00:19:15,280 so with a split code 548 00:19:13,600 --> 00:19:17,200 i've added in a system 549 00:19:15,280 --> 00:19:19,520 to essentially make your code act like a 550 00:19:17,200 --> 00:19:21,360 ripple all the time 551 00:19:19,520 --> 00:19:23,200 so to see how this works i'm going to 552 00:19:21,360 --> 00:19:25,440 write an example program 553 00:19:23,200 --> 00:19:27,280 where i am asking the user to type in 554 00:19:25,440 --> 00:19:29,440 the temperature in celsius and then i am 555 00:19:27,280 --> 00:19:31,600 converting it to fahrenheit it's a 556 00:19:29,440 --> 00:19:33,840 relatively straightforward program 557 00:19:31,600 --> 00:19:35,679 um but we'll see how it's still easy to 558 00:19:33,840 --> 00:19:38,160 get it wrong in python 559 00:19:35,679 --> 00:19:42,160 so i write a little bit of code and i 560 00:19:38,160 --> 00:19:44,480 run it i type in the value 40. 561 00:19:42,160 --> 00:19:46,080 and i can see that my celsius variable 562 00:19:44,480 --> 00:19:48,320 is now set to 40. right it's got a 563 00:19:46,080 --> 00:19:50,160 little bit of text here that tells me 564 00:19:48,320 --> 00:19:51,760 what it's actually doing so i start 565 00:19:50,160 --> 00:19:55,120 writing the next part 566 00:19:51,760 --> 00:19:58,080 it remembers that i typed in 40 567 00:19:55,120 --> 00:19:59,840 and it continues to write 568 00:19:58,080 --> 00:20:02,720 the pro it continues to rerun the 569 00:19:59,840 --> 00:20:03,919 program with the last text input that i 570 00:20:02,720 --> 00:20:06,720 gave it 571 00:20:03,919 --> 00:20:09,120 but i can see here that as i'm just 572 00:20:06,720 --> 00:20:11,360 starting to calculate the fahrenheit uh 573 00:20:09,120 --> 00:20:14,799 my fahrenheit variable is being set to 574 00:20:11,360 --> 00:20:15,600 40 40 40 40 40 40 40 40 40 40 40 40. 575 00:20:14,799 --> 00:20:17,840 right 576 00:20:15,600 --> 00:20:19,760 and i can immediately see wait a minute 577 00:20:17,840 --> 00:20:20,400 that's not right there's something wrong 578 00:20:19,760 --> 00:20:22,080 here 579 00:20:20,400 --> 00:20:24,240 and start to investigate 580 00:20:22,080 --> 00:20:25,600 now instead of kind of going instead of 581 00:20:24,240 --> 00:20:27,280 the student then going 582 00:20:25,600 --> 00:20:29,120 what the hell is going on 583 00:20:27,280 --> 00:20:30,240 they can look at what the code is doing 584 00:20:29,120 --> 00:20:32,400 and go oh 585 00:20:30,240 --> 00:20:33,840 um maybe i've seen this before maybe 586 00:20:32,400 --> 00:20:35,760 this is something specific i can look up 587 00:20:33,840 --> 00:20:38,080 or ask a teacher about 588 00:20:35,760 --> 00:20:40,559 this is a string and the celsius 589 00:20:38,080 --> 00:20:42,559 variable was a string and a string times 590 00:20:40,559 --> 00:20:43,600 a number repeats that string over and 591 00:20:42,559 --> 00:20:45,919 over again 592 00:20:43,600 --> 00:20:48,159 so it's very obvious what's going on and 593 00:20:45,919 --> 00:20:49,520 notice that i can do this and i can see 594 00:20:48,159 --> 00:20:51,600 what's happening and i can see what the 595 00:20:49,520 --> 00:20:54,000 bug with the program is without having 596 00:20:51,600 --> 00:20:56,159 to add print statements anywhere or go 597 00:20:54,000 --> 00:20:57,919 into a step-by-step debugger to be able 598 00:20:56,159 --> 00:21:00,320 to find that 599 00:20:57,919 --> 00:21:03,280 so if we keep going we can set the 600 00:21:00,320 --> 00:21:04,559 celsius variable to like the ant version 601 00:21:03,280 --> 00:21:07,440 of the input or we could use a float if 602 00:21:04,559 --> 00:21:09,039 we wanted to support floats um and now i 603 00:21:07,440 --> 00:21:11,520 can immediately see that that has solved 604 00:21:09,039 --> 00:21:14,480 my problem and i can continue writing uh 605 00:21:11,520 --> 00:21:17,200 the calculation for fahrenheit 606 00:21:14,480 --> 00:21:19,120 so i calculate it plus 32 607 00:21:17,200 --> 00:21:20,880 okay 104 that actually seems like the 608 00:21:19,120 --> 00:21:23,840 right kind of number that i'm looking 609 00:21:20,880 --> 00:21:24,720 for for fahrenheit um and i can print it 610 00:21:23,840 --> 00:21:26,640 out 611 00:21:24,720 --> 00:21:28,880 uh in the same way maybe i'm writing 612 00:21:26,640 --> 00:21:32,400 some more stuff and i find that 613 00:21:28,880 --> 00:21:35,360 uh because i cannot add a string and an 614 00:21:32,400 --> 00:21:37,760 integer um i get a type error 615 00:21:35,360 --> 00:21:40,640 this error is easy to easier to identify 616 00:21:37,760 --> 00:21:43,360 because it puts the error right next to 617 00:21:40,640 --> 00:21:45,440 where the line is that caused the error 618 00:21:43,360 --> 00:21:48,080 so i can go all right yep the fahrenheit 619 00:21:45,440 --> 00:21:49,520 i need to convert that into a string 620 00:21:48,080 --> 00:21:51,760 okay 621 00:21:49,520 --> 00:21:55,360 so now i have a program that works uh in 622 00:21:51,760 --> 00:21:57,200 the same way if i have an if um 623 00:21:55,360 --> 00:21:59,440 and i want to say if it's if the 624 00:21:57,200 --> 00:22:03,120 fahrenheit temperature is greater than 625 00:21:59,440 --> 00:22:04,720 100 then uh friend like it's really hot 626 00:22:03,120 --> 00:22:06,000 now again this whole time since i 627 00:22:04,720 --> 00:22:07,520 started writing the program i haven't 628 00:22:06,000 --> 00:22:08,960 hit the run button once it has 629 00:22:07,520 --> 00:22:11,360 continually 630 00:22:08,960 --> 00:22:13,600 rerun the program uh every time i've 631 00:22:11,360 --> 00:22:15,360 changed it so that i can immediately see 632 00:22:13,600 --> 00:22:18,240 the effects of any changes that i make 633 00:22:15,360 --> 00:22:20,000 to the code if i change the the if then 634 00:22:18,240 --> 00:22:21,760 i can immediately see that the result of 635 00:22:20,000 --> 00:22:23,760 the if is different and whether or not 636 00:22:21,760 --> 00:22:25,760 that line of code has been run 637 00:22:23,760 --> 00:22:27,679 now this is great for 638 00:22:25,760 --> 00:22:29,520 lines of code that are only ever run 639 00:22:27,679 --> 00:22:32,080 once what happens if you have something 640 00:22:29,520 --> 00:22:34,159 like a while loop where the code is run 641 00:22:32,080 --> 00:22:36,400 again and again 642 00:22:34,159 --> 00:22:37,840 and so there's a solution for that too 643 00:22:36,400 --> 00:22:39,440 if you have a function 644 00:22:37,840 --> 00:22:41,919 it can show you maybe this function was 645 00:22:39,440 --> 00:22:42,640 called multiple times 646 00:22:41,919 --> 00:22:44,960 and 647 00:22:42,640 --> 00:22:46,240 we can see that uh what is going on when 648 00:22:44,960 --> 00:22:48,400 i run this function 649 00:22:46,240 --> 00:22:49,919 now when i run it automatically i do put 650 00:22:48,400 --> 00:22:51,120 a limit on how many iterations you can 651 00:22:49,919 --> 00:22:53,039 do because it's all too easy to 652 00:22:51,120 --> 00:22:54,880 accidentally write an infinite loop but 653 00:22:53,039 --> 00:22:56,240 when you run it manually it doesn't have 654 00:22:54,880 --> 00:22:58,480 any limit on the iteration so you can 655 00:22:56,240 --> 00:23:00,320 still write an infinite loop and see it 656 00:22:58,480 --> 00:23:02,880 going until you hit stop 657 00:23:00,320 --> 00:23:05,280 um but i can see here that like my 658 00:23:02,880 --> 00:23:07,679 while loop ran 100 times and if i change 659 00:23:05,280 --> 00:23:09,280 it to add 10 every time it only runs 10 660 00:23:07,679 --> 00:23:11,120 times 661 00:23:09,280 --> 00:23:12,880 and this is again i could see what was 662 00:23:11,120 --> 00:23:14,799 going on without having to print 663 00:23:12,880 --> 00:23:16,880 anything to the console but if i do 664 00:23:14,799 --> 00:23:19,440 print stuff i can also see 665 00:23:16,880 --> 00:23:23,039 what the output of my program is 666 00:23:19,440 --> 00:23:25,120 immediately as soon as it's run 667 00:23:23,039 --> 00:23:26,799 okay so here i can 668 00:23:25,120 --> 00:23:28,240 play around with the variables maybe we 669 00:23:26,799 --> 00:23:29,919 start at a different one a different 670 00:23:28,240 --> 00:23:32,320 number we start at 500 and i can see 671 00:23:29,919 --> 00:23:34,559 that it only runs 500 times now so you 672 00:23:32,320 --> 00:23:36,559 get very immediate feedback 673 00:23:34,559 --> 00:23:39,200 on what your code is doing 674 00:23:36,559 --> 00:23:41,440 and how your code is operating without 675 00:23:39,200 --> 00:23:43,039 having to go through that whole 676 00:23:41,440 --> 00:23:45,600 process of like writing a bit of code 677 00:23:43,039 --> 00:23:47,760 running it writing it running it and 678 00:23:45,600 --> 00:23:50,400 me as a teacher constantly telling my 679 00:23:47,760 --> 00:23:52,000 students to run their code more often 680 00:23:50,400 --> 00:23:54,080 to build it up a little bit by a little 681 00:23:52,000 --> 00:23:55,279 bit uh and also to add more print 682 00:23:54,080 --> 00:23:56,480 statements if they're struggling to 683 00:23:55,279 --> 00:23:58,400 figure out why their code isn't doing 684 00:23:56,480 --> 00:24:00,080 what they wanted it to do none of those 685 00:23:58,400 --> 00:24:01,440 things that would be necessary anymore 686 00:24:00,080 --> 00:24:02,840 if they could get that kind of real-time 687 00:24:01,440 --> 00:24:04,400 feedback 688 00:24:02,840 --> 00:24:06,720 automatically 689 00:24:04,400 --> 00:24:09,120 so this last part uh real python with no 690 00:24:06,720 --> 00:24:11,200 limitations um as you can see at the 691 00:24:09,120 --> 00:24:13,200 moment it only does text input and 692 00:24:11,200 --> 00:24:14,799 output right and that's not not really 693 00:24:13,200 --> 00:24:16,720 good enough it really needs to do 694 00:24:14,799 --> 00:24:18,000 something exciting um which it doesn't 695 00:24:16,720 --> 00:24:19,279 do yet that part is still under 696 00:24:18,000 --> 00:24:21,919 construction 697 00:24:19,279 --> 00:24:24,080 but uh the code is 698 00:24:21,919 --> 00:24:24,880 as close as you can possibly get 699 00:24:24,080 --> 00:24:28,080 to 700 00:24:24,880 --> 00:24:29,840 real python code in the way that the 701 00:24:28,080 --> 00:24:33,120 operators work and the way that you can 702 00:24:29,840 --> 00:24:36,159 do like dot to get um attributes or 703 00:24:33,120 --> 00:24:38,400 methods on an object so here we can do 704 00:24:36,159 --> 00:24:40,880 a variable.upper to get the uppercase 705 00:24:38,400 --> 00:24:42,320 version of it um we can do replace we 706 00:24:40,880 --> 00:24:44,080 get the same errors that we get from 707 00:24:42,320 --> 00:24:45,200 python um 708 00:24:44,080 --> 00:24:46,559 it does 709 00:24:45,200 --> 00:24:48,080 everything in the same way that python 710 00:24:46,559 --> 00:24:51,440 does it because it is literally writing 711 00:24:48,080 --> 00:24:52,320 and running python code um 712 00:24:51,440 --> 00:24:54,080 so 713 00:24:52,320 --> 00:24:56,400 aside from adding some more features 714 00:24:54,080 --> 00:24:59,360 into the syntax um 715 00:24:56,400 --> 00:25:01,760 it's not dependent on having a specific 716 00:24:59,360 --> 00:25:04,000 block built for every kind of function 717 00:25:01,760 --> 00:25:05,679 that you might want to use because the 718 00:25:04,000 --> 00:25:07,520 blocks are built in a generic way that 719 00:25:05,679 --> 00:25:09,279 you can call any function or you can 720 00:25:07,520 --> 00:25:11,520 call any method 721 00:25:09,279 --> 00:25:12,320 or attribute on an object 722 00:25:11,520 --> 00:25:14,240 so 723 00:25:12,320 --> 00:25:15,919 there is more work to do to support 724 00:25:14,240 --> 00:25:18,240 lists and dictionaries to support 725 00:25:15,919 --> 00:25:20,159 functions and classes um but it should 726 00:25:18,240 --> 00:25:22,080 be possible to just say 727 00:25:20,159 --> 00:25:24,400 i can do an import and i have full 728 00:25:22,080 --> 00:25:26,320 access to the standard library um it 729 00:25:24,400 --> 00:25:27,360 should be possible to do third-party 730 00:25:26,320 --> 00:25:30,559 libraries 731 00:25:27,360 --> 00:25:32,880 and other things where you can just use 732 00:25:30,559 --> 00:25:35,840 all of the flexibility that is out there 733 00:25:32,880 --> 00:25:38,240 in python in your code without having to 734 00:25:35,840 --> 00:25:40,320 write text python uh to be able to get 735 00:25:38,240 --> 00:25:42,240 that kind of flexibility 736 00:25:40,320 --> 00:25:43,520 so that's the goal it's not there yet um 737 00:25:42,240 --> 00:25:45,360 we'll see how we go 738 00:25:43,520 --> 00:25:47,440 so these are the four goals uh that i am 739 00:25:45,360 --> 00:25:49,679 working towards i want it to be easy to 740 00:25:47,440 --> 00:25:52,080 start uh have a smooth transition to 741 00:25:49,679 --> 00:25:54,000 text-based python have that really fast 742 00:25:52,080 --> 00:25:55,840 feedback and iterative process to 743 00:25:54,000 --> 00:25:58,080 writing the code so you can immediately 744 00:25:55,840 --> 00:26:00,000 see what your code is doing 745 00:25:58,080 --> 00:26:02,559 and to have it be 746 00:26:00,000 --> 00:26:04,159 the full flexibility of being able to 747 00:26:02,559 --> 00:26:05,840 write python 748 00:26:04,159 --> 00:26:07,279 rather than being like a walled garden 749 00:26:05,840 --> 00:26:09,279 of only these blocks are available to 750 00:26:07,279 --> 00:26:10,799 you 751 00:26:09,279 --> 00:26:12,880 uh the next steps of the things i'm 752 00:26:10,799 --> 00:26:13,760 going to be working on um there are some 753 00:26:12,880 --> 00:26:15,520 sort of 754 00:26:13,760 --> 00:26:18,000 things that make the editing process a 755 00:26:15,520 --> 00:26:20,240 little bit uh tricky or confusing at 756 00:26:18,000 --> 00:26:22,960 times i'm going to smooth out those um 757 00:26:20,240 --> 00:26:25,039 i'm going to add cloud storage and the 758 00:26:22,960 --> 00:26:26,480 ability to share your code this is 759 00:26:25,039 --> 00:26:28,320 particularly important for remote 760 00:26:26,480 --> 00:26:29,760 learning um 761 00:26:28,320 --> 00:26:32,080 but more importantly i really want to 762 00:26:29,760 --> 00:26:34,320 add the ability to build meaningful and 763 00:26:32,080 --> 00:26:36,720 interesting programs that are engaging 764 00:26:34,320 --> 00:26:38,400 for students in high school and things 765 00:26:36,720 --> 00:26:41,120 like building a discord bot 766 00:26:38,400 --> 00:26:43,600 or some data analysis and visualization 767 00:26:41,120 --> 00:26:46,320 or 2d games um or the ability to write 768 00:26:43,600 --> 00:26:48,559 micro python or circuit python code um i 769 00:26:46,320 --> 00:26:50,960 would love for you if you're a teacher 770 00:26:48,559 --> 00:26:52,400 of any kind to tell me what it is that 771 00:26:50,960 --> 00:26:54,559 you think your students would be most 772 00:26:52,400 --> 00:26:56,240 excited about building 773 00:26:54,559 --> 00:26:58,159 and i can focus on those kinds of 774 00:26:56,240 --> 00:26:59,919 programs first 775 00:26:58,159 --> 00:27:01,279 so please do reach out to me i'm very 776 00:26:59,919 --> 00:27:02,640 contactable 777 00:27:01,279 --> 00:27:05,440 um 778 00:27:02,640 --> 00:27:07,840 because i want split code to be 779 00:27:05,440 --> 00:27:11,520 something that does entirely bridge this 780 00:27:07,840 --> 00:27:13,360 gap where you can start on split code 781 00:27:11,520 --> 00:27:14,640 when coming from a block based language 782 00:27:13,360 --> 00:27:16,960 like scratch 783 00:27:14,640 --> 00:27:19,360 and where you can build interesting and 784 00:27:16,960 --> 00:27:21,279 cool things with split code and build up 785 00:27:19,360 --> 00:27:23,440 an understanding of how python works and 786 00:27:21,279 --> 00:27:25,440 how programming works um and make an 787 00:27:23,440 --> 00:27:27,600 easier transition into python or other 788 00:27:25,440 --> 00:27:29,840 kinds of text-based coding 789 00:27:27,600 --> 00:27:31,600 so that's what i want to build uh thank 790 00:27:29,840 --> 00:27:32,720 you and uh if you would like to know 791 00:27:31,600 --> 00:27:34,720 more 792 00:27:32,720 --> 00:27:36,720 there's a site splitcode.io where you 793 00:27:34,720 --> 00:27:38,880 can sign up to the mailing list but 794 00:27:36,720 --> 00:27:41,520 please also reach out to me in the chat 795 00:27:38,880 --> 00:27:44,159 please dm me on twitter or send me uh 796 00:27:41,520 --> 00:27:46,559 send me messages anything anything goes 797 00:27:44,159 --> 00:27:47,440 thank you fantastic thank you so much i 798 00:27:46,559 --> 00:27:49,440 i 799 00:27:47,440 --> 00:27:51,760 i've collected together some of the 800 00:27:49,440 --> 00:27:53,520 amazing comments from this chat we have 801 00:27:51,760 --> 00:27:54,720 like two minutes for questions and 802 00:27:53,520 --> 00:27:56,640 there's no way we're gonna get through 803 00:27:54,720 --> 00:27:58,320 all of them um 804 00:27:56,640 --> 00:28:00,960 this one is the highest highest rated 805 00:27:58,320 --> 00:28:02,080 one can sploot use type hinting features 806 00:28:00,960 --> 00:28:04,960 to help autocomplete be more 807 00:28:02,080 --> 00:28:06,880 contextually aware 808 00:28:04,960 --> 00:28:08,880 um so i was hoping that autocomplete 809 00:28:06,880 --> 00:28:10,640 would be good enough with just the 810 00:28:08,880 --> 00:28:13,120 rundime information if you happen to 811 00:28:10,640 --> 00:28:15,120 know that a variable is of a particular 812 00:28:13,120 --> 00:28:17,600 type at runtime 813 00:28:15,120 --> 00:28:20,559 that makes it possible to get all of the 814 00:28:17,600 --> 00:28:22,720 autocomplete help that you would get 815 00:28:20,559 --> 00:28:25,360 from type hints without actually needing 816 00:28:22,720 --> 00:28:28,720 to write the type hints in 817 00:28:25,360 --> 00:28:31,919 um adding tie pins would make the syntax 818 00:28:28,720 --> 00:28:33,840 quite a bit more complicated um 819 00:28:31,919 --> 00:28:36,080 we could potentially in the future add 820 00:28:33,840 --> 00:28:38,000 type hints into the syntax 821 00:28:36,080 --> 00:28:40,000 but i'm hoping that for most students 822 00:28:38,000 --> 00:28:41,919 the ability to build interesting things 823 00:28:40,000 --> 00:28:44,080 without tie pins 824 00:28:41,919 --> 00:28:47,200 will be made a lot easier by having that 825 00:28:44,080 --> 00:28:48,559 real-time uh runtime feedback uh as to 826 00:28:47,200 --> 00:28:50,159 what you're very you know why do you 827 00:28:48,559 --> 00:28:52,000 need to know the type of your variable 828 00:28:50,159 --> 00:28:53,760 when you know the actual value of your 829 00:28:52,000 --> 00:28:55,039 variable at runtime 830 00:28:53,760 --> 00:28:59,360 yeah 831 00:28:55,039 --> 00:29:00,880 cool yes yes yes um uh more questions 832 00:28:59,360 --> 00:29:03,679 i'm just gonna race through them could 833 00:29:00,880 --> 00:29:05,679 split code easily use micro python and 834 00:29:03,679 --> 00:29:07,919 with a bonus question a simulated device 835 00:29:05,679 --> 00:29:09,200 in the browser could show what a device 836 00:29:07,919 --> 00:29:11,039 might do and if a real device was 837 00:29:09,200 --> 00:29:13,440 connected it would possibly run on the 838 00:29:11,039 --> 00:29:15,120 device would this maybe be possible 839 00:29:13,440 --> 00:29:17,440 uh it is maybe possible it's all a 840 00:29:15,120 --> 00:29:19,360 matter of like how much we can get the 841 00:29:17,440 --> 00:29:21,919 browser to do 842 00:29:19,360 --> 00:29:23,679 um getting that feedback out of the 843 00:29:21,919 --> 00:29:25,919 micro python system might be a little 844 00:29:23,679 --> 00:29:27,760 bit trickier than it is to do with just 845 00:29:25,919 --> 00:29:29,200 python running in the web browser um but 846 00:29:27,760 --> 00:29:30,720 i would love to have it work with 847 00:29:29,200 --> 00:29:32,159 micropython 848 00:29:30,720 --> 00:29:34,159 with micropython simulated in the 849 00:29:32,159 --> 00:29:36,159 browser that would be really awesome 850 00:29:34,159 --> 00:29:38,080 which possibly leads into the next 851 00:29:36,159 --> 00:29:39,600 question that i'm massively going over 852 00:29:38,080 --> 00:29:42,640 time and i'm going to be booted out in a 853 00:29:39,600 --> 00:29:45,440 minute um is split code open source can 854 00:29:42,640 --> 00:29:47,679 people contribute how can we support you 855 00:29:45,440 --> 00:29:49,360 oh i would love to have support um so 856 00:29:47,679 --> 00:29:51,360 split code is not technically open 857 00:29:49,360 --> 00:29:53,679 source i am hoping to make this into an 858 00:29:51,360 --> 00:29:55,360 actual product at some point and so it 859 00:29:53,679 --> 00:29:56,960 is not under a completely open source 860 00:29:55,360 --> 00:29:59,440 license it is under a slightly different 861 00:29:56,960 --> 00:30:02,399 license that being said the code is all 862 00:29:59,440 --> 00:30:04,720 up there on github uh under a license it 863 00:30:02,399 --> 00:30:07,440 will become open source automatically 864 00:30:04,720 --> 00:30:09,520 after a period of years 865 00:30:07,440 --> 00:30:11,120 fantastic do contribute to it but you'll 866 00:30:09,520 --> 00:30:12,880 have to agree to a license 867 00:30:11,120 --> 00:30:15,440 excellent uh and i imagine they can 868 00:30:12,880 --> 00:30:18,000 contact you by the means on this twitter 869 00:30:15,440 --> 00:30:20,559 to find out more if they have questions 870 00:30:18,000 --> 00:30:22,559 um there are a number of other questions 871 00:30:20,559 --> 00:30:23,919 ah can split could also output python or 872 00:30:22,559 --> 00:30:25,279 other language syntax so the user can 873 00:30:23,919 --> 00:30:26,880 see how their program would look in the 874 00:30:25,279 --> 00:30:28,080 actual language 875 00:30:26,880 --> 00:30:29,760 yes i am 876 00:30:28,080 --> 00:30:32,080 planning to add a feature where you can 877 00:30:29,760 --> 00:30:33,919 see the python code that is generated uh 878 00:30:32,080 --> 00:30:35,840 it should also be possible to edit said 879 00:30:33,919 --> 00:30:37,600 python code and bring it back into 880 00:30:35,840 --> 00:30:40,159 sploot code 881 00:30:37,600 --> 00:30:42,080 and in as many times as you want to um 882 00:30:40,159 --> 00:30:43,919 that is a feature once sploot code 883 00:30:42,080 --> 00:30:45,600 supports much more of the python syntax 884 00:30:43,919 --> 00:30:46,720 than it currently does though that is 885 00:30:45,600 --> 00:30:48,000 very shiny okay there are a million 886 00:30:46,720 --> 00:30:50,880 other questions i'm going to throw them 887 00:30:48,000 --> 00:30:53,279 over into the hallway 888 00:30:50,880 --> 00:30:55,600 thank you so much katie that was 889 00:30:53,279 --> 00:30:58,720 fantastic um thank you so much for 890 00:30:55,600 --> 00:31:02,159 joining us um next up 891 00:30:58,720 --> 00:31:04,880 after a short break uh we have 10 tips 892 00:31:02,159 --> 00:31:07,679 for teaching technical topics from tom 893 00:31:04,880 --> 00:31:09,600 uh stay tuned for more alliteration um 894 00:31:07,679 --> 00:31:12,320 katie thank you thank you so much thank 895 00:31:09,600 --> 00:31:15,720 you for joining us um you're fantastic 896 00:31:12,320 --> 00:31:15,720 i'm so keen 897 00:31:23,360 --> 00:31:25,440 you