Ask HN: How do you improve code for future AI?
1 tmaly 3 5/31/2025, 1:03:44 PM
I am sitting on tons of legacy code at my day job. I keep looking at how fast AI is improving over the last few years.
I am thinking what can I do to improve the massive amount of legacy code I have to maintain so that eventually I can let a better AI in the near future help me more?
What are your best tips that are working now?
If you can refactor it to small modules with simple interfaces and properly document the interfaces and what the modules do, AI can work with your code more easily. Think of the ideal AI codebase as being assembled from libraries (even if private internally developed ones) with a small amount of glue code in between.
Legacy code is a statement but in the end it only matters if it works and is maintainable.
It might surprise you.