Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qory 2410- SE- Mod-01 Bike Ride Independent Challenge #13

Open
wants to merge 35 commits into
base: main
Choose a base branch
from

Conversation

qoryhanisagal
Copy link

Final Reflection for Bike Ride Independent Challenge

Name: Qory

Reflection

This project was both challenging and deeply educational, as each iteration introduced unique aspects of Ruby programming that required careful thought, debugging, and learning. Working through the iterations not only helped me improve my skills in Ruby, but also offered insights into object-oriented design, code organization, and the importance of thorough testing.

Iteration 1: Building the Basics

In Iteration 1, creating the Ride class provided a solid foundation, where I practiced using attr_reader to control data access and defined basic methods to ensure the class could function as required. Although simple, this phase helped reinforce the importance of understanding Ruby’s class attributes and structure. Mistakes, like forgetting attr_reader and missing end keywords, were valuable in highlighting how small details can significantly affect code functionality. These experiences prepared me for the more complex iterations ahead by reinforcing good practices in class structure and data encapsulation.

Iteration 2: Introducing State and Conditionals

The Biker class in Iteration 2 introduced additional complexity, particularly with managing multiple data types and implementing conditional logic. I learned the importance of initializing instance variables properly, especially when rides needed to be a hash. Through trial and error with the log_ride and personal_record methods, I gained a better understanding of conditional checks, especially in methods that needed to handle missing or non-existent data. Fixing errors like incorrect learn_terrain! method definitions and ensuring personal_record returned false for rides that hadn’t been logged highlighted the need for well-thought-out logic and edge-case handling.

Iteration 3: Managing Relationships with BikeClub

Iteration 3 took the project to a new level by introducing the BikeClub class, where managing relationships between Biker instances became essential. Here, I had to ensure that bikers were correctly added to the club, that the club could track individual performance, and that it could make comparisons across its members. Adding methods like most_rides and best_time required not only a solid understanding of iteration and data structure manipulation but also an ability to troubleshoot logical errors. Implementing most_rides using flatten to count nested arrays showed me how powerful and concise Ruby methods can be for handling complex data structures, while the bikers_eligible method reinforced my understanding of using select with multiple conditions.

Iteration 4: Advanced Functionality with Group Rides and Class-Level Methods

Iteration 4 was perhaps the most challenging, as it required integrating Ruby’s Time class for record_group_ride and implementing a class-level method (best_rider) to find the best rider across all instances of BikeClub. Using ObjectSpace.each_object(BikeClub) to iterate over all clubs was a new concept for me, and it emphasized how powerful Ruby can be when working with class-level data. Testing record_group_ride was another learning experience, as stubbing Time.now made me realize how controlled test environments allow for predictable and accurate results. This iteration showed me how Ruby’s dynamic capabilities can manage relationships across multiple instances, as well as the importance of encapsulating data within appropriate classes.

Overall Takeaways

This project was an invaluable experience in test-driven development (TDD), object-oriented programming (OOP), and data management. Writing and running tests after each change allowed me to catch errors early, build confidence in my code, and see firsthand the impact of even minor changes. Each iteration deepened my understanding of managing data, designing class interactions, and ensuring code readability. The process of troubleshooting and refining methods across iterations reinforced the importance of thinking through design before implementing, while also showing how TDD can serve as a guide and safety net throughout the development process.

Final Thoughts

I feel I approached this challenge thoroughly and patiently, gaining a stronger understanding of Ruby’s capabilities and the nuances of object-oriented design. The project required close attention to detail, especially in handling relationships between objects, managing data types, and setting up tests that accurately reflect real-world scenarios. Overall, I’m proud of the progress I made and grateful for the experience, as it not only strengthened my technical skills but also deepened my problem-solving abilities and my appreciation for clean, testable code.

@qoryhanisagal qoryhanisagal changed the title Qory Bike Ride Independent Challenge with all iterations Qory Final Reflection for Bike Ride Independent Challenge Nov 4, 2024
@qoryhanisagal qoryhanisagal changed the title Qory Final Reflection for Bike Ride Independent Challenge Qory 2410- SE- Mod-01 Final Reflection for Bike Ride Independent Challenge Nov 4, 2024
@qoryhanisagal qoryhanisagal changed the title Qory 2410- SE- Mod-01 Final Reflection for Bike Ride Independent Challenge Qory 2410- SE- Mod-01 Bike Ride Independent Challenge Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant