I’m essentially a software developer, so, I cannot avoid AI, it is everywhere in my day-to-day tasks. But how to use it in a “healthy” way?

That’s what I’ll try to explain you using my own examples with some “whys…” so you can understand my view on it.

AI at work (as a software developer)

As I wrote on my previous article, My View on AI (wrong usage) , you must use the AI to be your assistant, to help you do your job and teach you, have it with you as a “private senior consultant” for who you can ask questions and exchange knowledge, challenge ideas and debate thoughts.

I got a new task, let’s do it

When I need to start a new task, my first step is to plan it myself (If is not a team task, okay? Working with other people changes this initial phase a bit.) based on my knowledge and my experience I will try to write how I’m thinking to solve it.

Once I have my initial plan, I go to the AI and I ask something like:

I have this task to do and this is my plan:
---- Paste the plan here ! ----
What you can see here that could be improved or done in a better way and why?

I also have set up the AI profile to act as a Senior Software Developer/Architect and I also added these two points:

  • Neither you or me are always correct, we can make mistakes, think about and be critical.
  • At the end, give me 3 questions (Q1, Q2 and Q3) about how to continue on this topic to improve even more it.

With it, I always get back some more thoughts to develop better the idea before I get into the coding part, helping me to see more cases I might have forgotten to take in consideration. And the 3 questions, this is really great, always I got back such nice questions to continue the idea and improve even more the solution. Seriously try it!

Planning phase done, let’s start writing some code

OK, after the planning is complete we move to the IDE to start to code, and what do we have there? Another AI assistant of course.

Do I use the AI to write the code for me? Sometimes, yes. Why not right?

But here is where things can go wrong end you can get tended to be addicted and deviate from your original path. Let’s go a bit deeper on this…

Code completion

This is a such good tool for one simple reason, this removes the boring (but so good for juniors learn) work to type boring code or repetitive ones. Another positive point is the fact that the code is shorter, you can easily read it and confirm if it is what you expect, what YOU would have written if the AI Assistant wasn’t there. If the code is 80% similar with the one that you have imagined, perfect, press TAB and fix the 20%.

Always put your code, why? It is your task right? You are in control, you must know what is going on this piece of code. And you have more than 3 years experience on this are, you know how hard is to read an old code written by you a year ago, now image trying to remember / understand an AI code from a year ago…

Agent mode (the scariest one)

This is the one that I’m really afraid of, it writes hundreds of lines of code at once and there is a “devils” button called ‘keep’ that you feel tempted to press… 😬

Where does the problem lie? They are on these points:

  • If you do not do a proper read and understand of this code, like a traditional code review, you can miss bugs or bad change that might break another feature (run time errors or business logic errors).
  • You cannot simply trust on someone else’s code that will be committed under your name, think on a compliance issue this could cause for the company in the future in an Audit process for example… Is your name stamped there.
  • Important, you need to remember this code later, if you don’t read it, if you do not make a proper debug to understand, you will not recognize this code in 3 weeks. (how difficult will be to fix an issue here in the future)

You can become a hostage to AI

Connecting with the previous article, My View on AI (wrong usage) , if you don’t read and don’t write, you don’t learn.

AI can make your job quicker when and if you know what you are doing and when you are on the control. You are the professional, the AI is your assistant.

If you try to use AI to deliver a task that you have never done, you might get in trouble if an error happens in production, you will not know how to solve, you will again ask the AI to fix it, it might do in some few prompts, but since you don’t know about it, you can’t test if everything else still working, the AI maybe will re-write a lot of code for a simple fix (big changes that introduce more problems). This is where you can become a hostage of AI.

So, how can I solve it? I need to delivery it but I never worked with. Ask AI to help you, not do it for you.

Use things like:

  • Hey AI, I need to build a system ABC, using the tech. XYZ, but I never use that, can you guide me on this?
  • I need to make a screen that does this, this and that, how can I implement it using this framework?
  • I got this code from another developer who is no longer at the company and he used some stuffs on the code that I have no clue, can you explain to me what is going on and why he did that way?
  • Can it be simplified? How?

Closing

I hope you liked these two articles, they ended up quite long but… I hope it can be helpful 😉🙂.