3 ms·
This got me thinking. What about two new docblock tags? @handwritten @generated The first, if used, implies the code can be contextualized through another empl
by butlike 3y ago
This got me thinking. What about two new docblock tags?
@handwritten
@generated
The first, if used, implies the code can be contextualized through another employee at the office (the one who wrote it).
The second, if used, implies you may not be able to get an answer as to why the code was written as it was, since an LLM generated it.
- Manfred 3y agoPeople usually commit code that is written by code assistants intermixed with their own changes. You would not be able to track it, even on first commit.
- joshuanapoli 3y agoWe can use a fine-grained commit style to distinguish hand-written and machine-written lines of code. I like this style for command-line driven AI tooling, where my tool is making bigger code changes (completing a function or file). In this case, it's easy to include a "git commit..." command in the tool. Unfortunately, it doesn't work with GitHub Copilot's style, which assumes really fine-grained interaction.
- sublinear 3y agoMakes more sense to just not commit generated code without understanding it first. As has been said many times, writing the code was never the hard part. Software devs are still responsible for the integrity of implementation details.
- lvncelot 3y agoYeah, I like the sentiment here, but I wouldn't pass review on a piece of code that had the "@generated" tag on it to absolve either the author or me as the reviewer of actually understanding what it does. At the end of the day, whether you copy-pasted the code from StackOverflow, let Copilot generate it or M-X-Butterfly'd it in yourself doesn't make a difference as you still need to understand thoroughly what it does.
- klhutchins 3y agoHalf joking but I try to make sure to ask the AI to "explain line 5 - 20 as if I am new to coding" and throw that in a comment
- sublinear 3y agoYup. A bad comment can be worse for maintenance than bad code without any comments.