Hacker News new | ask | show | jobs
by pipes 22 days ago
I'm really struggling to get an agent to write code I'm happy with. It's mostly pretty awful.

I've a fairly simple c# coding style. But simple is proving a bit more difficult to convey than I thought.

I get it to produce code. I then have to spend along time convincing myself it's correct. If I don't I end up embarrassing myself when a coworker reviews it, questions it and it's obvious I don't properly understand it.

This is really starting to screw with me mentally. It's like everyone in the world is saying they can fly by flapping their arms (dark factories). When I try I just stay in the same spot burning a lot of energy.

2 comments

I don't think everyone in the world is saying they can fly by flapping their arms. It's a small number of very vocal, very online, AI enthusiasts, many who have a financial stake in AI winning.
work from tests to implementation. Validate the tests, and work with the agent to ensure there are not more cases that need testing. Then you can let the agent implement the code and you can refine it until it's simple enough but covers the test cases. TDD is the only way to use agents effectively, imo
Thanks. I have been doing this tdd abd it's a big improvement but the code is still pretty awful. Two skills I rely on are Matt pococks grill-me and his tdd. These massively helped, and technically the code generated is correct but it's still hard to follow and bloated.

https://github.com/mattpocock/skills/blob/main/skills/produc...