Amazon CodeWhisperer recently became generally available, and as a developer who uses GitHub Copilot on a weekly basis and works with AWS daily, I was eager to give it a try. In this article, I will share my impressions and the key differences I noticed while experimenting with the new AI-powered code assistant.
To give some context, I have been using GitHub Copilot on a weekly basis for my open-source projects, such as KoPylot. I have been writing code for over 10 years, and I must say is one of the best coding tools I have ever used.
The way I see it, Copilot acts like a sculptor’s assistant, placing clay in the precise spots where the sculptor intends to shape. Although it may occasionally apply slightly more or less clay than needed, the overall speed up in the sculpting process is net positive.
Getting Started with CodeWhisperer
AWS took a different approach with CodeWhisperer by allowing users to start without an AWS account. This is a significant step towards increasing adoption. This is because creating an AWS account requires a credit card, and currently, CodeWhisperer is free for individuals.
It’s important to note that while it’s free now, it might not always be. GitHub Copilot followed a similar approach before introducing a $10/month fee. For companies, the price of both tools is the same, $19/user/month.
Unlike Copilot, CodeWhisperer doesn’t have its own VS Code extension. It is part of a larger extension for AWS services called AWS Toolkit. This approach might intimidate users who are unfamiliar with AWS, since the extension contains many features unrelated to CodeWhisperer.
You can find here a video tutorial showing all the steps to get CodeWhisperer installed. The tutorial also demonstrates how to set up CodeWhisperer on different IDEs.
Language Support
According to its release article CodeWhisperer supports Python, Java, JavaScript, TypeScript, C#, Go, Rust, PHP, Ruby, Kotlin, C, C++, Shell scripting, SQL, and Scala.
In contrast, Copilot was trained on all languages that appear in public repositories, with less-represented languages producing less robust suggestions (source).
During my tests, I felt the limitations of CodeWhisperer’s language support. Specifically, while writing documentation on a README.md file and writing Terraform code.
I understand AWS’s caution regarding CodeWhisperer’s language support. Google’s Bard is a good example of what can happen to a big company when it releases an underdeveloped AI product.
However, I hope that AWS will add support for not only Terraform and Markdown, but also HTML, CSS, YAML, and JSON in the near future. The lack of support for these languages could be a dealbreaker for some developers.
Features
Copilot X was recently released, but since I don’t have access to it yet, I won’t mention its new features in this section.
The feature I enjoyed the most from CodeWhisperer is the Code Security Scanning, which Copilot doesn’t offer. AWS provides 50 scans per month for individual users. The security scan checks for vulnerabilities in the code and provides suggestions for remediation.
CodeWhisperer showing vulnerabilities found in the codebase.
Another unique feature in CodeWhisperer is the indication of code similarity to another project. If the generated snippet is similar to an open source code it shows the origin. It is good because Open Source projects will at least get some credit, different from what happens with Copilot.
I was happy to see that CodeWhisperer also offers completion for Jupyter Notebooks within VS Code, which is very convenient whey you are doing data wrangling. The integration with JupyterLab is currently unavailable, though.
My experience as a user
As part of my experiments, I ran both code assistants side by side, and here’s what I noticed:
- Working with Python code, both tools produced similar results with Copilot being slightly better.
- CodeWhisperer took a bit longer to generate code completions.
- Copilot provides more unprompted inline suggestions, while CodeWhisperer occasionally needs Option+C to request completions.
Despite CodeWhisperer’s slightly slower output speed, I don’t view it as a reason to avoid the tool. Since code generation speed is linked to computing power, AWS should have no problem addressing this issue.
Privacy
Currently, CodeWhisperer is hosted only in the N. Virginia region, which may pose GDPR issues for users working with sensitive data in Europe. Hopefully, AWS will soon host CodeWhisperer in European regions to address these concerns.
It’s worth noting that you have control over whether CodeWhisperer can use your code to enhance its service. You can toggle this option in the CodeWhisperer’s settings.
Claims about productivity increase
Both tools claim to increase coding speed by over 50%. Personally, I find that I accept Copilot’s suggestions about 30–40% of the time, which aligns closely with their estimates.
CodeWhisperer source, GitHub Copilot Source
Suggestion of usage for CodeWhisperer
If you don’t have a project to test CodeWhisperer with, and you’re interested in Open Source, here’s a suggestion on how you can use CodeWhisperer to start your contributions:
- Find an open source project that interests you.
- Fork and clone it.
- Run CodeWhisperer’s security scan tool on the project.
- Review the vulnerabilities found.
- Create a pull request to address and patch the vulnerabilities.
I tested that on a few Open Source projects and I found many low hanging fruits.
Conclusion
If you develop in one of the languages supported by Code Whisperer, I definitely suggest you to give it a try.
Copilot is in the market since October 2021 and is visibly a more mature product. But it doesn’t mean that AWS can’t catch it.
For now, I plan to continue using both assistants. Copilot for generating code and CodeWhisperer for scanning the code for vulnerabilities. I’ll also follow up on CodeWhisperer’s new developments, so I can reassess its code generation capabilities once it adds support for new languages.
I hope you enjoyed this post. If you have questions, you can find me on LinkedIn.
See you in the next post 👋!