Comment by Mtinie

Comment by Mtinie 3 days ago

4 replies

> 1. The raw code with no empty space or comments. 2. Code with comments

I like the sound of this but what technique do you use to maintain consistency across both views? Do you have a post-modification script which will strip comments and extraneous empty space after code has been modified?

johnsmith1840 3 days ago

Custom scripts and basic merge logic but manual still happens around modifications. Forces me to update stale comments around changes anyhow.

I first "discovered" it because I repeatedly found LLM comments poisoned my code base over time and linited it's upper end of ability.

Easy to try just drop comments around a problem and see the difference. I was previously doing that and then manually updating the original.

wormpilled 3 days ago

Curious if that is the case, how you would put comments back too? Seems like a mess.

  • Mtinie 2 days ago

    As I think more on how this could work, I’d treat the fully commented code as the source of truth (SOT).

    1. SOT through a processor to strip comments and extra spaces. Publish to feature branch.

    2. Point Claude at feature branch. Prompt for whatever changes you need. This runs against the minimalist feature branch. These changes will be committed with comments and readable spacing for the new code.

    3. Verify code changes meet expectations.

    4. Diff the changes from minimal version, and merge only that code into SOT.

    Repeat.

    • johnsmith1840 2 days ago

      Just test it, maybe you won't get a boost.

      1. Run into a problem you and AI can't solve. 2. Drop all comments 3. Restart debug/design session 4. Solve it and save results 5. Revert code to have comments and put update in

      If that still doesn't work: Step 2.5 drop all unrelated code from context