DEV Community

Cover image for Copilot vs. Cody: All you need to know
Desmond Obisi for Hackmamba

Posted on

Copilot vs. Cody: All you need to know

The advancement of artificial intelligence (AI) has impacted the software industry, especially with the introduction of AI coding assistants. A McKinsey study showed that developers using AI tools perform 20%-50% faster on average than those not using it. There has also been a debate about whether these AI coding assistant tools can truly increase or decrease developer's performance, function, productivity ratio, and overall experience.

As a programmer, I want to be productive and accomplish tasks faster with the help of these AI tools. I also want to use the one that provides the overall best experience regarding integrations, how secure it is, if the code suggestions are of great quality, and how easily I can extend its features and capabilities. This article will look at two of the most used AI coding tools from a developer's point of view.

While this article isn’t part of this debate, it will highlight the core features, strengths, weaknesses, benchmarks, etc., of these widely used AI coding assistant tools—Sourcegraph Cody and GitHub Copilot—to lead us to an objective conclusion on which is more reliable. Let’s get into the breakdown and comparison of these tools.

Overview of Copilot vs. Cody

In this section, you’ll learn the background of both tools, highlighting their core features and functionalities to help you understand them and their uses.

What is GitHub Copilot?
GitHub Copilot was officially launched in June 2021, resulting from a collaboration between GitHub and OpenAI. Powered by OpenAI’s Codex model, Copilot was designed to help developers write code faster by providing real-time suggestions and auto-completions.

It was released as a plugin on the JetBrains marketplace on October 29, 2021. On June 21, 2022, GitHub announced that Copilot was out of "technical preview" and is available as a subscription-based service for individual developers after one year of beta testing from developers who got early access.

GitHub Copilot · Your AI pair programmer

Core features of Copilot

  • Real-time code suggestions: Copilot offers contextual code suggestions as developers type, including entire functions and complex code snippets.
  • GitHub Copilot chat: Copilot now offers a chat interface where you can run prompts and generate things like unit tests, code snippets, etc.
  • Multi-language support: It supports many programming languages, from popular ones like Python, JavaScript, and TypeScript to less common languages.
  • Natural language to code: Copilot can convert natural language comments into actual code, which is particularly useful for prototyping and quick development tasks.
  • Learning from open source: The AI-powered tool is trained on billions of lines of code from public repositories, making it adept at generating relevant code snippets.

What is Sourcegraph Cody?
Cody, introduced by Sourcegraph, is an AI-powered coding assistant designed to use advanced search and codebase context to help you understand, write, and fix code faster. Launched in 2023, Cody aims to provide deeper context and more accurate code suggestions, particularly for complex and large-scale projects.

Unlike Copilot, which is heavily geared toward individual developers, Cody is built with a focus on team collaboration and enterprise-level projects.

Cody is an AI code assistant that uses advanced search and codebase context to help you write and fix code.

Core features of Cody

  • Contextual code intelligence: Cody is designed to understand the broader context of the codebase, making it more effective than many AI coding assistants for large projects with interconnected code files.
  • Multi-file awareness: Cody can analyze and provide suggestions based on multiple files within a project, ensuring its suggestions align with the entire codebase's structure.
  • Code search integration: Cody integrates with Sourcegraph's powerful code search capabilities, allowing you to quickly navigate and find relevant code snippets within their projects.
  • Custom commands: Cody has an option for creating custom commands that you can use to write large language model (LLM)- powered instructions. These instructions automate boring or repetitive tasks in their day-to-day work, such as documentation, comment writing, etc.
  • Multi LLM support: Cody is designed to use different LLMs for code generation, error fixing, optimization, etc. Cody also allows developers to add their LLM keys, and the usage will be on their account.
  • Multi-language support: Cody supports many programming languages, from the popular ones like Python, Javascript, Rust, C, and C++ to the less common ones like Julia or Zig.
  • Enterprise-grade security: Cody is tailored for enterprise environments, with enhanced security and privacy features, making it suitable for organizations with strict data protection requirements.

Now that we’ve explored the histories and the core features of the two AI assistant tools, let’s compare them in terms of functions, integrations, security, and developer experience.

Comparison between Sourcegraph Cody and GitHub Copilot

This comparison will evaluate how Sourcegraph Cody and GitHub Copilot perform against the chosen criteria, reflecting the expectations developers have when using these tools. The table below will provide an overview, helping to determine which tool stands out as the best option.

Table comparison between Cody and Copilot

Cost comparison
Cody: Cody is also available on a subscription basis, with pricing significantly better than its counterpart, Copilot. It also has a forever free tier, unlike the 30-day free trial from Copilot, allowing individual developers to have a thorough experience before purchasing.

Copilot: Copilot is available on a subscription basis, with individual and team plans. The pricing is generally affordable for individual developers, but the costs can add up for larger teams.

Ease of setup and use
Cody: Setting up Cody requires developers to install the extension from the supported IDEs marketplace, log in with their Sourcegraph account, and start using the tool. Cody can also be accessed on the web. The user interface is clean and integrates seamlessly with supported IDEs, providing an additional chat window interface and shortcut keys for handy commands.

Copilot: Setting up Copilot is relatively straightforward, especially for developers already using Visual Studio Code or JetBrains IDEs. The process involves:

  • Installing the Copilot extension from the marketplace.
  • Logging in with a GitHub account.
  • Enabling the tool.

Once set up, Copilot provides real-time suggestions as the developer writes code. The user interface is intuitive, with suggestions appearing as semi-transparent text within the IDE, allowing developers to accept, modify, or reject them easily.

Supported IDEs and environment
Cody: Cody is designed to work best with IDEs that integrate with Sourcegraph’s ecosystem. It supports popular IDEs like the VS Code editor, some JetBrains IDEs like IntelliJ IDEA, PyCharm, etc., and Neovim, which is still in the experimental phase.

Copilot: Copilot is primarily designed for Visual Studio Code editor and Visual Studio IDE, but it also supports others like Neovim and JetBrains IDEs like IntelliJ IDEA, PyCharm, etc. This wide IDE support makes it accessible to a broad range of developers.

Compatibility with programming languages
Cody: Cody supports a wide range of programming languages, including JavaScript, TypeScript, PHP, Python, Java, C/C++, C#, Ruby, Go, SQL, Swift, Objective-C, Perl, Rust, Kotlin, Dart, etc., and shell scripting languages (like Bash, PowerShell).

Copilot: Copilot boasts compatibility with various programming languages, from mainstream languages like Python, JavaScript, and Ruby to more niche languages. This versatility makes it a go-to tool for developers working across different projects and languages.

LLM Integrations
Cody: Cody defaults to the Claude 3 model from Anthropic for its code generation, autocomplete, and chat features, but its strengths lie in its diverse LLM integration(Claude, Mistral, GPT, and Gemini), unlike Copilot, which solely relies on the GPT models. It also allows users to bring their own API key for the supported LLMs.

Copilot: Copilot stems from a joint effort between GitHub and OpenAI, so Copilot is limited to only the GPT models for its code generation, chat, and autocomplete feature.

Quality of code suggestions
Cody: Cody shines in providing high-quality code suggestions that consider the broader context of the project. Its multi-file awareness and deep codebase understanding enable it to offer more precise and contextually appropriate suggestions, particularly in large projects. It also works well with popular code hosting platforms like GitLab, Bitbucket, etc., with respect to code generation and context awareness.

Copilot: Copilot’s suggestions are generally accurate and contextually relevant, especially for common coding patterns and standard libraries. However, its effectiveness can diminish in more complex scenarios or when dealing with highly customized codebases or codebases whose host is not GitHub.

Context understanding and accuracy
Cody: Cody’s ability to analyze and understand the entire codebase gives it an edge in providing accurate suggestions that align with the project’s overall structure. This makes Cody particularly valuable in enterprise environments where code complexity and scale are significant considerations.

Copilot: While Copilot is good at understanding the immediate context, the difference here is that its suggestions can sometimes lack the depth needed for complex codebases, particularly when the code spans multiple files or involves intricate dependencies.

Speed and efficiency improvements
Cody: While Cody may not generate suggestions as instantaneously as Copilot, its focus on accuracy and context often results in fewer errors and less time spent correcting code. This can translate into significant efficiency gains for developers working on large, complex projects.

Copilot: Copilot is designed to boost developer productivity by providing quick suggestions and auto-completions. This is particularly beneficial in rapid development environments. One of its strengths is its speed in generating suggestions.

Data handling policies
Cody: Cody is built with enterprise users in mind and, as such, places a strong emphasis on security and privacy. Sourcegraph offers more control over how data is handled, including options for on-premises deployment, which can alleviate concerns about data exposure in cloud environments.

Copilot: Copilot has faced scrutiny regarding its data handling practices, particularly concerning the training data derived from public repositories. While GitHub has implemented measures to protect user privacy, concerns remain about how user data is used and whether Copilot’s suggestions might inadvertently reproduce copyrighted code.

Intellectual Property(IP) concerns and business implications
Cody: Cody’s approach to code suggestions, which focuses on understanding the developer’s existing codebase rather than drawing from a broad corpus of public code, reduces the risk of IP issues. This makes Cody a safer option for businesses concerned about the legal implications of AI-generated code.

Copilot: The potential for Copilot to suggest code that closely mirrors existing open-source code has raised IP concerns. Developers and organizations need to be cautious about the legal implications of using code suggestions that might be derived from copyrighted material.

Value for money
Cody: Cody offers better value for money because it supports free users with a good feature list. Paid users even get more value and access to a wider range of features like flexible LLM choice, tight security, and context filters, which prevent LLMs from reading sensitive files in the codebase.

Copilot: For individual developers or small teams working on diverse projects, Copilot offers great value for money, especially given its fast autocomplete, broad language support, and ease of use.

From comparing features, functions, and differences, Cody emerges at least in my opinion, the clear favorite and a better option. The next section outlines how we reached this conclusion.

Sourcegraph Cody's strengths over GitHub Copilot

Cody’s core strengths over Copilot

The comparison table above considers the differences and similarities between GitHub Copilot and Sourcegraph Cody. Undoubtedly, Cody shows to be a better tool when we examine all the criteria. Here are some of the strengths of Cody over Copilot that are worthy of highlighting:

  • Superior code suggestions: Cody’s ability to use Code Search, another Sourcegraph tool under the hood, allows it to provide more accurate and contextually relevant code suggestions. It also has a feature for prompts and custom commands where you can tailor it to a particular prompt and reuse it in the codebase for code suggestions or related tasks.
    Cody’s custom commands

  • Better context understanding: Cody’s multi-file awareness gives it a significant advantage in understanding the broader context of the project. It scans through open files in the editor and files in the same folder and can link a file anywhere in the codebase when using the chat feature.
    Cody chat interface to showcase context

  • Enhanced security and privacy: Cody’s focus on enterprise-grade security and privacy makes it a superior choice for organizations with strict data protection requirements. Admins on the Sourcegraph Enterprise instance can use the Cody Context Filters to determine which repositories Cody can use as the context in its requests to third-party LLMs. Other users can also use the Cody Ignore File, an experimental feature yet to set files they want Cody to ignore when picking context in the codebase.
    Cody Context Filters feature at work

  • Data handling and IP protection: Cody generates its suggestions by relying on the existing codebase and general LLM knowledge. It does not scan or use open-source codes or other people’s codes. This is a significant advantage for enterprises that must ensure compliance with IP laws and avoid potential legal disputes.

  • Cost-effectiveness: While Cody’s pricing is fairly lower than Copilot, it offers substantial value for large teams and enterprises and that is a good advantage for the tool.

Addressing common questions and concerns about Copilot

Users have asked these common questions, to know which is better for them between Copilot and other AI coding tools. This section will answer some of these questions from a user perspective to help you understand if Copilot is worth the bargain for your development workflow. Some of these questions are:

Is Copilot worth buying?
Copilot is worth considering for individual developers or small teams looking for an affordable AI-assisted coding tool. It provides quick suggestions and supports various programming languages, making it a versatile tool for various projects. However, its effectiveness can vary depending on the complexity of the codebase and the developer’s specific needs.

What are the disadvantages of Copilot?
The main disadvantages of Copilot include:

  • Limited context awareness: Copilot’s suggestions are primarily based on the immediate written code, which can lead to less accurate suggestions in complex projects.
  • IP concerns: The potential for Copilot to suggest code derived from open-source repositories raises legal and ethical concerns, particularly for businesses.
  • Security and privacy: As a cloud-based tool, Copilot may not meet the security requirements of all organizations, especially those handling sensitive data.

Is it OK to use Copilot?
Copilot is generally safe to use for individual developers and small teams, provided they know the potential IP risks and limitations in context understanding. However, organizations should carefully consider these factors, especially if they work with proprietary or sensitive code.

Conclusion

Both Cody and Copilot are powerful AI-assisted coding tools, each with pros and cons. Copilot is an excellent choice for individual developers and small teams looking for an affordable, easy-to-use tool with broad language support, while Cody goes above and beyond in context flexibility, better security and data compliance, access to different LLMs, etc.

I have explored both GitHub Copilot and Sourcegraph Cody and have seen that each tool has its strengths. After diving into both, I found Cody’s deeper context understanding, access to different LLMs, and a strong focus on security to be game-changers for projects of any size. If you’re curious, I’d recommend signing up for Cody and seeing how it fits into your workflow. However, if Copilot aligns better with your needs, it’s also a solid option. Both tools offer valuable features, so exploring what works best for you is worth exploring.

Top comments (0)