More about vibe coding in Linux

More tips on vibe coding on Linux

At the previous article We had discussed a couple of code editors for creating applications using Artificial Intelligence tools. In this article,We'll talk more about vibe coding in Linux.At a time when speculation is mounting about whether a cyberattack is the cause of the European blackout, we cannot but emphasize the risks of using this method of creating applications without a professional reviewing the generated code.

It is not the same to create simple applications like a pomodoro timer that works on our computer than a database that stores credit card numbers.and our clients. In the first case, the worst that can happen is that we work more than expected. In the second, we will cause financial losses.

More about vibe coding on Linux

As Masters and Johnson said in a book that had nothing to do with programming, what matters is not the size of the magic wand but the skill of the magician. It doesn't matter how many parameters the AI ​​assistant you use has if you don't know what you're doing. In my experience, ChatGPT and similar apps tend to make a lot of mistakes if you're not careful.

Tips for getting started with vibe coding

Choosing a development environment

There are several editors that include AI tools. We've also written in the past about AI models that can be installed locally, depending on your computer's capabilities. My favorite is Visual Studio Code, but everyone has their own preferences.

Look for a small project

Architects don't start out building skyscrapers, nor do surgeons start out performing heart transplants. Start with a small project, like a calculator or a media player. This will allow you to refine your ability to instruct tools and understand how they respond.

Be as specific as possible

AI doesn't know everything; it has information about some things and fills in the gaps through inference. If you're not specific about what you want—for example, the programming language, language version, libraries to use, and other similar information—we can run into problems.

Make copies before implementing changes

The changes proposed by AI tools won't always work, so make sure you have the latest version that worked.

Run the program and test it

Don't rely on everything going smoothly. It's important to run partial tests of the application's functionality to detect errors early.

Make changes and corrections

Each time you run the program, you may encounter the following results:

  • The program works but it doesn't do exactly what you said.
  • There is an error and the code was not executed
  • You came up with a new idea that improves functionality.

In all cases, try to describe exactly to the AI ​​what the problem or need is.

You'll need to repeat this process as many times as necessary for the program to work. If you want to learn programming, ask him or her to explain exactly what each part of the code does.

Example of prompts for vibe coding in Linux

Let's say I don't like the Linux terminal to always have the same colors and I like to listen to music in the background when I use it. I could ask the Artificial Intelligence the following:

Write a Bash script that changes the terminal colors, plays background music, displays a motivational message, and leaves the terminal ready for use. It should also include quick instructions for stopping the music and how to use the script.

The result will be something like this:

#!/bin/bash

# Change the terminal color scheme (you can modify the codes)
echo -e «\033[1;35m\033[47m»

# Motivational message
echo "✨ Welcome to your first vibe coding test ✨"
echo "Create, explore, and let your code flow "
threw out ""

# Set background music (requires 'mpv' or 'vlc' and a URL to YouTube, Spotify, or a local file)
mpv –no-video https://www.youtube.com/watch?v=5qap5aO4i9A & # Lo-fi hip hop

# Suggestion for the terminal environment
echo "Tip: Use tmux or split your screen for greater productivity."
echo "When you want to stop the music, run: 'killall mpv'"
threw out ""

# Returns the prompt to normal after finishing
trap «echo -e '\033[0m'; exit» INT TERM

# Keeps the terminal open for coding
bash
Do you want to know if it works?
Paste it into your favorite text editor and save it as script.sh. Then run it with the command ./script.shYou'll be responsible for another power outage. Just kidding, I'll just keep all your money.