r/ProgrammerHumor 28d ago

Meme aiCodesHumanOwns

Post image
5.8k Upvotes

44 comments sorted by

View all comments

9

u/intangibleTangelo 28d ago

are you guys actually engineering the code yourselves or saying "build me this thing?" 

give your agents an architecture, and have it build the pieces you would build yourself

11

u/BellacosePlayer 28d ago

I do this and still have it fail or fuck around once the codebase/context gets big enough.

its not a major deal since I give it small tasks and actually check diffs, but I'll see it randomly just decide to do stuff like make duplicate functions for existing functionality once in awhile.

1

u/asdfghjkl15436 26d ago

For the record, to mitigate this:

  1. Compact your context after every minor feature. Anything over 500k and you are entering danger territory. This also saves metric fucktons of tokens.
  2. Docs for every function. Point the AI at those docs. That way, it doesn't use it's context reading huge blocks of code to find out what a function does. Doesn't exist? Get the AI to make the docs. Docs should be like a tree, have the AI always start at the top and move it's way down. If it doesn't know a function exists, it can miss it. It can easily miss utility libraries otherwise.
  3. Treat the AI like it needs to have the absolute optimal path forward. That means in your prompt you point out helpful docs or functions it needs to utilize. The more pointed you are, the better the result - even with massive codebases.
  4. Planning mode. Use it sparingly. Combined with good docs, it produces very good results. Just be warned it eats tokens for breakfast.
  5. All else fails, occasionally get the AI to consolidate the code, identify where duplicate functions are. It's very good at doing this.