 Thank you very much. Can everybody hear me? All those people at the back checking your email. I just want to make sure you can ignore me nicely. Okay, so my name is Nicholas. I'm a recovering Python programmer. And I'm going to tell you the story of Mu, which is a code editor, which I've been involved in helping to write. I used to be a school teacher. That will become relevant as the talk progresses. And the Mu editor is, I guess, a further expression of my passion for all things educational. So what exactly is Mu? Well, as it says, Mu is a code editor for beginner programmers. And this talk is, I guess, a sort of a who, what, how, and why sort of a talk where I try and answer those four questions. And I'm going to, I guess, tell you some of the gory details as well about this story as well. So, first of all, who on earth needs yet another code editor? Well, Microbit did. So, if you're not aware, the Python Software Foundation were a partner with the BBC Microbit project. And I was involved in that. And one of the things that we needed to do was create a Python ID for a browser. And being the good software developer that I am, I hope, I went and asked the folks that were using this browser-based editor what they thought of it. And whilst they acknowledged that being able to use Python in the browser and getting MicroPython and things, working from that medium was kind of convenient. You just point a browser at a URL. You couldn't get things like a REPL. It was a bit of a pain in the neck because when you wanted to get the MicroPython on to the device, you had to click a button and download a thing, then work out where the thing was, and then drag it over to the thing, and then it goes syntax error at line 10. You have to go through the whole rigmarole. So, the Mew editor was born. This is a very simple code editor that complements the browser-based ID that I created for the Microbit project. Mew was itself a PSF contribution to that. Interestingly, nobody really asked the teachers or the students what they wanted, so this is something that I started to do as well. So, hey presto, once Sunday afternoon when I got all this feedback about browser-based editors and things, I asked myself, how hard can it be to write a code editor? You know? So, we were off. Mew has since grown quite a lot since then. So, let's just think about this. Often tools for developing software are written by software developers for software developers. I want you to try and imagine what encountering these tools might feel like for a beginner programmer. By beginner, I mean not necessarily a child. It could be an adult who's coming to coding for the first time. The fact that you're laughing, and I've not even started my sentence, tells you a lot about what I'm about to tell you. There are two extremes, I guess. There's the Uber minimalist editor. This is Vim. I'm a Vim user, and I'm waving my arms like this. And to a beginner programmer, how does this look? Well, it's a big red danger button. There's only one thing, but what does it do? There's no feedback. It's hard to know how to engage with this. Let alone make it do anything useful. The alternative is the sort of maximalist approach. You're a beginner programmer. Where do you type the code? What do all the buttons mean? What's all the information? This is information intimidation. I guess it's the sort of IDE version of a 747 flight deck. I think that might be the space shuttle or something like that. There's just buttons everywhere. Now, as power users, we either know all our Vim key bindings and I just saw Tiago's talk next door using the turtle model, and he was on fire. There was code flying all over the place, and it was a joy to watch. Tiago is obviously an expert BI user. Or your IDE has all the buttons and you know exactly intuitively what each of these things mean. You can make the code as you're typing it and things, but you're a beginner programmer and this is intimidating. What could we do? One way to overcome this problem is to simplify. But we have to ask ourselves what do we simplify? Some people simplify the code. How many of you are familiar with what's currently on the screen at the moment? That's actually less than I thought there would be. This is scratch which is a graphical programming language and what you do is you move blocks around and then when you click the play button the little cat goes on adventures. Like a turtle, he'll move forward and rotate 90 degrees or you can flip him or you can say if he's collided with this strawberry then make a squelch sound or something like that. That's simplifying coding though because I'm sure that many of you wouldn't want to write a website using scratch for instance or PyTorch or something like that. This feels to me like it's simplifying and that's a good thing. You can get basic core concepts of programming through to children in a wonderfully visual way loops and things like that but it's not the real thing. The reason I mentioned the real thing this is Alan Kay. How many of you have heard of Alan Kay? Okay, oh my gosh. So Alan Kay is sort of one of the gods of programming language design. He invented object-oriented programming basically. I read this quote from an interview a couple of years ago and the line I want to bring your attention to is at the end and this is his approach to trying to create tools for beginners. The idea is you never let the child do something that isn't the real thing but you have to work your ass off to figure out what the real thing is in the context of the way their minds are working at that development level. He also mentions other complicated skills that people have to pick up do similar sorts of things. He talks about sport, he talks about music which is something I'm passionate about and I've been on the receiving end of a music education. This really spoke to me. Is this a case of simplifying programming? Could we simplify the tools is the question that we're asking. Mu is a Python editor for beginners and it's the real thing. So what do I mean? What do folks need when they're beginner programmers? We took the rather unique step of actually collaborating with lots of beginners and teachers and asking them what they wanted as well as being programmers ourselves and we used our kind of sixth sense developer Spidey sense to go well do you know what they're asking for the moon on a stick and actually because we're professional developers we kind of know the trajectory where they're going and so perhaps we can help guide them we know where they are and we know where they're probably going to end up it's somewhere around here so how do we get them to where they need to be. So what we want to know is what exactly do we need to implement in an editor to help a beginner programmer access a real programming environment in a way that's not intimidating in some sense. Interestingly enough we all seem to have opinions about editors and I've been on the receiving end of all sorts of interesting feedback about Mu as a result of this it's not only just the VI versus Emax there's all sorts of interesting commentary about what should or shouldn't be in an editor but the important thing is that our focus isn't on us as developers or what does a developer want it's what does a beginner want so we're asking ourselves do we have the empathy to appreciate what our target user base needs and so what do we do we obsess over user feedback I regularly go into schools and I observe teachers teaching Python so this is a teacher doing perhaps the most teacherish thing you'll see all week pointing at a whiteboard that's had Mu projected on it and I go and observe lessons I watch beginner young beginner programmers try and struggle with Mu and we get to see what the bumps in the roads are and things like that and I also teach Python as well so I use Python with older beginner coders as well and this is what happened at the beginners day at your Python on Tuesday as well we were all using Mu like funny goofy cat games and web servers and things like that it was rather nice so we need to try and work out what are the real features that folks like this teacher and his students need well we need to meet these users halfway so I'm going to give you an example so this is the debugger it's halfway through running I'll tell you when it starts okay we're going to start again now okay so you can drop a breakpoint in I click debug it hits the breakpoint I can do simple things like step over notice there's only a few buttons these are the core things that a debugger actually does you've got a place that's not a new window so you're not losing your code running behind other things where you can type things in you've got some sort of inspector going on but it's really very simple you can step into other functions okay so you're getting these notions of how do I use a debugger in a visual graphical sort of a way okay so the important thing is that when you next go when you graduate from Mu to perhaps that second sort of editor with a graphical debugger you've got these concepts already from Mu Mu has only introduced these concepts with four buttons and they try to make it as clear and obvious as possible what these things do okay so this is maybe training wheels to borrow one of Dan Pope's phrases it's training wheels for the tools that we use for programming okay so you then go and use VS code or pie charm or whatever the latest kind of editor hotness is and that has a debugger in these sorts of concepts become familiar are already familiar and you've got the context the cultural context you need to be able to engage with those tools and then fly as a new developer so we do this a lot with all the different features that we have in Mu so we have simple versions of all sorts of different things where we try and make we try and make the buttons represent particular concepts like flash to a particular device or upload to a web server if they're writing a website things like that okay another thing that we do is that we try and meet our users halfway when it comes to language as well one of the things that I did whilst I was researching Mu was try and work out well we're in Europe we have lots of languages but Python is an English language programming language and how do say for example French teachers address this and the feedback that I got when I was in Paris speaking to a whole bunch of French teachers I mean French teachers of programming not teachers of the French language was that kids get that Python is English but there aren't that many keywords that they need to have to learn so if else if that sort of stuff it's not a problem but what they do have a problem with is the fact that the tools that they might be using are also all in English and they might not have the English literacy skills to be able to access those tools properly so we may be certain that the interface for Mu could be very easily translated you type a command the thing comes up you translate it into whatever languages you want and then you create a pull request for us and it comes back and so this is French I particularly like the French translation because all the well many of the words actually sound like the English equivalents but with a funny French accent the way they're spelt so it's not a debugger it's a debugger I also like the fact that to zoom in and to zoom out is zoom out and dis zoom out and this reminded me of my failed attempts at learning French as a student and you know in French they have e r verbs and i r verbs and r e verbs and it just got me thinking re ju zoom, tu zoom, il zoom nous zoomons, vous zoomez he's sort of doing all this sort of stuff anyway we have lots of different translations Chinese is quite popular because we have lots of users in China and so it's wonderful to see this as also a way to engage with the community of developers who are out there if you are a developer from somewhere and you want to contribute one of the first things that you could do is if your language has not been translated it has not been used to translate go make a translation for us if it has already then go check it as well I have to admit when I take these pull requests again borrowing from Dan Pope I kind of check a few of the google a few of the translations in google translate and if it's sort of approximately is what I was expecting then I go well that's probably alright because you know I'm not a Chinese or Urdu speaker or something like that okay so we do check okay so we meet our users halfway in terms of their accessibility needs as well and when I say accessibility I don't just mean language skills as well education is for everyone we can't exclude people from taking part in education it's not like you can say well programming it's just for the kids that are enthusiastic everybody should be given an opportunity to learn to program so our software should be inclusive and accessibility is the key to this now again part of the research from you involved working with the chap you're about to see I have a video for you he's called Ben and he's a software developer at the BBC but he is blind and some of the things that we've been doing is that we've been reaching out to communities of learners who might have in the UK we call them special educational needs which means that they might have some aspect of their life which means that accessibility to common regular educational resources is a bit of a challenge reaching out to these folks to actually ask them what would work it's important to give these users a voice I'm just going to play this video and if I can find my pointer and move the video back there's Ben and you get to learn all sorts of fascinating things that I as a software developer would never have even thought of and this is a great example of this it doesn't impact mew directly but this is a rather wonderful thing to learn from a blind developer we're working on me and this is a standard Windows machine that's running a screen reader called NBDA which is open source it's actually written in Python so it's fairly appropriate for this one I think it seems we're working on mew how about we run with you and we'll see what it's like so I haven't even used auto complete for you so I'll press enter OK why is it sounding what's going on there so that was talking so that doesn't actually sound that fast to me that sounds just a little bit faster than humans speech really wow so that just sounds probably sort of less than 20% faster than the speed that you're talking at then I feel to me don't you believe it so the point I'm trying to make is that if you ask your users or help them to tell their stories you'll learn all sorts of interesting things another interesting version of this story is that teachers when they are presenting when they're using things like idle or other professional programming languages and you've got people sat at the back of the class and they're losing attention and things like that and why is that? that's because they can't actually see the code on the screen so two of the buttons that we have well as you know in French they're zoomer and desumer we have zoom in and zoom out and these are used an awful lot as part of the sort of as well and the first time I showed this to a group of teachers and let's be honest here making things bigger and smaller is not a difficult thing to do with the GUI framework that I'll be talking about in a moment they were like how did you do that? because what they were used to was well you've got to go to edit then settings and then font size and then scroll down a bit and then you have to kind of guess what the numbers mean that might be oh no no no that's too big so that said break in five minutes okay so I'm going to speed up then so the important thing is that we've put our users at the centre of our development so how on earth did we build Mew well Mew actually is only 4,000 lines of Python it's a relatively small project it's a modal editor I'm a VI user so this allows us to simplify the user interface an awful lot we have 100% test coverage as well and we've tried to automate all the things so when we submit to master within about five minutes we have a windows installable an OS 10 installable and all that sort of stuff ready to go so the most interesting aspect I guess that you might be interested to hear about is what's it like doing cross-platform GUI so there are several options that we could use there's TK Inter it's simple and it comes with Python but it looks like it's from the 1990s which of course it is and it doesn't work with screen readers so the accessibility doesn't work DewX Windows is a cross-platform native looking GUI toolset but at the time we started Mew there was no Python 3 support and we actively maintained although this has now changed GTK well which one? 2 or 3 that kind of cross-platform but Raspberry Pi only supports GTK 2 and Raspberry Pi being an educational machine is something that we particularly wanted to target and it doesn't particularly look native on Windows and OS 10 it looks like a Linux application so we looked at PyCute again native looking cross-platform GUI with everything but the kitchen sink but again we have the Qt4 or Qt5 actually PyCute itself is a shim around the C API so it's kind of a non-pythonic API and it also includes Qt versions of absolutely everything like threading and so on and so forth so you could go the Python way or the Qt way so actually what we did is we made a Faustian bargain with PyCute why is it Faustian? Well PyCute unlocked lots of features so we could use the Qsintilla widget which is a very mature code at this time widget that we could use but it has a very complicated C API that honest I spend hours just trying to figure out what the documentation is going on a lot of experimentation there when we're trying to debug that it has a cross-platform look and feel but then teachers told us actually we wanted to look the same a neutral in all the different UIs that we use so that any of the resources that we create will work on OS 10 Windows and so on and so forth it needs to it has accessibility for all so it's got a good support for OS's built-in accessibility except the screen readers are brittle so it appears that certain screen readers do or don't depending on whether it's a Thursday or not so getting a screen reader to work it is hard we also get a cute console which gives us an IPython REPL as well thanks to Thomas Cliver for that but that starts to pull in IPython now and we're starting to get packaging creep as well so Mew is starting to get bigger and bigger and then of course we come to how do you package Mew I love this this was from the open spaces in Pycon US a couple of months ago packaging is great and fun and there are never any problems if only that with a case here's what we do for Windows we use something called Pinsys again by Thomas it's super simple and actually has the advantage of really working whereas other options didn't for various complicated reasons complicated because it would take two or three weeks to actually go through all the rigmarole of trying to work out why the damn thing didn't work now as 10 use Bware's briefcase again the same sort of thing happens if you're not aware of Bware they do some amazing work and Russell and all the others do an amazing job with that their documentation is fantastic for Linux just buy a Debbie and maintain her a beer or get him drunk over a curry or get a Fedora developer and get her to say yes to package this thing for you and it makes a long long time but it has the advantage if you have the upstream package in place then everything else eventually catches up and it filters in PyPI, Mew is installable through PIP that's the easiest way to get Mew installed on your computer in a virtual M if you are a Python developer and of course like I mentioned all the installers and everything are automatically built and continuous integration as well so why I've got two minutes left so why are we doing this so what we are trying to do is create a programming culture and I want to use a musical metaphor so a beginner is like this young lady with her violin was entertaining the local cats at some point Nicola Benedetti fiddle player didn't know how to play the violin and was entertaining the local cats so how do musicians get from this to this or this, this is Ali Beal he's a famous folk fiddle from Shetland that's terrible or maybe this getting a whole bunch of violinists to work together or how do we get that little girl to maybe just playing the fiddle in her local pub amateur kind of folk music or maybe, I don't know even this who knows the important thing about music is there are lots of different cultures going on and the violin is the tool that gets you into that particular culture and the violin allows you to find your level in that culture not many people end up being a concert violinist but rather a lot of people enjoy playing the fiddle in the pub when it's their local folk session so mu to me is sort of like a violinist like the instrument that we're helping people to come to not music but coding and then when they become competent at mu they can graduate away to pie charm or visual studio code or some of the other editors that you see out in the hallway it's a graduation process if you're using mu professionally you probably shouldn't be doing that and I'm the mu author and I'm telling you you shouldn't be doing that you should be using something professional so what are we doing? By making mu in a certain sort of a way by being explicitly open source we're demonstrating a certain sort of programming culture so this means that mu is also the means of passing on such a culture as well not only is it the tool that lets you code by the way that we develop mu we're demonstrating that culture too and that culture is open, collaborative supportive, all the things that we hope the piping community to be and then so is mu we take great pains of trying to be a welcoming community so my call to action this is my last slide you'll be relieved to hear is simply this education makes our future possible and what that future is depends on who turns up to provide an education or provides the tools for that education so my call to you is don't just sit there do something and that's what we're trying to do with mu that's it, the end, thank you very much thank you Nicholas we do have a couple of minutes for questions if you have any, there's microphones in the aisles hi, I heard you were talking about micro python if you're working on it yourself as well, if I heard correctly you are using micro python yourself yes, I use micro python I was just going to ask whether mu helps with deployment and remote debugging or is it not included in this deployment to micro python devices and debugging, remote debugging is it involved in mu? yes, so mu was originally created for the micro bit which was a micro python based device it also supports any circuit python based device, aid of fruit we make circuit python and provide a whole bunch of funky boards they contributed a large part of the circuit python mode so there's a micro bit mode there's a circuit python mode there's also an ESP mode which works in micro python on those chips as well but remember this is beginner focused so we make it easy for you to do those things but as a power python user you might go okay, I see how mu is doing it and I'm going to go back to V.I. or Emacs or PyCharm or whatever it is you're using super cool so there's less of a question more of a ask how do I get an editor like this in the browser that we can ship on mybinder.org so I obviously wrote the python editor for the micro bit project and that's browser based and it looks similar to mu because I fed a lot of the feedback I got about mu I fed back into the browser based thing so there are editors out there that are browser based one of the things that I would say is that connecting to the REPL, which is important aspect of learning life coding, being able to make things blink and so on in the micro python world anyway is hard because web browsers and USB serial and things, there is an API but it's quite flaky, I've managed to get it working on Chromium but not on Firefox but then it doesn't work on Chromium and blah blah blah blah so I think the state of the browser ecosystem is not mature enough yet to be able to go okay here's a beginner's IDE that we could then package using something like Electron or something like that thus making the packaging story a lot simpler I mean the problem with binder is lots of people use it for workshops and education but we give them like Jupiter textbooks or VS code and that's well, the professional tool and it would be great if we could have an editor but that download view is that it, thank you very much thanks Nicholas