By using real world analogs, difficult concepts in computer science become less abstract. This was especially helpful when we were creating the class Queue in tutorial on Tuesday. The name given to that class, "queue", implies the data structure works just like one. We can visualize a queue of people where everyone enters at the "back" of a lineup and exits from the "front". Once the person in front gets out, everyone's place in line shifts forward. This is analogous to the indices of items in a queue shifting down when the first item has been dequeued. The shift in indices was the reason why a Queue takes longer to enqueue/dequeue large numbers of items than a Stack can push/pop. I still have difficulty using proper computer science terminology so I will have to work on understanding object-oriented programming on its own terms and not in relation to something else.
One thing I don't fully grasp are exceptions. I know that it is an object created in runtime errors, and I believe I can implement an exception in an acceptable way (as in it probably will not crash the computer). However I realize I cannot come up with a good explanation for exceptions which means there is a lot I do not understand about it. If I practice writing code with exceptions in it, or ask other students, the TAs, or my professor, I will gain a better understanding of exceptions and use them properly.
No comments:
Post a Comment