Skip to main content

How I use AI as a developer today

Jose CerrejonAbout 6 minDeveloper

How I use AI as a developer today

AI
MEME found at r/ProgrammerHumoropen in new window

Info

Post updated on September 04, 2024.

I don’t tell you a lie when I advise you that if you’re not using AI in your day-to-day life, you’re missing a great opportunity.

WE CAN'T ESCAPE!.

This is moving fast and you do not need to be convinced that it can help you in all the processes you perform, in the profession you have. In this article, I'll tell you how I use it as a developer and maybe in another article, as a writer.

GitHub Copilot

AI Code generation meme
True, true...

I’m not going to spend much time telling you what I write in this section either. For $20 you have an assistant on your IDE that helps you write code. It’s not perfect by the way, but it saves you time and I'm impressed with the Wow 😱 effect.

Sometimes, it even gives you solutions you hadn’t thought of (and at first it makes you angry as a human that you are). It’s like the smart-ass dude who’s correcting you and giving you solutions without asking him... Funny that I came to mind Eddie Deezenopen in new window acting in the movie WarGames.

Eddie Deezen
You rock, Eddie Deezen! DEP.

Not everything is as beautiful as it seems, because sometimes it gives you solutions that are not the most optimal, and you have to review them (there are hundreds of memes about this, here is one 😂 ). But hey, that’s what it is this year. The next one, we’ll see...

By the way, in VSCode remember to install the two essential extensions to get the most out of it: GitHub Copilot and GitHub Copilot chat. You also have an extension for use with GitHub Codespacesopen in new window, which allows you to use Copilot in the cloud.

I recommend looking at the playlists on the Visual Studio Codeopen in new window YouTube channel. I leave you some tips that I use in my day to day:

  • Ideal for small scripts: It is one of the features I use most. I have created scripts to automate tasks that took time and now I have them in a snap. For example, a script that cleans the external storage systems before expelling them in Rust (and I don’t have much idea of this language), another that downloads YouTube playlists...

  • Make my tests!: What we most hate as programmers, but that helps us to see if what we write meets expectations (and we have not screwed updating a method). Our friend helps you write the tests, but It's not thinking about them. You give him a little push, you’ll see how fast the dirty work does.

  • Use keyboard shortcuts: If you use VSCode like me, I recommend that you learn the keyboard shortcuts it offers. Cmd + I to ask him inline, Shift + Cmd + H opens the side chat so you can ask him.

  • Use / in the chat: If you type the back / in the chat, it gives you a list of commands that you can use to improve the response. In my case, I use a lot @workspace to give me solutions according to my workspace, but you have many others: /help, #file:index.html, /explain, @vscode, etc.

  • Ask what you want: It’s an AI, so don’t be afraid: How can I build this project? How do I install the dependencies? Where are the middlewares? Can you give me the secret to get rich? Remember that if you don’t want generic results, you have to specify @workspace or @file to get solutions that fit your workspace. It is not the same build me a class Calculator that build me in PHP a class Calculator documenting the methods and typing the parameters.

  • Errors in the code or Terminal: If you get an error when executing your code, you can ask Copilot what is happening. Select the error and paste it into the chat. If the problem comes from the terminal, select the code, press the right mouse button and choose the Explain this option. You can also click on the stars ✨ that appear on the left of your prompt.

GitHub mobile screenshot
GitHub Mobile has Copilot, too
  • On your smartphone, too!: If you use GitHub on your smartphone, you can use GitHub Copilot. 😍

  • When all fails or doesn’t get the solution you’re looking for: Don’t get upset. What I do is create a new chat and ask again. Above all, it happened to me when he offered you code that comes from some public project. You must specify in the settings within GitHub Copilot that you want to (or not) give you solutions using public code by turning on or off the option Suggestions matching public code (duplication detection filter).

comments
Let that generate the comments for your commits
  • Let that generate the for your commits: If you don’t like to write comments for commits, tap the stars icon ✨. The good thing is that it is learning from your comments and will give you descriptions according to your style.

Help in the Terminal

Warp AI
Warp AI

When I have to write a command I don’t know or don’t remember, I always go to Warpopen in new window, the Terminal that has built-in serial AI. It’s like a Copilot for the Terminal and it’s cross-platform. If you haven’t tried it, I recommend it. So write what you want to do and it gives you the solution. Easy and fast... It's free, but it has payment plans.

Yes, Copilot in the Terminal

GitHub Copilot can also help you with terminal commands in three different ways: you specify the word @terminal before your chat question, with Cmd + i in the terminal view inside VSCode or you can use GitHub Copilot in the CLIopen in new window.

Code reviews

Sourcery screenshot
Sourcery in action!

If you use a GitHub or GitLab account, you can incorporate sourceryopen in new window into your workflow. In my case, when I go to make a pull request, it gives me suggestions on how to improve my code. For projects open-source is free.

AI agents

AI Agents
Guide of AI Agent Types with examples. Mediumopen in new window

Although it is not a tool that I use daily (yet), I find this concept interesting to mention. They explain it very well in this article by Zapieropen in new window. I'll let my AI explain it to you:

Imagine you have a bot that helps you do repetitive tasks, such as letting you know if a server is down, telling you if a pull request has been approved, or letting you know if an issue has been closed. Well, that’s what AI Agents mean.

You have at Medium a specific topic about it that you can find hereopen in new window. For reference, the AgentGPTopen in new window project is a good example of what I’m talking about.

If you don’t have time to spend programming these types of agents, your solution may be to use LLM Pipelines, which is a service that allows you to create AI agents without having to program. Check out this articleopen in new window called You Don’t Need an LLM Agent.

As a learning tool

I think it’s one of the best tools you can have to learn how to code.

In case you are starting with a new language or framework, my advice is to create a markdown file with a header type How to make a CRUD in Python or Introduction to Rust programming. Behold how it begins to give you ideas and sections continuously.

Tell me what you know about my PDFs

I worked as a project manager for the last two years, and I accumulated a lot of reports. If a client requested any data, I had to look for it among hundreds of Word documents or PDFs.

When I found the private-gptopen in new window repo, all I had to do was ask for any information from a chat, and it was returned to me along with the name of the file where it was quickly and (almost) effective.

It is a tool that I recommend if you have to deal with many documents and your brain does not remember the commissions that were agreed on six months ago. The best: privately and locally.

Other AI you can use

If you are not convinced or do not want to pay for GitHub Copilot, there are other options.

For example, Tabnineopen in new window in its Basic plan, uses autocomplete code and is a GitHub Copilot first cousin. Another approach is DeepCodeopen in new window, which is a code analyzer that helps you find errors and improve your code.

The above-mentioned Sourcery can also help you in this regard and it is very easy to implement it. You can see the documentation for VSCode hereopen in new window.

Do you know Continueopen in new window? It is a very young extension for VSCode and JetBrains. It seems Copilot, but locally. That is, the model must be supplied by you using Ollama or similar (list of models hereopen in new window). You can get more info hereopen in new window.

There are many sites specializing in AI for developers, such as Phindopen in new window or Userwayopen in new window, but I recommend those you can use within your IDE, to make it easier to use and "learn" to give you code according to your workspace.

Other I don't tested, but I have heard good things about them are codeiumopen in new window and supermavenopen in new window.

Final words

It’s funny what happens with this technology: if you don’t use it, you stay behind, and if you use it, it’s like that new co-worker who has put you aside so that you learn everything you know and the company can hire you in the future.

According to some analysts, there is still a lot left for that to happen (five years!), although others believe that it is one more tool and that it will simply modify the way we interact with machines.

Allow me, in the meantime, to enjoy the advantages that it offers me to improve my writing, either of code or of prose, and to continue helping me in those works that take me more time than I would like.

As an example of what I am talking about, I have written the word we, and look at what the autocomplete of Copilot tries to convince me of:

Copilot, your friend 🤖

We have to be aware that AI is not the enemy, but a tool that can help us to be more efficient in our work.

Whatever you say, dude. Whatever you say... 🤦