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? 

Anti gravity out of the box and I used Gemini 3 Flash. I give it a detailed requirement document for a 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 not so good not so bad. 
    1. The project is semi functional as I expected, some of the most interrelated business rules were not exactly implemented as it was 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 customs errors and data validation, and some potencial problems with the implementation of a finite machine state in one entity.
    3. There was no problem managing and connecting different libraries, for 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 vs probably the 20+ hours it would've take to me write the same amount of code. Even though, is not perfect, the code is a good template to start customizing the application's functionalities.
Definitely I will be exploring another configurations, try with different agents and iterate over the first result to see how good the final result can be, stay tune! 



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 ...