Comment by divan
4 days ago
On one codebase I work with, there are often tasks that involve changing multiple files in a relatively predictable way. Like there is little creativity/challenge, but a lot of typing in multiple parts/files. Tasks like these used to take 3-4 hours complete before just because I had to physically open all these files, find right places to modify, type the code etc. With AI agent I just describe the task, and it does the job 99% correct, reducing the time from 3-4 hours to 3-4 minutes.
Amusingly, cursor took 5 minutes trying to figure out how to do what a simple global find/replace did for me in 30 seconds after I got tired of waiting for it's attempt just last night on a simple predictable lots-of-files change.
A 60x speedup is way more than I've seen even in its best case for things like that.
In my experience, two things makes a big difference for AI agents: quality of code (naming and structure mostly) and AI-friendly documentation and tasks planning. For example, in some repos I have legacy naming that evolved after some refactoring, and while devs know that "X means Y", it's not easy for AI to figure it out unless explicitly documented. I'm still learning how to organize AI-oriented codebase documentation and planning tools (like claude task master), but they do make a big difference indeed.
This was "I want to update all the imports to the new version of the library, where they changed a bit in the fully qualified package name." Should be a super-trivial change for the AI agent to understand.
Like I mentioned, it's literally just global find and replace.
Slightly embarrassing thing to have even asked Cursor to do for me, in retrospect. But, you know, you get used to the tool and to being lazy.
Did you ever consider refactoring the code so that you don't have to do shotgun surgery every time you make this kind of change?
You mean to future proof the code so requirements changes are easy to implement? Yeah, I've seen lots of code like that (some of it written by myself). Usually the envisioned future never materializes unfortunately.
I mean given that you've had this problem repeatedly, I'd call it "past-proofing", but I suppose you know your codebase better than I do.
2 replies →
It's a monorepo with backend/frontend/database migrations/protobufs. Could you suggest how exactly should I refactor it so I don't need to make changes in all these parts of the codebase?
I wouldn't try to automate the DB part, but much like the protobufs code is generated from a spec, you can generate other parts from a spec. My current company has a schema repo used for both API and kafka type generation.
This is a case where a monorepo should be a big advantage, as you can update everything with a single change.
1 reply →
At this point why spend 5 hours refactoring when I can spend 5 minutes shot gunning the changes in?
At the same time refactoring probably takes 10 minutes with AI.
A lot of that is inherent in the framework. eg Java and Go spew boilerplate. LLMs are actually pretty good at generating boilerplate.
See, also, testing. There's a lot of similar boilerplate for testing. Giving LLMs a list of "Test these specific items, with this specific setup, and these edge cases." I've been pretty happy writing a bulleted outline of tests and getting ... 85% complete code back? You can see a pretty stark line in a codebase I work on where I started doing this vs comprehensiveness of testing.
With both Python code and TS, LLMs are in my experience very good at generating test code from e.g. markdown files of test cases.
So you went from being able to handle at most 10 or so of these tasks you often get per week, to >500/week. Did you reap any workplace benefits from this insane boost in productivity?
My house has never been cleaner. I have time to catch up on chores that I normally do during the weekend. Dishes, laundry, walk the dog more.
It seems silly but it’s opened up a lot of extra time for some of this stuff. Heck, I even play my guitar more, something I’ve neglected for years. Noodle around while I wait for Claude to finish something and then I review it.
All in all, I dig this new world. But I also code JS web apps for a living, so just about the easiest code for an LLM to tackle.
EDIT: Though I think you are asking about work specifically. i.e., does management recognize your contributions and reward you?
For me, no. But like I said, I get more done at work and more done at home. It’s weird. And awesome.
That doesn't sound like a situation that will last. If management figures out you are using this extra time to do all your chores, they aren't gonna reward you. They might decide to get someone who would use the extra time to do more work...
1 reply →
I used to spend time writing regex's do to this for me, now LLMs solve it in less time than it takes me to debug my one off regex!