Ir al contenido principal

Navigating AI generated code

Hello peers in wisdom,
Last week I was experimenting for the first time with AI tools to generate code, specifically with the code editor, Antigravity. I'll describe my configurations, experiences, expectations and results. 

What was my setup? 

Antigravity out of the box, and I used Gemini 3 Flash. I gave it a detailed requirements document for an automated quoting system.

What were my expectations?

  1. Semi-functional project
  2. Clean hexagonal architecture
  3. Use of libraries I indicated it



What was the result?

It was neither too good nor too bad.

  1. The project is semi-functional as I expected. Some of the most interrelated business rules were not implemented exactly as expected. CRUD and authentication systems were fully functional.
  2. The code architecture was hexagonal as I asked for, but there were bad practices implemented, such as anemic entities, use of any instead of mapping with a DTO. Also, there was a lack of custom errors and data validation, and some potential problems with the implementation of a finite state machine in one entity.
  3. There was no problem managing and connecting different libraries. On the contrary, Gemini detected incompatibilities with the newest version of Prisma ORM and automatically decided to version down to solve the problem. Pretty cool!


Conclusion

It took me around 4 hours to read Gemini's generated code versus probably the 20+ hours it would have taken me to write the same amount of code. Even though it is not perfect, the code is a good template to start customizing the application's functionalities.

Definitely, I will be exploring other configurations, trying different agents, and iterating over the first result to see how good the final outcome can be. Stay tuned!



Comentarios

Entradas populares de este blog

I forced myself to read Rust code

 Hello peers in wisdom, One month ago I found myself reading The passionate programmer by Chad Flower, here the author gives valuable advises for building a strong career as a software engineer (is not easy by the way).One of his insights inspired me to write this brief blog to share with whoever read this. The more or less I learn this week.  As the title suggests, the advice is READ CODE. What kind of code? The good kind. So... after dedicating around 100 hours to read the Rust book and resolve some basic exercises   I felt prepared enough to tackle some real code. I decided to search in the popular section of crates.io, and I found serde, a rust library for data serialization/deserialization. After 5 minutes of cloning the project and reading I was completely lost. Are people who wrote this geniuses or did I just lose 100 hours of my life? Fortunately (or not) it was a mix of both. Anyway, the next day I am back at crate.io and this time I chose something less popular....

Applying DDD on pricing goods at supermarket

Hello peers in wisdom, I hope you had a wonderful week. Todays topic consist on exercising a non technical part of software. Domain-Driven Design DDD is a set of tools that makes easier to understand business experts and then translate their knowledge domain to our domain (software). I encourage you to learn more by reading and watching the resources I found useful, they are at the bottom of the post. Pricing goods The definition of the problem is on this  kata . The goal, basically, is think about functionalities, edge cases and implementation for pricing goods at a supermarket. Steps I followed     Event Storming . This method helped me to start defining what where the things I expected to happen in this system. In the image you can identify them by the salmon color. Its important to note that at the bottom right is defined the meaning of each box color.           Commands and actors . The next step was to ask who makes what . In this case ...

The Profitability of Knowledge: Learning for Use vs. Learning for Joy

Hello peers in wisdom, Today I bring to the table the next question. Is any knowledge profitable? Context I am a newbie back-end developer and recently I was studying a pair of low level programming concepts. While doing so, I asked myself "Am I really going to use this? If yes, when? if not... why?" That’s when I realized I was studying simply because it was entertaining.  Is that wasting my time? It could be... but what is the purpose of life? Isn't everything we do, in some sense, a waste of time ?  I will defined as an inefficient activity. The time my brain will retain the vivid image of those new pieces of information is very short, I am talking about one week max, after that just crumbs of knowledge and a memory of joy for learning something new will remain. It would be better if I applied that knowledge to something practical.... What is the alternative? Some time ago I read a post talking about learning just-in-time JIT. This approach brings numerous benefits t...