Contributing code you didn't write
Leading a small development team I came across the question how to handle code contributions by team members (me included) that utilize generative AI models like ChatGPT and Github Copilot. And thinking about it, it quickly dawned on me that this is not a new question. It’s just a new twist on an old question: How to handle code contributions you didn’t write yourself. Because -let’s face it- developers have been copying code from sources like StackOverflow, GitHub, blog posts, books, and documentation since as long as software development has existed. And that’s a good thing. Focus on the problem at hand and don’t reinvent the wheel.
But when a problem comes up, I wouldn’t find it acceptable to hear “I didn’t write that code” or worse “I don’t know how that works” by the person who contributed it.
So I wrote the
Guidelines to contributing code you didn’t write yourself:
- Thorough understanding: Read and understand every line, be able to explain and troubleshoot the code.
- Responsibility: Take the credit, the blame and the responsibility for the code you contribute.
- Transparency: Be transparent with your team how your code came about. If you used a generative AI model, say so. If you copied it from the web, leave a link to the source.
That said, of course you need to respect the license of any code you copy and make sure it is legally usable in the way you intend to use it - but that’s out of scope for this post.