DEV Community

Muhammad Junaid Khalid
Muhammad Junaid Khalid

Posted on

Code, Collaboration, and Contributions: My First Ever Hacktoberfest Experience

An image of @mjk22071998's Holopin badges, which is a link to view their full Holopin profile

Introduction

Participating in Hacktoberfest 2024 marked a pivotal moment in my journey as a software developer. My primary motivation for joining was to expand my knowledge and gain insights into industrial standards in software development. I wanted to push my boundaries and explore the practical applications of algorithms in a collaborative environment.

Starting from my comfort zone, I contributed to the repositories of TheAlgorithms, where I added several new algorithms. This experience not only deepened my understanding of coding practices but also introduced me to the vibrant community of open source contributors. In this article, I will share my experiences, the challenges I faced, and the invaluable lessons I learned throughout this journey.

My Contributions

During Hacktoberfest 2024, I focused on enhancing the repositories maintained by TheAlgorithms by adding several new algorithms that demonstrate fundamental concepts in computer science. Specifically, I contributed the following:

  1. Binary Addition Algorithm: This algorithm takes two strings representing binary numbers (composed of '0's and '1's) and returns a string that represents their sum. By implementing this algorithm, I gained insights into how binary operations function at a foundational level.

  2. Digit Separation Algorithm: I developed this algorithm with two functions: one that returns a list of the digits of a given number in both forward and reverse order. This task improved my understanding of array manipulation and the importance of data representation.

  3. Sorted Linked List: In this implementation, I focused on two primary functions: insert and delete. The insert function places data at the appropriate sorted position, while the delete function removes the specified data. While my implementation used integers as the data type, the algorithm can be adapted for any data type with the correct comparator, showcasing its versatility.

These contributions not only reinforced my programming skills but also allowed me to better understand algorithmic design and data structures in a collaborative environment.

My Learnings

Code Documentation

Before this experience, I didn’t pay much attention to code documentation. But through my contributions, I learned the importance of writing clean, well-documented code. In Python, I learned to use docstrings effectively, ensuring that every function I wrote was clearly documented for future contributors. Similarly, in Java, I utilized Javadoc to document my methods and classes, making the codebase more understandable for others.

This experience helped me realize that documentation is not just an afterthought—it’s an integral part of writing good software.

Unit Testing

Another valuable skill I gained was writing unit tests to validate my code. I learned to use:

  • cassert in C++ to write simple assertions for testing my code’s correctness.
  • JUnit 5 in Java to create structured and robust test cases.
  • doctests in Python, which allowed me to write examples within my docstrings that could be run as tests.

Unit testing made me more mindful of edge cases, and I learned how to structure my code to be more testable.

PRs and GitHub Issues

The process of opening and reviewing pull requests (PRs) was completely new to me. I was thrilled when my first PR was merged, and I learned that PRs are not just about contributing code—they're about communication. Every PR I submitted required clear explanations, references to existing issues, and discussion with maintainers.

I also learned a critical lesson the hard way: always open an issue before submitting a PR. On one occasion, I opened a PR without creating an issue first, only to find that someone else’s PR for the same problem was merged before mine. It was a bit disheartening, but ultimately, it was a learning experience. I understood that contributing to open source is not a race—it’s about following the right processes and collaborating efficiently.

Overcoming Challenges

One of the biggest challenges I faced was meeting the repository standards, especially for formatting. In C++ and Java, adhering to clang-format was critical to ensuring code consistency. Similarly, in Python, maintaining proper mypy formatting for static type checking was something new to me. While these standards were initially challenging to grasp, they pushed me to write cleaner, more maintainable code, and I quickly realized how important consistent formatting is in collaborative development.

Conclusion

Reflecting on my journey through Hacktoberfest 2024, I can confidently say that my experience was both enjoyable and rewarding. Contributing to open source projects not only allowed me to apply my existing knowledge but also pushed me to learn new skills and adapt to industry standards. Each contribution brought a sense of accomplishment and boosted my confidence as a programmer and developer.

I am excited about the prospect of continuing my contributions to open source projects in the future. The collaborative nature of these projects fosters a vibrant community where knowledge is shared, and innovative ideas flourish. I believe that regularly engaging with open source not only enhances my technical skills but also helps me stay connected with the evolving landscape of software development.

As I move forward, I encourage others to participate in open source initiatives like Hacktoberfest. It's an excellent opportunity to grow, learn, and contribute to a community that thrives on collaboration and shared knowledge. Together, we can build better software and foster a more inclusive tech environment.

Top comments (0)