DEV Community

Bregwin Jogi
Bregwin Jogi

Posted on • Edited on

Contributing to Other Open Source Projects - Week 2

This week, I contributed to two open-source projects. The first was ScottPlot, a plotting library for .NET (great name!), and the other was the official Python extension for VSCode, vscode-python. Both contributions were interesting in their own way, and I learned a lot by digging through the codebases.

ScottPlot: A Simple Center Property

For ScottPlot, the task was just to add a property to calculate the center between two pixel coordinates. I wrote a small function that takes two pixel values and returns their midpoint. It was a small addition, but it gave me a good sense of how the C# code is structured.

Image description

vscode-python: Cleaning up JSDocs

The main contribution I worked on was for the vscode-python extension. The issue involved removing redundant JSDoc comments that TypeScript can already infer. Some of the comments were a repeat of what was can be understood from the typescript code, which meant they would need to be updated every time the code changed. The idea was to get rid of those types of comments but keep parts that added useful context.

At first, I wasn’t 100% sure which parts of the comments needed to go, so I asked the issue’s author for clarification. After getting some guidance, I understood what needed to be done: remove comments like @param and @class tags where they added no extra information that typescript already displays, but leave the ones that were meaningful.

Going Through the Code

I went through each file within the repo to search for these JSDoc tags and found them in several places. I removed only the unnecessary parts, making sure I didn’t accidentally delete anything important or leave parts of the code commented out. (I double-checked to avoid breaking the code because of a missing block closure—been there before.)

After cleaning up 37 files, I made the pull request. There were other files I could have modified, but those comments still had useful information attached to the JSDocs tags, so I decided to leave them.

Image description

The Pull Request

I ran through a final check before making the pull request. The next morning, I was surprised to see it had already been merged! It felt pretty great to contribute to something I’ve been using almost every day.

Overall, this was a fun experience, and I plan to keep contributing more in coming weeks. Working with real-world codebases helped me get familiar with code created by others and the reasoning behind why things were implemented that way. It is also a nice bonus to know I made even a small impact.

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay