DEV Community

Cover image for My first use of an AI code helper
Eric Ford
Eric Ford

Posted on

My first use of an AI code helper

I'm learning Django (and Python), writing a back end for my chess-like game (called Prongs, pieces can get wounded as well as captured). The AI assistant called Cursor was one of the recommendations a friend of mine made. I needed additional fields attached to the built in User model. The AI gave me a very thorough suggestion/tutorial/implementation of a Profile model to connect to the User model. HOWEVER... it used a signal receiver to create the Profile when a User was saved. I wasn't familiar, but it reminded me of Notifications in iOS, which I use sparingly. I googled this and sure enough, signals should be used sparingly, as they can make unit testing and debugging unnecessarily complicated. It looks like get_or_create (which is called Lazy in Swift) makes more sense. So my take away is that AI saved me a bunch of googling to come up with a good summary for creating a one-to-one model to connect to the User model, but it needed reality checking, which involved almost as much googling. Still, it was very educational. It looks like a very useful skill that will be needed going forward by coders. This is also why AI is scary to me; we need to treat it like a junior dev and not blindly trust its recommendations.

Top comments (0)