Code Completion Assistants
Overview
AI-based code completion assistants use machine learning models to suggest code completions, improve developer productivity, and reduce coding errors. These features are usually provided in code editors or IDEs.
Cautionary measures
When using the autocomplete suggestions generated by code completion assistants, keep in mind that:
- The suggested code follows generic standard practices and might not be tailored to the project’s specific needs. Always review and understand the code before integrating it into your project.
- Code completion assistants may have shorter context windows, and so might not include all relevant earlier code in the context window, leading to it missing out important information when generating code. Always check that the code is what you would have written.
- The code completion assistant may have misunderstood some variable names (especially if proper variable names were not used), leading to obscure/tricky logic bugs. Follow coding best practices so that code completion assistants can better understand written code and generate correct code.
- The coding assistant cannot run the generated code and thus cannot predict any bugs that might occur. Always test the code yourself.
- Code completion assistants often rely on tricks to shorten the amount of context needed, e.g. by selectively including only certain files in the context, or by ignoring code after the cursor. For best results, you may have to make some code modifications to bring relevant code into the context.
- Code completion assistants are best used for repetitive, standard boilerplate code. For other use cases, exercise extra caution.