Spring '24 Week 5

YouTube Video

Resources

Edited Transcript

Hello and welcome to the week five announcements video for CC410 in spring 2024. This week you should be wrapping up a module on inheritance and polymorphism. We do a quick inheritance example where we use some different things to see how inheritance affects your classes. There’s also a start -stop -continue survey in these modules. That survey is just a quick check -in for me throughout the semester to see how things are going. It gives you a chance to tell me if there’s anything you’d like me to start doing, anything you’d like me to stop doing, or anything that you really like that I’m doing that you want me to continue doing. Just gives you a chance to give some unofficial, anonymous feedback to me via Qualtrics throughout the semester. You should have some time to work on your final project this week and next week. You’ll notice that there’s not a milestone due last week. So yesterday there’s a milestone due next week, so make sure you’re keeping up on that. We have our next final project milestone next week, so you’ll already be meeting with me again to discuss your final project by the end of February.

This week we’re going to introduce some content around debugging and logging and working with Lambda Expressions. Lambda Expressions are an important little piece of code that we use in a lot of our unit tests, specifically when we’re working with inheritance and polymorphism. So you’ll get to see some Lambda Expressions. We’ll also learn a little bit about how we can add debugging and logging to our code. And this is the week where we’re going to have our third restaurant milestone that’s all about inheritance and polymorphism. And like I said this week, you should be scheduling your second final project meeting to be held sometime next week.

The other big important thing about the third milestone is this is the first one where I am enforcing all of the general requirements that we learned in the HelloRealWorld project. That means when I grade your project, I’m going to run all of the automation on it. I’m going to check for style stuff. I’m going to check for looking at typing in Python. Java, you don’t have to worry about typing, but Python, I’ll be looking at typing. I’ll be looking at the style guide. I’ll be looking at code documentation. I’ll be looking at unit tests. Everything that we covered in that HelloRealWorld project, you should now be doing in Milestone 3. There’s kind of an expandable thing at the top of the milestone that tells you all of the things that are I should check. If you don’t follow the style guide, if you don’t have code documentation, I will take points off starting this week. This is really the point of working in an advanced programming class that mimics industry is in industry, if you turn in code that doesn’t match the style guide that doesn’t have documentations, it’s not useful at all. It’s the same as having no code. And so you really need to start learning to keep track of your style, your documentation, doing all of that as part of your coding practice so that you can turn stuff in and not have a huge list of things to change as you get to the end. You’ll also need to be updating your UML diagram to show all the relationships between the classes.

Thankfully, this milestone is not really big. It’s about 1500 lines of code. And I would say, especially when you’re adding the inheritance, you’re probably removing about as much code as you’re adding new code. So it should really come out in the end. And then as always, if any of these milestones are in unclear or anything can be described better, let me know. I always welcome that feedback for ways that I can make milestones a little bit better.

So some quick hints for working on milestone three. First and foremost is work in small chunks. Don’t try and tear everything apart and put it back together. Start by working on a small chunk, for example, entree. Create your item class, your item interface, create the entree class, get those working, and then go through each individual entree class and update them to use the new base class. Work in small chunks, try and get things working a little bit at a time. You’ve got a whole set of unit tests that you can use to run your code. Your unit test should continue to work as you make these changes. You may have to make small little updates to your unit tests as well as you change the structure. Another big thing to do is to take advantage of the fact we’re using get. As you’re making changes, commit early and commit often. A lot of times I see students start pulling stuff apart and then they get way over their head and they want to try and roll back to a previous one. But if you’re not committing every once in a while, then you may have to roll all the way back to the previous milestone to start over. So commit early, commit often, especially as you get stuff done.

This is also a good opportunity to try test -driven development. With test -driven development, you can actually write your unit tests before you start writing your code. So for example, you can write the unit test to confirm that a particular entree is a subclass of entree. You can write that test, it should fail, and then you can update the code until that test succeeds. It’s a really neat way to write code based on unit tests. It also gives you a little bit different way of approaching things. The other question, the other things I usually give as a hint is it’s unclear in the milestone, but you should be inheriting your item or your order item interface on your base classes, not on the individual entrees themselves. The inheritance is transitive, so if your base class inherits the order item interface, then all of its subclasses will inherit it as well. That’s a much cleaner way to do it. And then finally, feel free to ask questions on syntax. This is really the first time we’re using some of this complex syntax in code, especially when dealing with Lambda expressions and really complex inheritance situations. If you are unsure how to do something, don’t be afraid to ask. That is part of the point of this question. class is to have access to a developer that has some experience like me, that I can sit and work with you and answer questions on syntax and structure and style and things like that and really hope you learn how to become a more effective and more efficient programmer yourself.

So looking ahead after this week, next week we’re going to launch into some new content, which is design patterns and test doubles. These are brand new things that you’ve never learned before. If I had to pick one thing out of this class that I think is the most useful, it’s module six and seven, learning how to use design patterns and learning how to use test, test doubles in your unit tests. Both of those are very powerful skills that will serve you well in industry for sure. Then after that, we’ll start introducing graphical user interfaces, talking about event driven programming, and we’ll go on to do some stuff with web APIs, et cetera. So thankfully it’s not snowing out. Last year when I did this video, it was snowing out. And so I had to have the snow gift here. This this winter we seem to have really unseasonably warm weather. So hopefully you’re enjoying it. But if you’re missing the snow, here’s a quick picture of Lucy in the snow. As always, if you have any questions, let me know. Otherwise, best of luck this week and I will see you again in a couple weeks.

Subsections of Spring '24 Week 5