Skip to content

Instantly share code, notes, and snippets.

@Madoshakalaka
Created July 2, 2024 05:06
Show Gist options
  • Save Madoshakalaka/d7235c4edd8304433d80fca9fb27973c to your computer and use it in GitHub Desktop.
Save Madoshakalaka/d7235c4edd8304433d80fca9fb27973c to your computer and use it in GitHub Desktop.
Presentation at Kyushu University

Tricks: accept-word and accept-line.

In a big project, real-time AI assist usually uses the current buffer or file as a context, which is not enough information to make a perfect suggestion. But they often give good enough partially correct predictions. Once you manually provide some details, they can get the rest right.

Trick: Comment before you code.

AI can sometimes guess correctly from the context but an extra comment helps huge.

However, add comments only responsibly. You don't want to accidentally be overly verbose with comments. Especially these kind of comments that explains what the code does.

These kind of comments are a maintainence burden. They can become outdated and misleading. These comments are parallel to the code, everytime you change the code, you have to change the comments accordingly. It adds to the workload and opens up the possibility of inconsistency.

In fact, I heard in some big projects, these kind of comments are prohibited.

In summary, keep in mind that these comments are only for prompting the AI, and delete them if they are overly verbose.

Workspace awareness

Current solutions have limitations in workspace awareness. Try manually providing context with external chat tools. This comes with the benefit of controlling exactly what you want the AI to know.

If you have domain knowledge, a new paper, or a new library, you are able to provide those information to the AI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment