In the age of AI-assisted programming, a ā€œdocumentation firstā€ strategy makes sense. That is, before you write the code, start with a code comment describing the code.

// The following function takes

// an array of strings and returns

// a new string that concatenates

// the list with an optional separator.

Then let the AI autocomplete the code for you. #programming #ai

Reply to this note

Please Login to reply.

Discussion

return of the pseudocode

Unironically yes. Write the pseudocode, then have the AI replace it with real code.

I did this for a Rust project. Wrote some Python, then said to Copilot ā€œreplace this with the Rust implementationā€

I will try. Often for long tasks it misses the mark in some important ways, but taking 5+ min the write all the function docstrings + pseudocode would probably make it much better and have fewer bugs