logoalt Hacker News

danbructoday at 4:15 PM4 repliesview on HN

Interesting that the amount of code remained essentially unchanged. In my experience it is not unusual that refactoring messy code cuts the number of lines in half.


Replies

stingraycharlestoday at 4:17 PM

It can go both ways. Lines of code is a terrible metric for pretty much any goal that refactorings are meant to tackle.

show 2 replies
ggatoday at 7:33 PM

Yep, this was a real surprise to me, too. That’s why I included that top line in the figure. It also doesn’t line up with the agent’s predictions when it laid out the refactoring before proceeding.

There’s further work to do to understand exactly what’s going on here.

whats_a_quasartoday at 5:34 PM

Yeah, I sorta expected the punchline to be "this 17,000 lines of code became 2,000" but it is still about the same quantity. Kinda interesting. Also interesting that the last change has by far the largest effect (4x reduction in tokens) and that also corresponded to the biggest reduction in single file LOC

j45today at 4:33 PM

Quality of lines > Quantity of lines.

In some projects, the code might not have much, or enough testing, or documentation/commenting.

Code is largely for others and the future if the creators of it want to move onto other projects.