← Back to context

Comment by pityJuke

5 months ago

There's a middle ground, I find.

Absolutely, when tasked with something quite complex in a complex code base, it doesn't really work. It can get you some of the way there, and some of the code it produces gives you great ideas on where to go from, but it doesn't work.

But there are certainly some tasks where it excels. I asked it to refactor a rather gnarly function (C++), and it did a great job at decomposing it. The initial decomposition was a bit naive: the original function took in a vector, and would parse what the function & data from the vector, and the decomposition split out the functions, but the data still came in as a vector. For instance, one of the functions took a filename, and file contents, and it took it as element 0 and element 1 from a vector, when it should obviously be two parameters. But some further prompting and it took it to the end.