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. Benjam+j5[view] [source] 2025-05-06 15:38:07
>>ranyum+Z3
I've found that heavily commented code can be better for the LLM to read later, so it pulls in explanatory comments into context at the same time as reading code, similar to pulling in @docs, so maybe it's doing that on purpose?
◧◩◪
3. koakum+q7[view] [source] 2025-05-06 15:50:14
>>Benjam+j5
No, it's just bad. I've been writing a lot of Python code past two days with Gemini 2.5 Pro Preview, and all of its code was like:

```python

def whatever():

  --- SECTION ONE OF THE CODE ---

  ...

  --- SECTION TWO OF THE CODE ---

  try:
    [some "dangerous" code]
  except Exception as e:
     logging.error(f"Failed to save files to {output_path}: {e}")
     # Decide whether to raise the error or just warn
     # raise IOError(f"Failed to save files to {output_path}: {e}")
```

(it adds commented out code like that all the time, "just in case")

It's terrible.

I'm back to Claude Code.

◧◩◪◨
4. Neutra+7f[view] [source] 2025-05-06 16:29:15
>>koakum+q7
I'm seeing it trying to catch blind exceptions in Python all the time. I see it in my colleagues code all the time, it's driving me nuts.
◧◩◪◨⬒
5. Joshua+Jr[view] [source] 2025-05-06 17:43:29
>>Neutra+7f
The training loop asked the model to one-shot working code for the given problems without being able to iterate. If you had to write code that had to work on the first try, and where a partially correct answer was better than complete failure, I bet your code would look like that too.

In any case, it knows what good code looks like. You can say "take this code and remove spurious comments and prefer narrow exception handling over catch-all", and it'll do just fine (in a way it wouldn't do just fine if your prompt told it to write it that way the first time, writing new code and editing existing code are different tasks).

◧◩◪◨⬒⬓
6. Neutra+iX[view] [source] 2025-05-06 21:11:53
>>Joshua+Jr
It's only an example, there's pretty of irrelevant stuff that LLMs default to which is pretty bad Python. I'm not saying it's always bad but there's a ton of not so nice code or subtly wrong code generated (for example file and path manipulation).
[go to top]