 this video I'm going to be looking at question one from the PDPS workshop. All of these questions have nothing to do with adding new functionality or features to your code, it's all to do with refactoring, making your code more efficient, having good code style and all of the little things that we've tried to practice throughout semester. So question one asks us to list all aspects of the following program that could be improved. So when you're doing these questions or if you're practicing for your exam, what I would recommend is not putting them into processing because processing will tell you where the errors are, if there are errors and you won't have that in your exam. So it's good to just open Notepad or some other default text editor just so you can get into the habit of reformatting or refactoring your code on your own. So we want to have a look at all of the aspects of this code here that could be improved. There's lots of things that could definitely be improved. First of all the indentation. So it's really important to indent your code especially when you are doing one of the module exams because if you're writing a method in the module exam it's really easy to miss out on this last bracket because this code here looks very similar to this code here and when you're in an exam and you're rushing it's easy to you know make small mistakes like that that will stop your code from running and you won't realize that because you're not in processing. So really important to indent your code and also to practice doing that by hand because we know in processing there's the shortcuts to indent it for us. So in the exam what you want to use is a double space and we indent inside each new scope. So whenever we have a function, condition or loop so any curly brackets pretty much we indent everything inside it. So inside this setup function I've indented each of these by doing two spaces. I'm going to break these up as well. I should probably write our answers. So indentation is something that could be improved. So I want to indent everything inside the draw function which is all of this I'll go through. You could use tab as well which is probably what you're used to but in the exam I don't think you can use tab because it will take you to the next text box. Okay so I've indented everything in draw and I also need to indent everything inside my conditional so another two spaces there. There we go that looks a lot better. Another thing that can be improved is our variable names. We had a look at that in variables and conditionals but we want to name our variables meaningful things where possible so that we know what they do especially in big programs like your assignment it's good to be able to keep track of what each variable is doing. If you have a variable name called A that doesn't mean much so meaningful variable names so we have a look at what A is used for it's used for the width and height of our lips in our rectangle so perhaps size or shape size I'm going to do size or is that a keyword I don't think so I'll just do shape size. So again the key with good variable names is to keep it not too vague but also not too long if you create really long variable names shape size of the shapes to be drawn that's pretty inefficient imagine writing that out four times or more but also A is too vague so you want to get that good in between informative but also not too long great so we've got meaningful variable names if we wanted I guess we could remove this background call because we're doing it already there it's not a big deal but we can do that so remove duplicate code and then last of all this is probably if we run this code what you'll see so maybe I should put that in processing what you'll see is a program like this where a circle follows your mouse until you get to the right hand side of the screen and then a circle follows sorry a square follows your mouse as you swap between so it's at width divided by two so if we wanted to make this program scalable maybe we want to change that to width divided by two but again that's not a big deal yeah so that's all of the aspects of this code that can be approved it's quite a short bit of code so not much to improve