I did an online course in Python a couple years ago and then went over it again as a refresher. What’s been mildly frustrating is having ideas but not having the tools yet to bring them to fruition. I remember wanting to create a ‘guess a number’ game and not having any idea how to implement it… I was thinking, “there must be some way to have it repeat over this code,” and lo and behold, the next module was on while loops which was exactly the tool I required.
Having examined the list of topics that will be covered in this course, it’s clearly best to just learn at an appropriate pace and only try to do that which I am capable of doing at the time. So I will just embrace my limitations because I know that as this course, and the next several years go by, I will become capable of doing more and more.
For this course specifically, I’m especially excited to learn about recursive data structures and algorithms. My brain is tickled with the bug and when facing a question, I often ask myself, ‘can this be implemented in Python?’
Also, I’m glad efficiency is on the syllabus, and I’m pretty sure that it will be an ongoing topic that will persist through all the other topics. For example, we’re currently working on classes and sub-classes, but we’re also learning about list comprehensions which just screams efficiency.
Speaking of classes, I’m enjoying thinking about classes and sub-classes in terms of real world examples and figuring out the “has a” and “is a” relationships. Although so far we have only used very simple class hierarchies, I imagine that with more complicated class trees, things will have the opportunity to get much more complex so having this clear vision is important.
The thought of complicated class trees makes me wonder / worry about how permanent the structure becomes. For example, if I make class Shape, and then make subclasses (RightAngleTriangle, EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle, etc) along with many other shape subclasses, but then realize I would benefit from a class in the middle, a Triangle class, I believe it would be too late to implement that without a major overhaul of my work. This worry makes me realize that it’s incredibly important to have a good methodology for thinking through problems thoroughly during the planning stages of a project.
My goal for my SLOG will be to essentially write about whatever happens to excite me at the time. I will document code I implement that I’m proud of as well as ideas I have that I’m not quite sure how to implement yet.
I’m rarely content to just complete the labs and test exercises. Rather, I’m always thinking of ways to expand on them. For example, in lab 1, I created a method in class RaceRegistry that adds multiple runners at once.
def add_runners(self, runners):
for item in runners:
self.add_runner(item[0], item[1])
Although it’s quite simple, I found it interesting because within this method, I am calling a different method from inside the same class! From the users perspective, this could be useful if they have a long list of runner signups they want to put into their registry. Now it only takes a single method call rather than several to get that job done. It looks like I should always be thinking about efficiency when coding since it’s a lot easier to get things right the first time than to have to go back and try to make them more efficient later.
Clearly, efficiency and planning go hand in hand. I can be more efficient in writing my code with proper planning, and a clearly planned structure to any project will allow me to best organize my data structures to ensure maximum efficiency in my code.