Hacker News new | ask | show | jobs
by dakshgupta 176 days ago
How would you measure code quality? Would persistence be a good measure?
6 comments

"It's difficult to come up with a good metric" doesn't imply "we should use a known-bad metric".

I'm kind of baffled that "lines of code" seems to have come back; by the 1980s people were beginning to figure out that it didn't make any sense.

Bad code can persist because nobody wants to touch it.

Unfortunately I’m not sure there are good metrics.

That question has been baffling product managers, scrum masters, and C-suite assholes for decades. Along with how you measure engineering productivity.
The folks at Stanford in this video have a somewhat similar dataset, and they account for "code churn" i.e. reworking AI output: https://www.youtube.com/watch?v=tbDDYKRFjhk -- I think they do so by tracking if the same lines of code are changed in subsequent commits. Maybe something to consider.
I don't know if code is literacy but I think measuring code quality is somehow like measuring the quality of a novel.
The way DORA does. Error rate and mean time to recovery.