During class this week, the professor gave us our first introduction into raising and creating our own exceptions. As I've never created an exception subclass, this was a completely new concept to me. Creating my own exceptions has allowed me to utilize Python's class inheritance. While I enjoyed learning about creating exceptions, it wasn't the easiest concept to grasp from the beginning. To fully learn to independently execute this function, I not only had to review the lecture notes, but I had to rely on external research as well. I watched two very helpful YouTube instructional videos that gave me guidance on how to properly execute the exceptions. The most helpful video that I found was a tutorial from Lynda.com. This video was especially helpful because it uses live examples to demonstrate the functions, you can view it below.
Raising Exceptions
Lynda.com Tutorial
By the end of exercise 2, I believe I know what each function now does and when to raise each one. While learning more about inheritance and subclasses, I was also learning about creating my own Abstract Data Types (ADTs) in our lab. We focused on creating stacks and queues and how each has its own strengths and weaknesses. At first, it seemed like stacks were far superior because the speed of using the stack class stayed constant as the inputs increased in size, while the speed of using the queue class increased linearly. During the lab the TA gave my partner and I recommended that we spend some of our own time researching new data types to use with the queues. While we were researching, we stumbled upon the collections module and the deque data type. When we implemented the deque data type into our queue, it increased the efficiency of the queue class to become constant like the stack.
I look forward to continuing my education of computer science and learning and becoming more self-sufficient as I work on my programming skills. While I expand my knowledge of computer science and improve my programming abilities, I will strive to enhance my blogging skills so that each post is interesting and helpful to my readers.