There was nothing new in the course curriculum so far, but I have managed to comprehend how linked lists actually work from an ADT perspective. Implementing the functions and reading the code for linked lists seems pretty hard at first, but I found out that drawing pictures and writing pseudo-code really helps.
I also learned in lab that experienced programmers do draw pictures of what code to write when they implement code similar to linked lists.
And speaking of linked lists, I have a feeling that most of the course is just going to be learning about more ADTs, with some algorithms and recursion, but mostly on other ADTs such as binary trees. I also have no idea how Assignment 2's going to apply all the content we've learned so far, but I did hear from my professor that I'd need a partner to complete it. But enough about Assignment 2, I've got Assignment 1 to complete. I have completed half of the starter code, but I'll have to run a lot of testing and debugging to make sure I take care of all the cases.
As for the midterm, it went pretty well. I was just worried about the extreme time constraint because 50 minutes, for me, is not enough time to even check your work or plan your answers. I realized then that using @param for the docstrings takes too long for such a limited amount of time, so I had to switch to @type in the middle of writing one of the questions. Luckily, most of pseudo-code and implementation was correct, so I think it's a minor error on my part.
For some people, the assignment gives them a lot of flexibility to write their own code, but I feel like there's not enough client code to even write the implementation for all the possible cases. Maybe that's what a real programmer feels like: you're only given the semantics and the rest of the implementation is up to you. I highly doubt that the professors will give us more client code, so I guess I'll just have to make due with the ones I have... by writing my own.
We'll see how well I can manage my duties on Assignment 1. It shouldn't be too hard, but I heard it's a lot to code.
Saturday, February 13, 2016
Thursday, February 4, 2016
ADTs and Assignment 1 (Week 4)
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.
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.
Thursday, January 28, 2016
Hello, CSC148! (Weeks 1~3)
Over the first few weeks, we have learned about OOP (Object Oriented Programming for short). Considering that I was still rusty on Python's syntax and the concept itself, I found the overall concept of OOP to be pretty intuitive. Just how computer science was one way to solve real-life world problems, I found that OOP was just another way to describe objects in the real world, with special features such as inheritance, encapsulation, and composition.
Perhaps the only struggles I had in the first few weeks was actually understanding how Python encapsulates code and hides class implementations. Since I found out that Python keeps its variables public by default, they don't enforce privacy in their attributes, so I had to do some work on how us coders do this manually.
Considering that I'm coming into this course without taken CSC108, I feel like I'm going to have to catch up on the basic syntax of Python since CSC148 teaches more about principles of program design (and they assume you know the basic Python syntax by now). I might have a harder time with recursion, algorithms, sorting techniques, and linked data structures since they're completely new topics I have not touched before, but I will revisit this topic in several weeks when I've experienced it in full.
My goal for making this SLOG is to look at problems in another way instead of silently coding. Perhaps a reflection or so can help me organize my course study better and debug my code faster. I did hear that writing your thoughts and experiences is very helpful, but I'll look back on my goals when I reach the end of the course, and see if it helps immensely.
Perhaps the only struggles I had in the first few weeks was actually understanding how Python encapsulates code and hides class implementations. Since I found out that Python keeps its variables public by default, they don't enforce privacy in their attributes, so I had to do some work on how us coders do this manually.
Considering that I'm coming into this course without taken CSC108, I feel like I'm going to have to catch up on the basic syntax of Python since CSC148 teaches more about principles of program design (and they assume you know the basic Python syntax by now). I might have a harder time with recursion, algorithms, sorting techniques, and linked data structures since they're completely new topics I have not touched before, but I will revisit this topic in several weeks when I've experienced it in full.
My goal for making this SLOG is to look at problems in another way instead of silently coding. Perhaps a reflection or so can help me organize my course study better and debug my code faster. I did hear that writing your thoughts and experiences is very helpful, but I'll look back on my goals when I reach the end of the course, and see if it helps immensely.
Subscribe to:
Posts (Atom)