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. Scene_+05[view] [source] 2025-05-06 15:36:38
>>ranyum+Z3
It also does super defensive coding. Not that it's a bad thing in general, but I write a lot of prototype code.
◧◩◪
3. prpl+c7[view] [source] 2025-05-06 15:48:57
>>Scene_+05
Production quality code is defensive. Probably trained on a lot of google code.
◧◩◪◨
4. Tainno+gn[view] [source] 2025-05-06 17:16:43
>>prpl+c7
Depends on what you mean by "defensive". Anticipating error and non-happy-path cases and handling them is definitely good. Also fault tolerance, i.e. allowing parts of the application to fail without bringing down everything.

But I've heard "defensive code" used for the kind of code where almost every method validates its input parameters, wraps everything in a try-catch, returns nonsensical default values in failure scenarios, etc. This is a complete waste because the caller won't know what to do with the failed validations or thrown errors, and it's just unnecessary bloat that obfuscates the business logic. Validation, error handling and so on should be done in specific parts of the codebase (bonus points if you can encode the successful validation or the presence/absence of errors in the type system).

◧◩◪◨⬒
5. neilel+bp[view] [source] 2025-05-06 17:28:46
>>Tainno+gn
this!

lots of hasattr("") rubbish, I've increased the amount of prompting but it still does this - basically it defers it's lack of compile time knowledge to runtime 'let's hope for the best, and see what happens!'

Trying to teach it FAIL FAST is an uphill struggle.

Oh and yes, returning mock objects if something goes wrong is a favourite.

It truly is an Idiot Savant - but still amazingly productive.

[go to top]