Live data from Hacker News

The Economic Benefit of Refactoring

martinfowler.com

81–90 of 132 posts

Re: The Economic Benefit of Refactoring

#81
Great point. Using good software architecture and clean code will deliver direct and measurable economic value to projects and reduce AI costs right from the start, whether during refactoring or when planning a logical reorganization.

Re: The Economic Benefit of Refactoring

#82
post #62

Earlier quoted context omitted.

No this isn't mindless reinventing --- this is finally having clear empiric evidence for something that we knew the entire time. This is a huge relief! Next up is demonstrating the AI is more productive with better programming languages.

> Next up is demonstrating the AI is more productive with better programming languages. That actually would be pretty exciting! But, wouldn't AI be biased toward more popular languages, since those will by nature of their popularity provide more sources for training material? Even still, the AI could demonstrate which algorithms or maybe patterns and techniques are more productive, in the context of the popular langu…

You might be surprised. I've had an AI start spitting out none functioning python code. I've rewritten it with Go. The requirements are that every change has to pass compilation, linting and tests. Same requirements as Python. Go keeps the AI on the rails better. The compilation failing provides quick and probably better feedback than a whole dictionary of tests.

Re: The Economic Benefit of Refactoring

#83
post #62

Earlier quoted context omitted.

> Next up is demonstrating the AI is more productive with better programming languages. That actually would be pretty exciting! But, wouldn't AI be biased toward more popular languages, since those will by nature of their popularity provide more sources for training material? Even still, the AI could demonstrate which algorithms or maybe patterns and techniques are more productive, in the context of the popular langu…

You might be surprised. I've had an AI start spitting out none functioning python code. I've rewritten it with Go. The requirements are that every change has to pass compilation, linting and tests. Same requirements as Python. Go keeps the AI on the rails better. The compilation failing provides quick and probably better feedback than a whole dictionary of tests.

For sure. Its code output is definitely not to be fully trusted. Oftentimes, you can point at where it made a mistake and it usually fixes it too.

Re: The Economic Benefit of Refactoring

#85

I find it funny how the best practices for programmers, ignored in most IT companies, get reinvented as the best practices for AIs. Boring: The documentation should be in code, not in external Word documents uploaded to the company SharePoint server. Exciting: The documentation for the AI should be in code, not in external Word documents uploaded to the company SharePoint server. Boring: You should give your develope…

This has been a soul crushing part of the AI craze - we can finally fund all the devx work we wanted to do, for all the wrong reasons.

(It is nice that I can make something try our CLI a hundred times in an hour to test that new flag ergonomics, though)

Re: The Economic Benefit of Refactoring

#87

I find it funny how the best practices for programmers, ignored in most IT companies, get reinvented as the best practices for AIs. Boring: The documentation should be in code, not in external Word documents uploaded to the company SharePoint server. Exciting: The documentation for the AI should be in code, not in external Word documents uploaded to the company SharePoint server. Boring: You should give your develope…

It’s much easier to get your AI agents to do something consistently than it is to get your human colleagues to do it. Heck, personally we know these things are the right things to do, but we are just too busy and our minds wander to what we think our more productive uses of our time. That completely changes when it’s agents being instructed to do the work instead.

The crazy thing is that it s looking like AI might be able to write software better than humans eventually simply because they do not get bored of doing tedious tasks. Many things that we know work but don’t practice because humans aren’t very scriptable are now viable and can be easily applied with agents. For example, I’m finding a lot of success in using separate agents to write implementation and tests from a common specification and then using an auditor to run the tests so neither agent is contaminated by the other’s work. This is just part of the clean room engineering process that was developed for people by IBM in the 1980s, and it was shown useful then, but with AI it can be widely and consistently applied.

Re: The Economic Benefit of Refactoring

#88

I find it funny how the best practices for programmers, ignored in most IT companies, get reinvented as the best practices for AIs. Boring: The documentation should be in code, not in external Word documents uploaded to the company SharePoint server. Exciting: The documentation for the AI should be in code, not in external Word documents uploaded to the company SharePoint server. Boring: You should give your develope…

No this isn't mindless reinventing --- this is finally having clear empiric evidence for something that we knew the entire time. This is a huge relief! Next up is demonstrating the AI is more productive with better programming languages.

> Next up is demonstrating the AI is more productive with better programming languages.

This is hard to do given the current reliance on model weights in its programming language knowledge. You’ll get your best results for python or some variation of python. But

Re: The Economic Benefit of Refactoring

#89
> and used tiktoken to approximate tokens, by dividing character count by four.

This is just the type of thing that stands out.

You used a tokenizer library to determine the number of tokens in your text by dividing its length by 4.

That makes no sense!

Re: The Economic Benefit of Refactoring

#90

Earlier quoted context omitted.

No this isn't mindless reinventing --- this is finally having clear empiric evidence for something that we knew the entire time. This is a huge relief! Next up is demonstrating the AI is more productive with better programming languages.

> Next up is demonstrating the AI is more productive with better programming languages. This is hard to do given the current reliance on model weights in its programming language knowledge. You’ll get your best results for python or some variation of python. But

Not true. Python performance is actually pretty low, and Elixir, Kotlin and C# trounce it handily.
Post reply on HN