DEV Community

James Eastham
James Eastham

Posted on

What I learned making my first open-source pull request

Last night I took a bold first step as a developer and opened my first official open-source pull request. I've been testing the waters with the Dapr framework recently, and the .NET Core API's were missing some key functionality.

What better way to get these features in the libraries than to just dive in and do it myself.

Strict code guidelines are great

The Microsoft code repositories have a very strict set of StyleCop rules associated with them. From everything to the comments on your classes/constructors/methods through to having too many white spaces.

Couple that with the build treating these style rules as errors, and I had a rather error-filled start to my development.

I don't consider myself to be a messy programmer, well at least I didn't. But having these rules taught me that I need to pay more attention to this kind of thing.

It's also made me want to borrow some of Microsoft's rules and implement them in my own company. Especially the rules around commenting and documenting.

Having enforced comments, made understanding the existing so much easier.

Copy and Paste is the enemy

The code I actually implemented, was almost a direct clone of some functionality that was already in the library.

As a starting point, an exercise in copy and paste seemed a time-saving first step. How wrong I was!

Whilst the pasted code I forgot to change wasn't necessarily a 'bug', it does make you feel a little bit daft when the first review comment to your first pull request is about the wording of comments not making sense.

Open Source is amazing

There aren't many other industries, where if something is missing from an item you need you can just go and add it yourself.

If your new speakers don't support Google Assistant, well that's just tough.

If the user manual you are reading isn't detailed or feature-rich enough, you can't just go and re-print it.

However, in the world of open-source software, this is entirely possible.

If an open-source library doesn't have a feature you need, it isn't as performant as you'd like or just isn't documented very well you can just go and change it.

Microsoft's commitment to open source is a masterstroke as far as I see it.
They've expanded their developer base by thousands and, with a good set of code rules and reviewers, improved their code quality and cycles immensely.

The pull request I opened still hasn't been fully approved, but this first experience has certainly made me want to get more involved.

If you're a developer who uses open source software, take the plunge and get involved! One of the best ways to say thank you to the open-source community is to get involved and help fix some issues.

For anyone interested in the pull request in question, you can check it out here.

Top comments (2)

Collapse
 
brujua profile image
Bruno Crisafulli

Nice, thanks for the article.
I would have enjoyed a little list of the steps you performed during the process, clone the repository, make it work, etc.

Collapse
 
jeastham1993 profile image
James Eastham

Thanks for the reply Bruno. I can certainly put together a follow-up article detailing my exact steps. Keeps your eyes peeled :)