Hacker News new | ask | show | jobs
by cadamsdotcom 5 days ago
Love the idea of RL for codebase health.

And a benchmark to measure against!

Imagine a "MaintainabilityBench" that rewards models which detect code duplication while working on a task and perform some refactor instead of glibly duplicating; or that detect the need for a new architectural layer, or that hoist a type constraint so there's no need for dumb casts. You can keep on imagining scenarios.

There are probably a few hundred distinct elements to RL for. The books "Working With Legacy Code" and "Architecture of Open Source Applications" would be great fodder.

Sadly don't have time to build it, there's this mountain of reviews in front of me...

2 comments

sometimes you forsee the code developing vastly differently between the two copies so you don't want the refactor. it really all comes down to lack of online learning and contextual awareness; memento mori notes are about as effective as developers with no expertise reading the design patterns book (well, ok, they are effective, but not sufficiently and not always directionally correct as its hard to accurately encode the nuance with language)
So true.

So when you see that split coming, do you drop a quick warning, or just copy-paste and leave the mess for tomorrow?

https://sandimetz.com/blog/2016/1/20/the-wrong-abstraction probably describes what happens with sufficient nuance
> perform some refactor instead of glibly duplicating;

wouldnt that be part of original RL though. why would it be a seperate thing.

Because writing code that passes a test is different to passing the test while also noticing and performing a refactor.