From code in answers on Stack Overflow to R packages or full programs, there’s a lot of code being written and given away. This post examines some of the reasons why the people writing all that code do it, why you should consider giving back with code, and how you can get started. Finally, I cap it all off with perspectives from some of my favourite coders!
There are many reasons why you should consider writing code and making it available for public consumption.
- If you’re writing something to achieve a task, odds are someone else would have to write the same code – why not help them out?
- You’re using a lot of open source software, whether you realise it or not. By open sourcing your code, you get to pay it forward
- To give others something to contribute to
- Unknown quantities are risky hires, put your code out there for the world to see and employers get to see what you can do
- Develop your skills for the next job, the one that requires you to be more skilled in something than you are now
- You get to interact with a lot of different people who you build credibility with, and hopefully friendships!
- Generally speaking, the more code you write, the better your coding skills so if you want to improve your skills this is an ideal way to do it
- For the sheer fun of doing cool stuff, especially if you don’t get to do cool stuff in the day job
- To do it “the way it should be done”
An easy place to get started is a forum, like StackOverflow.
The very first place you be looking to write code is in some questions – producing a minimum reproducible example is an ideal start. Not least because, if you’re anything like me, the act of asking a question properly will usually provide you with the answer before you even post.
Your own projects
This section is wide open. Want to share a brief script you wrote that automates the Friday bacon run? Make it a public gist.
Want to write something a little longer? Then a full GitHub repository is the way forward. GitHub is the de facto site for building software transparently. As well as using git source control, the issue system is fantastic, you can have a wiki, you can host a website for the docs, and all for free.
Other people’s projects
Scared to put code out there?
Code isn’t the only way of giving back. Why not contribute in some other way? Write a blog post explaining how something works, improve someone’s documentation, act as first line support on projects to make sure people give all the right info to help the developers, donate some money, the list goes on.
There’s a risk people may be mean on the internet – not everyone follows Wheaton’s rule alas! So if you’re worried about your code, ask someone to review it, maybe get someone to hold your hand through your first pull request. There’s plenty of us who’ll give you a hand, and there are some neat networks like CodeNewbie and LearnProgramming Mentoring Community who can help support you too.
See what some great code contributors think and/or check out Scott Hanselman on Getting Started in Open Source.
Ed writes code to help people develop databases in a more code-driven fashion; he’s helping us ship better databases. As well as a lot of code, he presents a heck of a lot, and you can find him blogging at agilesql.club
There are three main reasons that I contribute code to the community. Firstly, I learn more by letting other people use the code I write when they give feedback. If I write something and it sits forever on a USB drive then I don’t learn what edge (or sometimes not so edge) cases I have missed. I lose out on the opportunity to learn and improve. Secondly, I use open source tools and feel that if I have benefited from work (often a lot of hard work, take Linux as an example) then maybe someone else will benefit from something I have written. Finally, the third reason is the people, I have met and interacted with people that I would never have without sharing code.
Chrissy is helping DBAs have more time to eat cakes. In seriousness, Chrissy codes and develops the community around dbatools.io, a PowerShell module for primarily aimed at helping DBAs migrate their SQL Servers in record time and safety. Check out today’s announcement about how it’s helping people work within best practices. She blogs, presents around the world, and also finds time to do cool things like this SQL Server Slack channel.
I give away code because it never occurred to me not to. I grew up using (and learning from) code from websites like 4GuysFromRolla.com and freshmeat.net, and I always felt eager to return the favor.
I also really enjoy the goodwill that sharing generates. When I was in college, I used to share my study guides with everyone, and then my classmates would end up sharing theirs, and we each ended up just having to write a chapter instead of each of us writing the entire study guide ourselves.
I see the same thing happening with dbatools, which now has several contributors. I started out writing it all myself, but others have joined in and we’re each writing a single chapter of a really amazing book. The book is even better than if I wrote it alone because everyone is contributing to the area that they’re great at. We’re all having a lot of fun doing it, and learning from each other along the way.
And you know, giving away code for free can really pay off. I got the dream job I’m at now because my boss found me through one of my blog posts that had the solution he was looking for!
Bob is a fantastic contributor of primarily security and visualisation packages to the R world. I use his stuff for so much stuff I think he warrants another R universe being named after him. Check out his code on GitHub, read his fab blog, and even listen to his Data Driven Security podcast.
Have you ever used a function in a package that saved you hours of time? Have you ever read a blog post or article that shows how to do something that you either had no idea could be done or were struggling to understand? Have you ever asked a question about how to do something you’ve been trying to figure out and received a helpful answer that got you past the block? We’re all involved in our own important work; but, what if you found out that a visualization package you worked on helped further global cancer research? Or, you discover that your answer to a gnarly question on Stack Overflow helped a dozen folks get past a blocker towards their respective PhDs? And, what if you learned that a blog post, paper or book you authored changed entire career paths for folks? As individuals, most of us have limited spheres of direct influence. Yet, every contribution we make to the R community is literally an opportunity to help others change the world. That’s why I #rstats.
Jenny has been fighting the good fight and helping others do the same. Developing the tools and the training materials to equip young and old alike with data wrangling skills, Jenny makes things easier for people to do the right thing. You can check out her awesome contributions (10 commits per day on average!) and her fantastic course for UBC Stat 545.
After tenure, I decided to use my very privileged position to make myself scientifically useful in a different way. When it comes to data analysis with R, we still have plenty of room to reduce garden variety human frustration and doubt. I revamped our data analysis course and threw everything up on the web, with unapologetic coverage of data handling and workflows influenced by software development. I also enjoy writing and contributing to R packages that decrease the agony and increase the quality of data analyses. What motivates me? I love the multiplier effect, where my contributions can make hundreds or thousands of other people better able to do their science.
Rob, the awesome bearded wonder, writes code like it’s going out of fashion. You can see his code on Microsoft Gallery and GitHub. Rob wants us to automate boring stuff, and spend time doing cool stuff, like automating things. Like Ed, he presents a lot and you can find him frequently at the blog grindstone.
I am a strong believer in the tech communities both PowerShell and SQL. I use and have used a lot of code that others have shared and it has helped me. I like the fact that I can pay some of that back by giving code for others to use. I remember what it was like to not know how to do something and helping and enabling others makes me feel good. I love writing PowerShell to solve problems. If someone asks me how can I do this thing with PowerShell I enjoy the challenge and the learning opportunity it gives. But the best reason for me is that people take your code and do amazing things and tell you great stories of things they have done, systems they have built or challenges they have overcome, which is all I ask – Drop me a line and tell me the cool things you have done with my code.