zlacker

[return to "Gemini 2.5 Pro Preview"]
1. ranyum+Z3[view] [source] 2025-05-06 15:30:36
>>meetpa+(OP)
I don't know if I'm doing something wrong, but every time I ask gemini 2.5 for code it outputs SO MANY comments. An exaggerated amount of comments. Sections comments, step comments, block comments, inline comments, all the gang.
◧◩
2. Maxata+T5[view] [source] 2025-05-06 15:42:10
>>ranyum+Z3
Tell it not to write so many comments then. You have a great deal of flexibility in dictating the coding style and can even include that style in your system prompt or upload a coding style document and have Gemini use it.
◧◩◪
3. Trasma+m7[view] [source] 2025-05-06 15:49:30
>>Maxata+T5
Every time I ask an LLM to not write comments, it still litters it with comments. Is Gemini better about that?
◧◩◪◨
4. sitkac+T9[view] [source] 2025-05-06 16:00:33
>>Trasma+m7
LLMs are extremely poor at following negative instructions, tell them what to do, not what not to do.
◧◩◪◨⬒
5. diggan+ce[view] [source] 2025-05-06 16:23:58
>>sitkac+T9
Ok, so saying "Implement feature X" leads to a ton of comments. How do you rewrite that comment to not include "don't write comments" while making the output not containing comments? "Write only source code, no plain text with special characters in the beginning of the line" or what are you suggesting here in practical terms?
◧◩◪◨⬒⬓
6. static+tj[view] [source] 2025-05-06 16:55:07
>>diggan+ce
This is sort of LLM specific. For some tasks you might try including the word comment but give the order at the beginning and end of the prompt. This is very model dependent. Like:

Refractor this. Do not write any comments.

<code to refractor>

As a reminder your task is to refractor the above code and do not write any comments.

◧◩◪◨⬒⬓⬔
7. diggan+Lw[view] [source] 2025-05-06 18:14:11
>>static+tj
> Do not write any comments. [...] do not write any comments.

Literally both of those are negations.

◧◩◪◨⬒⬓⬔⧯
8. static+501[view] [source] 2025-05-06 21:32:40
>>diggan+Lw
Yes my suggestion is that negations can work just fine, depending on the model and task, and instead of avoiding negations you can try other promoting strategies like emphasizing what you want at the beginning and at the end of the prompt.

If you think negations never work tell Gemini 2.5 to "write 10 sentences that do not include the word the" and see what happens.

[go to top]