logoalt Hacker News

planbtoday at 2:47 PM5 repliesview on HN

I have good results with this prompt after every larger change: Now do a final code check. Is everything tidy and do the components adhere to the principle of separations-of-concerns. Is everything in an understandable and maintainable state? Do we make any assumptions that may not be true anymore? Is any code left over from previous edits or experiments that does not belong into the codebase? Is the documentation still representing the current state of code?


Replies

Benjammertoday at 3:20 PM

I usually just say “make sure this code is professional and ready to deliver as a senior engineer” and it usually infers all that stuff you said plus more things as well. I try to give it the goal and let it decide what to do.

One thing I usually keep having to point out directly is to remove all “progress tracking” code comments and make sure all comments are appropriate for long term maintenance in the code base. Claude tends to leave comments like “button click causes save now, no longer uses onBlur” when the code really never used onBlur, that was just a thing Claude wanted to do earlier in the same task/branch and I redirected it at some point.

show 1 reply
Ancalagontoday at 3:24 PM

Just pull the slot machine lever

show 1 reply
RALaBargetoday at 4:46 PM

I like to also compliment the model on its very fashionable shoes as well, they love the flattery.

cyanydeeztoday at 3:10 PM

good, but this is just a verbose "make no mistakes"; it'd probably make more sense to just setup a nightly cron job that loops through the prior days' work and writes some morning tasks of the same character.

The models will interpret this willynilly; but nonetheless, it's often a better than doing nothing.

show 1 reply
chopete3today at 3:00 PM

This is a good example of AI native thinking. Teach AI everything and ask it if it has learnt throughly learnt. The results are surprisingly good.

I am following similar steps from this article https://www.lucasfcosta.com/blog/backpressure-is-all-you-nee...