First Experiences with AI Coding
I’ll share my journey learning to code with AI—the frustrations, breakthroughs, and what finally made it worthwhile.
As a long term vim user it was hard to onboard to AI. For the first few tries I wasn’t able to understand the benefit as my regular coding setup was as effective as with AI. After jumping over few hurdles I think both code quality and speed improved. Using augmented coding tools is a muscle to train, different than what I used to. I’m well onboarded to codebase and Python so article is written with that in mind.
My journey
When I started with AI, development efficiency was similar or worse compared to baseline. I was used to favourite IDE tools and reliable habits that carried me gently. I did fewer mistakes which accounted for faster shipment of new features and less bugs. Since my friends were gaining benefits of AI I started to ask myself: why it doesn’t work for me?
The first answer was: I overestimated role of AI (as of Q4 2024). I thought AI is capable of delivering features from description. I typed instructions and explained target design. Most of attempts failed which was visible in a few areas:
- tool wasn’t able to select right files
- changes were misaligned with my vision
- code style was not aligned with my/project conventions
- overall cost was too high:
<total time> = <time wasted with AI> + <my regular time>
- it took long time to read diffs and make sense of entire change
To mitigate verbosity second line of attempts focused on smaller changes in few files. I explained things thoroughly and gave details instructions. It was better than the first time but still wasn’t able to make my work faster than if I do changes myself. Mainly because it took considerable time to write free text description of the change. Also I needed to review code more thoroughly than usually and fix errors. I felt like my work shifted from the mode of creator to reviewer. It took away fun of building things, it was more exhausting and less satisfying.
The breakthrough
Third line of attempts focused on autocompletion. And it finally gave me some speed benefits. I switched from vim to VS Code to harvest their autocompletion features. This made my coding joy again, especially the feature that proposes changes regardless of cursor position. I wasn’t able to find something similar in vim and hope some day it will be there. I experienced more bugs because suggestions were not validated with real code tokens. Maybe improved setup would help with autocompletion reliability, although at the same time I started to experiment with voice input.
Now I have my own secretary that understands coding and gives me enough advantage to regular workflow that I switched for some kind of tasks to AI. Nowadays I code most of new features and bigger modifications this way. I dictate messages to chat with my voice, than add files manually and conclude with Apply
. One task after another I have my change ready. Still need to do deeper self-review and make sure that tests are quality but engineering became more efficient again.
I like this approach because I can focus more on the design, interactions between modules, data modelling and function signatures. AI takes more care of implementation. I also organize implementation details in separate files. I stick to basic rules: write step-by-step enumerations and list the properties I want to preserve. Single implementation specification have additional benefit that I can retry quickly on bug or misspecification I encounter on the way.
Pros and cons
I think AI is good to assist learning new programming language and onboard to new codebase. It knows how to describe code using right nomenclature both directions in and out. AI can find nuances in algorithms and generate diagrams with summarizations. From this angle AI is great at cherishing theory of systems so that you can have JIT complied documentation. It’s a gift I’m grateful for compared to past generations of engineers.
Another useful use case is refactoring. AI helps to develop features quickly although in long run can lead to messy code. If you see distributed business logic, vague source of truth or repetitive code AI will improve it in fraction of time you need. Only thing you need to do is spot issue and ask for improvement. You can tidy code with less cost which pays off in the longer term since its another way that helps to build knowledge about the system.
Some drawbacks stem from how you use the tool rather than the tool itself. AI code is verbose unless you tell it otherwise. It leaves dummy comments so you need to teach it that variable names are informative. Generated code contains comments that are helpful to drive implementation but are obscuring final product for humans.
AI can write tests quickly but they have some drawbacks. They tend to use mocks heavily. AI doesn’t know where to stop, I’ve seen examples of 3 layers of mocks like: mock_class1.mock_class2.mock_class2
which are hard to manage. Heavy mocking tests the implementation rather than the functionality. By default AI mocks both input and output of nested functions. The solution is teaching AI your testing preferences and conventions.
Another issue I’ve seen is tautology testing. It writes tests that are basically always true like 1 == 1
. One example was when AI asserted on function result attributes like result.attr1
by comparing to result.attr1
wrapped in type(result)
. So the assertion was result.attr1 == type(result)(attr1=result.attr1)
which is always true. It happens from time to time, just be aware about it.
AI evolves quickly, making it hard to keep up with new capabilities. Improvements are done month by month enabling new ways of working with AI. It requires to change mindset and take time to experiment. I really liked my previous vim setup—it made me feel like I was playing a platform game with all the jumps and shortcuts I’d learned. Now I use VS Code and I don’t get previous gaming experience but at least its more effective. I hope some day vim will keep up and I will use it again.
Summary
AI requires changing habits and actively seeking new workflows. It has a learning curve, and using it effectively is a skill in itself. It may require changing your IDE, habits, and ways of working. I enjoy this journey and try to make the most of it, but I constantly discover new pitfalls.