I. Introduction
How is AI used in programming?

There are various attempts currently, the most aggressive one is probably v0.dev.
You tell it what website you want, and it gives you a few design drafts. You choose one, and it generates a ready-made webpage.

This has a futuristic feel, wanting what program, the machine helps you write. However, in reality, it can only generate web UI (user interface), cannot generate interactive scripts, and also cannot generate other UIs (such as mobile app pages).
This reflects the limitations of AI, at least for now, AI cannot replace programmers, it can only serve as a programming assistant.
Based on my experience, as a programming assistant, AI plays a significant role, greatly saving programmers' time and significantly improving programming efficiency and code quality.
Today, I will evaluate two AI programming assistants to see which one is better, and also serve as an introductory tutorial to demonstrate their usage to those who haven't used them yet.
After reading this, you'll understand why programming can no longer be separated from AI—it truly empowers programmers like adding wings to a tiger.
II. Introduction to GitHub Copilot and BeanPod MarsCode
The two AI programming assistants I will evaluate (or introduce) are GitHub Copilot and BeanPod MarsCode.

GitHub Copilot is the earliest AI programming assistant and also the one with the highest market share and recognition.
It is produced by Microsoft, with an underlying foundation of OpenAI, and relies on the world's largest programmer community, naturally possessing exceptional capabilities.

Dou bao MarsCode is an intelligent development tool based on the Dou bao large model.
It is backed by ByteDance, originally an internal tool,据说 over 70% of ByteDance's engineers use it, contributing millions of lines of code monthly.
On June 26th, it was officially released to the public in Beijing, and the outside world can use it for free, making it fresh off the press.

They both come from major companies, are sufficiently representative, and have similar functionalities, so let's see if domestic AI can replace mainstream foreign products.
III. Usage Environment
AI programming assistants are generally not used alone but as plugins for IDEs (Integrated Development Environments), providing various AI functionalities within the editor interface.
The IDE I chose is currently the most popular VS Code. Additionally, BeanPod MarsCode also supports JetBrains IDE, and Copilot supports more.
Everyone can find Copilot and MarsCode by searching in the VS Code extension market. Below is the page after installation. (The upper image is Copilot, and the lower image is BeanPod MarsCode, and the same order follows.)


If you don't have VS Code, or even other IDEs, that's not a problem. BeanPod MarsCode provides a free cloud IDE (lower image), no need to download and install, use it directly in the browser, and it comes with dozens of development templates, and you can pull GitHub repositories, very convenient to use.

GitHub also has a cloud IDE, which is its CodeSpace, and Copilot can be used there as well. However, after using it for 60 hours per month, it starts to charge, so it's not recommended here.
4. Chat Functionality
The main user interface of the AI Programming Assistant is a chat window where users can ask various questions.
First, I asked a question "What is the CAP Theorem?" to test their chat functionality.


It can be seen that their responses are all accurate and useful, with Copilot having slightly better formatting.
The second question "Please recommend books for learning JavaScript" received similar responses from both.


Chat questions are not limited to programming; any kind of question can be asked, such as "When is the Spring Festival in 2025," and their responses are also fine.
However, the daily use scenario for this feature should be searching for software documentation, and it is indeed very useful.


5. Code Generation
Next, let's test the main function of the AI Programming Assistant: automatic code generation, letting it write code.
is very easy to use; as long as you press a key, it will automatically suggest what the following code should be .
You can take it as a reference or press the Tab key to accept it as the official code. If you want to confirm each word individually, press Ctrl + Right Arrow (Mac: Cmd + Right Arrow).
I had the AI generate a function to validate phone numbers.


The code above, except for the first line "// Validate phone number" which I entered, everything else was generated by the AI.
This code is completely correct, and there are two particularly satisfying points: (1) Because the file extension is JS, they automatically generated JavaScript code; (2) They are validating Chinese mobile phone numbers, and I didn't explicitly specify this—they inferred it themselves.
It's a bit strange that the code provided by Copilot and MarsCode is the same. Could it be that they are trained on the same material?
I added another condition, requiring both mobile and landline cases. The code they provided is still (basically) the same.


In this round, they are tied. Additionally, if you are not satisfied with the provided implementation, Copilot can press Ctrl + Enter to offer multiple implementation options (see the image below).

MarsCode, on the other hand, has a floating toolbar when suggesting code, which allows switching between multiple implementations (as indicated by the arrow in the lower image).

It is worth mentioning that,MarsCode also has a special feature called "Code Completion Pro"Without manual prompts, automatically predict the next point of change based on existing code and provide recommended code.
This feature needs to be turned on in the settings (see the image below).

After opening, it enhances code prediction. First, at the expected point to trigger code suggestions, press Ctrl + Shift + Enter to actively trigger the suggestion, then press Tab to accept it.
At this point, it predicts the next change point, and clicking Tab will jump to that location. This is very useful in code modification scenarios. After modifying one place, it helps you jump to the next (predicted) change point and provides suggested code. Ordinary code completion cannot achieve this.
VI. Generating Comments, Code Explanation
In addition to generating code, another important role of AI is to generate programming documentation, which is the textual explanation of the code.
There are mainly two types of documentation features: comments and code explanations. First, Copilot's comments need to be manually generated.

Doubao MarsCode has a quick button above the code to generate comments.

Clicking it will invoke/docCommand is relatively convenient to use.

As for the code explanation feature, I think compared to others,豆包 MarsCode (MarsCode) is better. Copilot is too verbose and a bit hard to read.


7. Other functions
(1) Code translation
They can all translate code from one language to another.
I tried translating JavaScript code into Python, and there were no issues. The豆包 MarsCode app also automatically saves the translated code as a separate file in the current directory.


(2) Generate unit tests
Writing unit tests is troublesome, AI can generate them automatically, which is quite convenient.


The same piece of code, Copilot generated 4 test cases, while Doubao MarsCode generated 5.
And, the豆包 MarsCode(IT之家) provides text summaries for test cases (see below), which is very useful, but unfortunately, Copilot doesn't.

I think, in this aspect, the豆包 MarsCode(IT之家) does a good job.
(3) Correcting Errors
AI can also automatically modify erroneous code. If the test cases or automatic builds fail, it will explain the reason for the error and provide suggestions for correction. No examples will be given here.
Eight, Summary
After a series of tests above, their performance is generally not very different. I believe, domestic AI programming assistants can completely replace GitHub Copilot , and in some details, they do better.
The advantage of GitHub Copilot lies in its numerous features (for example, calling terminal commands), and its training material might be more extensive, possibly performing better on some niche languages.
However, it is paid, at $10 per month, while DouBao MarsCode is free , making it worth recommending the latter just for this reason.
Currently, DouBao MarsCode is only an early version, with more features to be added later. However, for most programmers, the existing features are already sufficient.
Additionally, I noticeably found that DouBao MarsCode has faster response times, as the server is located domestically. Compared to Copilot's overseas server, this is also an advantage.
In summary, DouBao MarsCode is worth trying out to experience the progress of domestic AI. If you've never used an AI programming assistant before, you should definitely not miss this programming magic tool that improves efficiency.
(End)












