prompter: what are the risks of using AI to create code for a professional programmer

assistant: One can identify multiple risks with AI code generation or completion:
- Lack of learning: if an AI writes the code for you, you will often not learn as much.
- Lack of reviewing: a code might work but have bugs or security issues. Sometimes, programmers are lazy and do not review the code written by the AI
- Security issues: because AI is trained on human code data, it can reproduce security issues that are often made by humans.
- Intellectual Property issues: AI can sometime copy parts of code they have been trained on. This can lead to IP issues.

prompter: Seems like only the Intellectual Property issue remains a problem if you review the code before using it.

assistant: To address the remaining intellectual property issue, the AI model would need to be trained in a way that reduces the risk of model memorisation, a behaviour of the AI that simply copies answers from its learning data rather than generating unique answers. This can be achieved with techniques such as regularization, early stopping, and cross-validation. Alternatively, an algorithm that compares the input code with original codes in its database could be used.

assistant: Although most outputs aren't credited to an author, the chance of copy-pasting copyrighted content poses an actual threat when doing it often.

prompter: What level of modification is required to avoid copyright infringement? It seems like most code is based on another example at some level.

assistant: You're right. Using AI code generation as an assistant, and carefully reviewing its code as you would do with in pair programming is a good practice.

assistant: A professional coder will be far better suited to understand and write code that is optimized and functional than most AI today. If a task is too hard or too time-consuming for your liking there are sites out there like github.io that allow you to insert other peoples code into your own projects. The process of conscious writing and testing of code until it works is the main reason humans write better code than AIs at the moment. However, unless you are haphazardly replacing your own code with that of the AI then there is not much of a risk. Any problems could be fixed manually, or you could remove the AI written code and write your own. Current AI technology is only suited to help novice programmers learn and grow.

prompter: Are there some risks for novice programmers as well?

assistant: AI written code is aproaching the quality of novice programmers. The central risk then is if people use AIs to write code for them, instead of using it as a tool for learning and growth. AI can write functional code and excell at helping people learn and understand, but they cannot do the actuall learning themselves. That remains the responsibility of the novice programmers using this tool.

assistant: Your boss might like the AI better than you. No seriously, you might include patented code into the software. That might very well be extremely expensive. Or just copyrighted software which would also be expensive.
Also you need to make sure that the software followed the guidelines you are using. There are different ways to indent, some have rules about levels of nesting etc. And of course the nature of and the amount of documentation embedded in the code.

prompter: How could you get a perfect synergy where you automate things that can be automated for which you use AI, but combine that with people who have other skills? Instead of getting paranoid, it would make more sense to evolve and adapt.