4 ms·
Agree generally, but in my experience AI generated code tends to have more gold-plating than hand spun code (likely due to the substantially lowered cost of gen
by jcims 1y ago
Agree generally, but in my experience AI generated code tends to have more gold-plating than hand spun code (likely due to the substantially lowered cost of generating it)
Also generated comments tend to explain how/what vs why, which is usually what I want to know.
- onion2k 1y agoAI generated code tends to have more gold-plating than hand spun code It does if you let the AI generate lots of code at once. If you take small steps and build iteratively telling it what to do (following a plan that the AI generated if you want to) then it doesn't. This isn't revelatory though. It's exactly the same as a developer would do - if you give a person a vague idea about what they should make and just leave them to get on with it they'll come back with something that does things you didn't want too.
- dotancohen 1y agoWhat is gold plating in this context? Checking the miriad of corner cases at the top of a function? Actually writing the doc comments? Actually writing the tests and documentation? Good git commit messages?
- jotux 1y agoI work on a large C++ codebase for an aerospace application. The code is relatively conservative, and when we add things, we're generally conservative in our approach to add new things. Copilot (with Claude or GPT under the hood) constantly wants to use modern and complicated approaches to any new thing we add. Need to check three bits in a byte from a peripheral and populate them to telemetry? Claude/GPT: Let's make a base struct with a virtual map function, then template a struct to hold the register with functions to extract bits, then make unique pointers to each register, then create a vector of pointers to map all the values, etc. You can write a very clear, and long, prompt that explains not to do any of that and just pull the bits out of the byte, but writing the prompt takes more time than just writing the code. These tools seem to always reach for, what I would call, the pristine solution as their first attempt and I think many would call that gold-plating.
- antonvs 1y agoYou can typically address that with a system prompt, so you don't have to mention your expectations every time. If you're using one of the coding agents like Claude Code or Gemini CLI, you should have a .md file (e.g. CLAUDE.md) for your project which contains those kinds of instructions, and any other useful context for the project. https://www.anthropic.com/engineering/claude-code-best-practices https://www.anthropic.com/engineering/claude-code-best-pract...
- marxism 1y agoHere's an example of gold plating from a CLI I created this past weekend. I did not like the terse errors when parsing JSON. "invalid type: boolean `true`, expected a string", line: 3, column: 24 So I asked for Elm style friendly error messages that try to give you all the information to fix things right up front. https://github.com/PeoplesGrocers/json-archive/blob/master/src/reader.rs#L270-L284 https://github.com/PeoplesGrocers/json-archive/blob/master/s... https://github.com/PeoplesGrocers/json-archive/blob/master/src/diagnostics.rs https://github.com/PeoplesGrocers/json-archive/blob/master/s... And then since I had time, I asked for some documentation to show/explain the various edge case handling decisions I made. https://github.com/PeoplesGrocers/json-archive/blob/master/docs/state-command.md#no-observations-match-timestamp https://github.com/PeoplesGrocers/json-archive/blob/master/d... It's gold plating because no one wants or needs my little tool. If I spent that same hour iterating on the output format to be more user friendly while at work, I would be taken out behind the woodshed and shot. It's pure wasted effort.
- jcims 1y agoExactly.
- jcims 1y agoBasically the category of stuff that makes you wonder if someone had too much time on their hands.