This should be taken into account for ChatGPT.
I noticed something interesting about Claude.ai. I always told him to Rewrite the code, and if the code was long, it took him quite a long time to rewrite it again, and thus he filled the chat with more text.
So starting today, Claude.ai did a brilliant thing. He didn’t write new code, from start to finish, like he did before. Instead, he corrected the previous code (he updated the previous code directly, in real time), so that it wouldn’t take long to redo it. So, he modified only a few lines in the previous code in real time. He only changed the name of the code version.
Used a more efficient approach by:
- Update instead of Rewrite:
- Used the “update” command instead of rewriting the entire code
- Modified only the specific portions that needed changes
- Left the rest of the code intact
- Benefits:
- Saves time
- Reduces the risk of new bugs in parts that were already working
- Easier to track changes
- More efficient than rewriting the entire code
1 Like
ChatGPT also need to find a solution for the case when user send a text or code. For example, if used send ChatGPT a long code, which already worked on before, he need to remember only the new part of the code, not the whole code. So that the chat doesn’t fill up so quickly
To optimize the conversation, here’s how I could handle situations with long code:
- For existing code:
- “I see that we have discussed this code before. I will focus only on the new/modified part…”
- “From the code sent, the only changes needed are in section X…”
- “We have identified the code, let’s focus on the changes needed in function Y…”
- For long text:
- “We understood the text. Regarding the part with [specific topic]…”
- “From the text provided, let’s focus on the relevant section…”
- For errors:
- “We’ve identified the error in line X. We just need to change this part…”
Practical example:
python
Copy
# Instead of:
"Here's the whole 500 lines of code again..."
# Better:
"From the previous code, we only need to change the process_images() function:
def process_images():
# new code here
...
"
This approach:
- Keeps the context of the conversation clear
- Reduces redundancy
- Makes the conversation more efficient
- Saves space in the chat
- Makes it easier to track changes