DEV Community

Cover image for Should I use AI? short story from a document to typed code
Uralys
Uralys

Posted on

Should I use AI? short story from a document to typed code

Introduction

I'm currently building the AlterEgo platform, and here's a concrete example of using AI to accelerate my coding:

My PO comes with that french Google Doc, and a beautiful list of choices defining work methods and personality traits.

Our UI designer has crafted a magnificent design on Canva.

Image description

Not so long ago, formatting and translating a text document into typed code would have taken a substantial, uninteresting, and repetitive amount of time.

Today, I can do it in a few minutes and dedicate my time to the project's structure, a real pleasure.

Let me show you how.

0 - Starting Point

So, I started with this document:

Image description

1 - ChatGPT

As I code on VSCode, I integrated the GenieAI extension, allowing me to generate questions directly from GPT-4 within the editor.

Image description

The first step is to ask ChatGPT to generate a JSON translated into English from the Google document:

Image description

I insert the json into my TypeScript file, and Copilot comes into play.

2 - Copilot

Just by defining a variable whose name is part of my new object, Copilot directly suggests a complete object in camelCase:

Image description

The same goes for types; I simply type t, and Copilot directly suggests the type:

Image description

Then, a simple Enter, and I see the next type, just a tab away:

Image description

30 seconds later, my typing is ready for the attribute selection screen and their storage in my state:

Image description

Now I am ready to build Elisa's screens without being frustrated by the time spent on translation and formatting.

Thanks for reading, see you around!

Well that was a fun introduction about how AI takes care of boring tasks for me.

I'll go further in the code in my next articles #DEVResolutions2024.

For example, I want to share with you how I built and optimized my React environment to quickly build screens.

Feel free to comment on parts you need more explanations for, or share your thoughts on how you would have handled the parts you disagree with.

Top comments (0)