AI Programming Assistants are Good at...
My Experience with LLMs
In my personal/professional experience, I find AI assistants to be most useful for mundane tasks such as boilerplate code, documentation, tests, and last but not least refactoring. All of these tasks require the reapplication of established patterns and strategies usually found within the project itself. AI is just a fancy way of predicting what patterns it sees in the provided context, making it a great tool for these kinds of tasks.
Before we continue, let me address everyone who is thinking "aI iS nOt ReLiAbLe!" or "HoW cAn YoU TrUsT tHaT cOdE?!". I have two words for you: Skill Issue. I'll elaborate more below.
AI Programming Assistants are Good at...
Boilerplate code
AI programming assistants can significantly reduce the effort needed to write boilerplate code. Tasks like setting up classes, methods, and repetitive configurations are tedious, but AI can quickly generate these based on simple prompts or predefined templates. This allows me to focus on the core logic and functionality, while the assistant handles the monotonous groundwork.
This is not to say you can blindly tab your way to the perfect project skeleton. Using AI for boilerplate code moves the work required by the engineer from writing the function names and structures to reviewing proposed code changes. Having a tight feedback loop and clear code diffs (such as Cursor's composer) to course correct or polish a result you don't love is vital to practicality.
Documentation
When it comes to documentation, AI assistants excel at generating docstrings, comments, and even entire sections of user manuals. They can interpret code and produce documentation that adheres to best practices, ensuring consistency and reducing the time spent manually writing detailed explanations. This is especially useful for large codebases where thorough documentation is crucial.
I have saved countless time documenting functions. This is work you can "double dip" on (so to speak) as it provides clearer context for later AI assistants interpreting your project and lets you generate web API docs for easier browsing (swagger for example) further empowering the team.
Testing
For testing, AI assistants can help generate unit tests, integration tests, and edge case scenarios by analyzing code and predicting potential failure points. They can automatically create boilerplate test structures, suggesting common assertions and helping ensure code reliability without requiring the developer to manually define every test case.
This one is incredibly important for the ongoing maintenance of tests in established projects too. Everyone has done the thing where they have 5/7 passing tests on a PR, so they push a new commit, and now they have 5/5 passing tests on that PR. Don't be this dev. AI assistants make it easier to get up-to-speed with tests we did not write ourselves (Which for most of you is all of them).
Refactoring
Refactoring is another area where AI assistants shine. They can identify redundant code, suggest optimizations, and improve readability by restructuring functions, renaming variables, or applying design patterns. This improves code maintainability without the need for extensive manual review, making it easier to adapt and evolve codebases over time.
Everyone has tech debtty issues in their projects, and no one likes dealing with them. Not the engineers, not the managers, and especially not the C-Suit. I've been able to passively refactor an insane amount of tech debt using these assistants. The most helpful has been Cursor by far. The project-wide context and referencing exactly the files you want to be included in the context are insanely powerful. This lets you scaffold out a solution, provide that template as context along with the files/code to be refactored, and let the LLM do its predicting.
Finale Thoughts
AI-powered programming assistants have revolutionized the coding landscape since tools like Chad and Copilot debuted. Initially flawed and met with skepticism, these tools have evolved to become invaluable in my day to day. Tools like Cursor, which enhances VSCode with project-wide context and file management, have especially proven their worth by significantly boosting my productivity. AI excels at automating repetitive, mundane tasks, enabling engineers to focus on higher-level logic and innovation. While some still question the reliability of AI in programming, its benefits, when used thoughtfully, are undeniable.