Select Page

As a developer, finding the right tools can make all the difference. I spend most of my coding time in PhpStorm, and recently, I’ve been diving deep into two AI assistants that are stirring up the coding world: JetBrains AI Assistant and GitHub Copilot. For the past few weeks, I’ve been putting both to the test, exploring how they stack up in real-world coding scenarios. It’s a fast-changing field, and what I share here is my take on these tools as they stand today. Here’s my hands-on review, straight from the trenches of daily coding.

Code Completion

It was early 2023, and the AI bandwagon was gaining rapid traction. I tested several code completion services in the past, but was drawn by the ongoing Hype the Copilot created at that time. So, finally I was ready to purchase a paid subscription and get my virtual coding assistant!

Almost instantly it was clear to me that the Hype was justified. Copilot happily suggested code bits as I was typing away in PhpStorm.

Copilot recognized other functions in my open file and could provide correct recommendations based on that code. I was hooked!

Do We Need Completions?

Fast forward 9 months, to end of 2023. Copilot has become a helpful and loyal friend. Still, meanwhile I spent more time with ChatGPT discussing my projects, copy pasting code from Open AI’s master brain. Copilot could not keep the pace with that kind of versatility.

To make things even worse, I slowly became aware of the many manual changes I needed to make to the code suggestions provided by GitHub’s assistant. Slowly, I began ignoring most of the completions since I was faster typing out the right code myself, compared to manually correcting the code provided by Copilot.

Of course, Copilot can do more than just completing code: The feature video displayed an editor where Copilot turned a comment into a working code snippet. It looked impressive, but in reality, I found Copilot usually continued to “complete” my comments into a longer description, instead of turning them into code.

Give AI Assistant a Chance

As I’m a huge fan of JetBrains products, I’m spending most of my coding-day in PhpStorm. You possibly already guessed it: As a loyal customer I wanted to give their home-built AI a chance and got on the waitlist (or the beta program; can’t remember).

And my experience with the JetBrains AI Assistant was almost the opposite of what I had gone through with Copilot: It was not really exciting at first. Copilot had spoiled me with tons of code completion suggestions, where AI Assistant was very shy with showing those completions.

I was ready to uninstall the AI Assistant plugin again! That was the turning point of my experience: To uninstall the plugin I opened the Settings > Plugins dialog of PhpStorm. And there I saw a list of the other features that AI Assistant brought to the table. Phew, thanks JetBrains for providing that overview right below the uninstall button!

Wow! AI Assistant is actually not really about Code Completion (yet)

Deep Integration

Suddenly, I saw AI Assistant in an entirely new light. It’s not primarily about code completion, but about – surprise – actually assisting in coding tasks. Like writing a commit message based on staged files. Or explaining what the selected code is doing. And how to improve it.

Let’s be honest, if you’re depending on code completion to write code, you’re in the wrong industry. Code completion is a nice to have feature to write faster code. Two of the biggest dangers of auto-generated code are:

  1. Inserting buggy code into your codebase
  2. Getting complex snippets that you don’t fully understand

With the help of AI Assistant, I made my first steps in Python scripting, as the assistant patiently explained me every bit of some scripts I found online. Try that with Copilot!

I’ve mapped the keyboard shortcut ‌⌘+^ to the AI Assistant. This allows me to open the chat sidebar with a single hand and start typing right away. To understand a python script, I opened the .py file in Fleet, hit ‌⌘+^ and gave the instruction: Explain briefly what the currently opened script is doing. max 100 words

I just typed a 1-liner without pasting any code. AI Assistant has the context of what file I'm talking about.

Or check this out: After moving a PHP project from one folder to another location, I had some issues with the index. Instead of googling… you guessed it: I opened the AI Assistant and asked for help: I've moved the current project to a new directory. What steps do I need to take to make sure it's working smoothly in PhpStorm?

The Assistant has deep knowledge of the current IDE and can help with all kinds of support requests

(Btw: Step 3 in the AI response above solved my problems)

Assistance That Helps

There are too many use-cases to display them all, and possibly I’ve not even discovered all Assistant features yet. Here are a few samples of the JetBrains AI helps me with on a usual work day:

  1. Write the entire function documentation, including parameter descriptions. Super helpful!
  2. Suggest code refactoring to make my code more readable, secure, or stable.
  3. Help me with usage questions (“How can I connect to a local Postgres DB?”)
  4. Code questions! “Write a shell script for X.” “How can I hook into the login workflow in WordPress?” “What’s the difference between const and define?”
  5. Suggest commit messages. I mainly use this to get a quick overview of what changes I’ve made (for time recording)

Remember how I started discussing code topics with ChatGPT? Not anymore. AI Assistant provides much better responses for any type of code-related question.

How could we improve that code? Extracting repetitive logic into functions makes a lot of sense

Often, I discuss one function/feature with the AI in an ongoing chat, asking it to extend or modify its previous suggestion. This involves reasoning with the AI: Why did you use X? Can you make this shorter or easier to read?

Once the code is ready for usage, I hit the small button labeled “Insert Snippet at Caret” and do a few final checks.