The best trick to let AI's write your codes

By Imad Eddine Aris | justEducate | 10 Sep 2023


#development

Introduction

Hello, I'll be happy to give you an amazing tip to trick AI's such as chatgpt or Poe to give you complete codes of a project in any language.

Sometimes you probably don't have any experience to start developing a project but that won't stop you for creating a project, a complete one without any coding knowledge, you just need to know what to ask the AI. In order to achieve that, follow these steps:

1. Give the idea to the AI

This step should always start with a question : How to *****? this step may take up to 5 questions depending on your knowledge about that project. For example we will ask chatgpt to help us create a simple calculator app using python Kivy, and our first message should start like this: How to create a simple calculator app using python kivy?

this will give you some bazic details of such project such as installations, development environment, logic, UI, configurations... and all necessary things to start such a project, if you didn't like the answer, or you thought that something is missing you can ask more questions.

 

2. Ask for the schema

Second step is to ask the AI to give you the schema of files and folders for this project and the statement should be " send me a markdown schema of files and folders calculator app". This will send you a schema of files and folders of this app. For example we will continue creating the calculator app, we ask chatgpt to give us the schema and preferably we include word "markdown" to make the schema more organized: "send me a markdown schema of files and folders of this calculator app." chatgpt answer will look like this:

CalculatorApp/
|-- main.py               # Main Python script for the Kivy app
|-- calculator.kv         # Kivy language (KV) file for UI layout
|-- build.spec            # Buildozer configuration file
|-- README.md             # Documentation for your project
|-- assets/               # Folder for assets like images or fonts
|   |-- icon.png           # App icon
|-- .gitignore            # Gitignore file for specifying files to exclude from version control
|-- dist/                 # Folder where Buildozer stores APK files
|-- venv/                 # Virtual environment (optional)

#JustEducate

If you didn't like the answer or thought that something is missing, you  can ask more questions.

 

3. Ask for the steps

Next, you ask the AI what to do next or where to start based on this schema.

4. Ask for the codes

Finally, Start asking for the codes and the question should start like this: Send me a complete examole of ****.

In our case, we start like this: Send me a complete example of main.py, calculator.kv, build.spec.

Chatgpt will give you all the codes you mentioned when you complete the codes you can test the app if it didn't work, you should find errors, to fix that continue asking the AI, for example you can take the error log which contains the error and probably the where the error occurred, then paste in the AI prompt and type: Im facing an error. The AI will give you the fixing of that error. You can continue that until you project start working.

 

Because the method is very simple i wrote a very simple article as well, I hope you like this article. Thumb's up.

Lately, someone has taken my article and posted it somewhere and caused me to loose my authorship privilege, fortunately the publish0x team understood i don't mind sharing my topics but with this was I'll be having troubles, so i will be adding a copyright notice in my articles now on.

Copyright © JusEducate. All rights reserved. Unauthorized reproduction or distribution is prohibited by law.

How do you rate this article?

5


Imad Eddine Aris
Imad Eddine Aris

This is Imad, a Cybersecurity Analyst, Forex/Crypto trader and full stack developer.


justEducate
justEducate

Hello, this is my blog, in which we will address rich, useful and interesting topics on many interesting topics, the most important of which are 3 topics: 1: Cyber Security, 2: Forex/Crypto Trading, 3: programming and development. Additionally, there will be another category which is other topics (miscellaneous) Enjoy 👌😄

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.