1. Write comments saying what you want the next lines of code to do
2. Write function definitions with clear function names and type annotations on the arguments - this can result in the full function body being provided if your definitions are clear enough
3. For repetitive code (like parameterized unit tests) provide a couple of examples and then use comments to hint at what it should write for you next based on those examples
4. Sometimes it's good to temporarily copy and paste a chunk of code in from elsewhere. For example, copy a CREATE TABLE SQL statement into a Python file when you are writing code that will interact with that table - or even an HTML page when you are writing out the HTML for a form associated with that table
This works well as a general rule, but sometimes it doesn't fine the right snippets - which is why I occasionally help it out through copy and paste.
My main thoughts behind this are that
1. The LLMs tend to hallucinate library functions
2. I don't want to have to copy and paste a schema
Seems small but I think it’s actually a major productivity win for polyglot programming (which is a lot of my current $dayjob).
I also like the convenience of “start a session with my current file automatically in the context”, again, lowers the friction substantially.
I’ve found it great when manipulating data between two formats, like a CSV export into a JSON config. Something that might be too short to write a script for but long enough to be tedious, you can now tab complete your way through it.
That next stage is currently what I am working. I'm building out a code splitter using TreeSitter right now and already have experimental vector search in the language server.
I work full-time for my own product (very early stage) but I am happy to share my own journey of using AI code assistants. Please feel free to check the commits: https://github.com/brainless/dwata
The models used for autocompletion in Github Copilot and other systems are usually not as strong but faster and cheaper.
You can still get decent results from the autocomplete models if you guide them with comments but I find explicit prompting less frustrating when I care about getting a good result.
For my other code bases I find that the amount of time it saves is definitely nice but only barely worth paying another SaaS subscription for.
And so I'm happy to just wait for Jetbrains and Microsoft to roll this into the existing products for free.
Personally I find it just easier to either write the code myself, or ask ChatGPT/whatever for snippets for specific problems which I then heavily modify to suit my needs (and fix its bugs, which happen quite often). But maybe I’m just too engrained in existing behavior.