After we got our feet wet in OOP, we then focused on ADTs, which were abstract data types. At first, I thought that they were built-in classes in Python, but they're actually classes that we can make with Python's built-in functions. The methods and behavior are the same for everyone, but we can choose how we can make our class in many ways.
I really like how flexible we can be with our implementation, but since I'm still quite rusty when it comes to Python syntax, I might not be able to come up with the best code or algorithm, probably code that just works. To fix that remedy, I'll have to brush up on my Python syntax, especially on immutable and mutable built-in types and their methods.
I did have a lot of trouble trying to follow the implementation of a linked list and why people tend to use linked lists rather than, say, huge lists. I'll see if I can find the answers from my professor's notes and Python code.
Other than that, I started my Assignment 1, which is just an application of what we've learned so far, creating classes and writing up implementations for built-in API. I'm curious to see where I could apply further concepts of CSC148 into the classes I'm implementing as I go along.
I've done two files so far, but I did have some trouble finding where the client code was in our starter code. Luckily, I got an answer when I asked on Piazza, but not what I was expecting: I learned now that client code was not only code that customers and clients would use my classes, but also programmers and other implementors that would want to use my code/classes in their code/classes. It's a really neat definition, but it just made my assignment a lot harder.
Now that I've thought about my assignment, is my list of classes there ADTs? Because I'm assuming that there's a same set of methods and behaviors for each of the classes (for everyone), but everyone can implement them in a different way. Inception.
Midterm's coming up next week, and oof. OOP and ADTs seem pretty intuitive; I might need some practice actually applying them to many different cases. Wish me luck.
No comments:
Post a Comment