The Reaction Timer That Made Me Love Programming
A beginner coding journey sparked by building a simple reaction timer and the unexpected joy that came with it.
My journey in programming was admittedly not a pretty one. Initially, I struggled quite a lot to get over the steep learning curve of C#, and C++. My aversion to it was largely attributed to my confusion to its structure. It always felt like no matter how many program I was creating, I wasn’t quite grasping the fundamental composition. With a background in graphic design, I adore creating structured designs that serve a clear purpose and so grappling with what I thought was a lack of design convention was difficult. As it turns out, I just didn’t dive deep enough yet!
Starting with C++ was such a blessing, however at the time I was not a fan, as I felt it had a lack of rules with a lot of its functions. Moving into C# provided me with a little more structure and rules but nothing like what I knew from Python, HTML, CSS or JavaScript.
This trimester, in my Object-Oriented Programming unit, I undertook a rather exciting project which ultimately changed my perspective on programming completely. It seems dramatic, but when I have a ‘eureka’ moment it feels like I’ve made a huge advancement in my knowledge of these topics.
As a reaction timer game, its purpose — as the name suggests — is to track the reaction time of a user in three games and calculate the three game average, which seems simple enough. It doesn’t sound too different to other programs that I have created for my university programming units. However, this one was different (it’s not like other programs!!).
How did one little program change my entire perspective on programming as a whole? Simply put, it was the introduction of state design, and by extension state design diagrams.
As someone from a design and marketing background, this felt like my two worlds colliding. I finally saw my purpose in this project as a result of the introduction of structured design principles in programming. Upon the creation of the finite state diagram, I found it much easier to create my program. Abstracting all the important features from the main program made it much more visually cohesive with each state class being clearly structured.
Implementing this design aspect made the coding simpler, however creating unit tests for each and every aspect was the most challenging part of the process. Thankfully, my meticulously crafted FSM design came to the rescue! I constantly referred to this to inform my unit tests to ensure each edge case was considered. Additionally, this meant I was able to confirm every state trigger was working as expected such that functionality is consistent between games.
Upon completion of the program, I felt like I had created a thoughtful, well-designed program that was efficient and served its purpose whilst also adhering to the client requirements. I was able to learn about how to implement FSM diagrams into a functional program which greatly sped up the coding process.
I write and debug all my programs within Visual Studio Code in C# (why did they stop Visual Studio 2022 support for Mac’s?), and I applied all core components of object-oriented programming — abstraction, encapsulation, inheritance, and polymorphism. Exploring the more dynamic aspects of OOP has given me a new perspective on programming, and with design conventions in the mix, OOP might have just become my perfect programming paradigm.
This project highlighted how important it was for me to ask questions, and rely on peers and tutors for advice and guidance especially for higher-grade tasks. Being able to describe my complications with others also helped me develop my conversational skills when discussing the more technical aspects of object-oriented programming. Creating diagrams before the actual implementation of a project to such an in-depth extent immensely decreases coding time, as each aspect of the program has been designed all the way down to the intricate details.
I am incredibly interested in implementing these ideas and concepts into more programs in hopes to further expand my skills in object-oriented design. This project made me realise that there is always a niche of every skill that aligns with your interests. I felt like programming was confusing and too complex, however upon introduction of design documentation I was able to find a programming niche that aligned with skills I had already mastered, and who knew this would make all the difference?
If you are someone who was also averse to programming like I was, I can promise that there will be a type of programming that you will love! Whether it’s HTML, CSS, or JavaScript for more design-minded folk, or Python for those wanting to explore scripting, and data visualisation (more on this later, watch this space!)
Have you ever had that ‘eureka’ moment when learning something you weren’t enjoying? I’d love to hear about it, because it’s the best feeling when you finally ‘get’ something, that you didn’t understand for so long.
