Impressions
Using Cursor to make a basic PacMan clone and Canvas application has given me some insights into generative AI tools. The productivity boost this provides experienced developers (like me) is astounding.
Pros (AI Generated)
- Dramatically speeds up initial project setup and boilerplate code
- Excellent at understanding context and generating relevant code
- Great for exploring new technologies and frameworks quickly
- Reduces time spent on repetitive coding tasks
- Provides helpful suggestions and alternative approaches
Cons (AI Generated)
- Sometimes generates code that needs significant debugging
- May not always follow best practices or project-specific conventions
- Requires clear communication to get the desired output
- Can be overly verbose or miss the mark on requirements
- Still needs human oversight and code review
I requested that Cursor make a Pros and Cons bulleted section. It took a couple seconds and worked nicely. What it also did was generate the Pros and Cons content for me, hinting at some of the more nuanced aspects of using a tool like this. Let me provide my own Pros and Cons.
Pros
- Tons of repetitive, heavily-standardized code can be created in moments
- The examples it provides and code it writes tend to work, so you can generate bespoke code you can then study and learn from, even if you are only vaguely familiar with what it's functionally doing
- The AI lists precise communication as a Con. I think it's one of the greatest benefits - the necessity for concise ideas and phrasing will lead to better human-to-human communication, too
- On top of that, Rubber Duck Debugging (explaining your issue with words to a rubber duck to better understand your thought process) is implicit in everything you use AI to do
- Heavily benefits from, and practically requires, human cooperation and insight
- This tool in particular can provide useful content suggestions, installation instructions, moral support, and other more open-ended assistance than just code
- With all the code that is going to be written by AI, good programming standards will become more common and programs of all kinds will take on more unform look. This will make it easier to debug and refactor for both humans and robots
Cons
- The AI can get stuck in debugging loops, attempting the same kinds of strategies to fix problems and providing the incorrect solutions over-and-over with absolute confidence
- The AI will happily provide structure for the code, which will become an inescapable trap if followed blindly and will lead to a project that feels like it should work, but would be impossible to refactor without completely changing the approach and organization
- Exponential context growth
- The AI can infer what kind of visual/rendering effects will occur from it's changes, but cannot see and interact with them as a human can
- Paid AI models require per-transaction billing at some level, and Cursor uses a monthly pool - I would prefer daily/hourly
I'm not sure if these are good or bad
- AI is going to become a major proponent of code standards
- The AI's willingness to use my Jargon for everything may lead to siloed language instead of universal, but makes navigating my own context intuitive
- I find myself using prompts for ridiculously basic tasks. If we did cost analysis, the 10 seconds of time and brainpower saved by me using AI to add width: 100% to a css class would likely be worth the 2 cents it costs
Specific Example
On the canvas page, there are rectangle, circle, and diamond widgets that can be dragged unto the canvas and connected up. This worked instantly for the rectangle and circle widgets, which it provided as an example when generating the app entirely from my prompt. I asked it to add a diamond widget, which led to issues. The AI decided that the best way to make the diamond would be to apply a rotation transform to a square. This caused the text to be rotated and the connector lines to not line up with the visuals. The AI was absolutely unable to resolve this issue, and kept making changes in attempts to fix it that broke other aspects of the canvas.
What ended up solving this issue was a suggestion from me: Instead of using a rotation transform or pseudo elements, which are difficult to work with and would require complex math considerations with every other functional part of the canvas, we could just render something that looked like a diamond behind the actual widget, which is a circle and also invisible. Since the widget didn't need to "BE" a diamond, just appear like one to a human, we took the more simple approach and solved the issue in a way that was more compatible with the existing functionality.
This also gave me some reasonable hope for my career security, at least for the next half decade or so.