Posts

Short notes and observations.

AI code generation tips #1: use comments

๐Ÿš€ When you need to make small changes to existing code, hereโ€™s a pro tip ๐Ÿ‘‡

โŒ Donโ€™t do this: Try to describe all the changes in a long prompt - itโ€™s error-prone and the AI may misunderstand the context. Youโ€™ll end up trying and failing multiple times. ๐Ÿ˜ฉ

โœ… Do this instead: Go through your code and add clear TODO comments, like:

// TODO: Add request validation to this endpoint
// TODO: Make this method take an extra parameter
// TODO: Refactor this to use async APIs

Then use a prompt like:

Go through the code and collect all TODO items, then for each item implement the changes and update the tests.

๐ŸŽฏ Why it works:

  • The AI has extra context right in the code
  • You get more predictable and accurate changes

Try it out - itโ€™s a simple shift that makes a huge difference in codegen workflows. ๐Ÿ’ช

๐Ÿ‘‡ Let me know your experiences or tricks in the comments!


Originally posted on LinkedIn.

Echo 'Hello, world!'

If you ever find yourself reading this page - which you definitely arenโ€™t supposed to, because who reads the very first post of a blog anyway? - please send me an email with just the words hello, world in the body, and Iโ€™ll invite you for a coffee somewhere convenient. We can chat.

And thanks for reading. I really appreciate it.

Fast forward ten or twenty years from now, I hope to find this post and let it fill me with the warm glow of nostalgia - reminiscing about all the great times I had on this site, writing these articles.

But to write something of actual value: I plan to cover a lot of ground here, mostly tech, with a focus on the human side. And AI. Or whatever the latest trend happens to be.

Hopefully not jQuery and Internet Explorer bugs anymore.

Onwards!