laitimes

After five years of VS Code, I decided to switch to JetBrains...

Author | Jeremy Liu

Translated by | Xu Xuewen

Planning | Yan Garden

Review | Wang Qiang

This article was originally published on Blankly and translated and shared by InfoQ Chinese site with the permission of the original author.

In programming, VS Code was my main IDE for 5 years. At this point in time I decided to replace it, which can be incomprehensible. In this article, I will share with you the reasons why I made this decision.

Background

If you want, you can also say that I am crazy. You might think that someone who has been using VS Code for 5 years must be crazy to want to replace it at this point. Indeed, before I approached the JetBrains ecosystem, I thought the same thing. I'd even use my life to prove that VS Code is the best IDE on the market right now, just like Apple's M1 chip computer in the PC industry. But allow me to start with the background of the matter.

I currently work at Blankly, which is the head of the hedge fund cloud service. On the cloud services we offer, it only takes a few minutes for people to create their own trading algorithms. A colleague of mine, Emerson, is a big fan of the JetBrains ecosystem. At a day stand, he even extended the meeting time in order to persuade us to try the JetBrains ecology. I reluctantly agreed in order to get the discussion of the matter to end early (so that the stand-up meeting could end sooner). Who would have thought, however, that now I'm actually writing an article here about what ultimately persuaded me to give up the IDE that had been with me. So, if you're struggling with what IDE to use and haven't thought about the JetBrains idea at all, or if you're interested in why I gave up VS Code, this article is perfect for you to keep reading.

This article is based on some of my first-hand experiences with VS Code and JetBrains, and will compare them from 5 aspects. It also explains the reasons why JetBrains has obvious advantages in some use cases.

Code inspection and refactoring

VS Code: Fast, simple, and multi-lingual

First of all, any programming language can be easily and quickly up and running in VS Code, so people will also call it an "editor". Therefore, VS Code is the best choice for full-stack engineers like me. Whether you need to switch frequently between Python and JavaScript, add a React App based on NextJS, or configure a Ruby environment on a Ralis system, these capabilities vs Code supports well and provides a range of out-of-the-box features for these development languages, including lingting. Even if you don't have a feature, you only need to search for one in its plugin market and find a plugin with this feature to install.

Secondly, thanks to a series of plugins such as Github Copilot, AI-based linting, auto imports, etc., VS Code has a strong linting capability. In VS Code, whatever features you want at any time, it's easy to configure. Many times, just a terminator is needed and VS Code will prompt you for what you want. Sometimes, though, people will collapse because of this failure of linting ability. In fact, I often get caught up in trying to figure out why a standard linting doesn't work. Whether it's due to the multi-Python environment I installed with Anaconda, or because of the lack of installation packages, many times I can't get the answer directly. In addition, VS Code's linting capabilities for the JavaScript language are also very powerful, but it does not do in-depth type checking of JavaScript, fortunately, we can solve this problem with TypeScript.

After five years of VS Code, I decided to switch to JetBrains...

As shown in the figure, because I forgot to switch the Python environment in VS Code, even though I have installed the relevant dependency packages locally through pip, vs Code's linting function still indicates that the package was not found.

Finally, as an editor, VS Code does a great job at code refactoring. It works great on basic refactoring features such as variable renaming, file moves, and automatic reference modification. But it's a bit inadequate in terms of higher-level refactoring features like function moves, parameter renaming, code extraction, and so on. Fortunately, though, just a few basic refactoring features are enough to meet most of our daily refactoring needs. In the five years I've been using VS Code, it's met most refactoring scenarios I've come across.

JetBrains: Standard, professional, strong support

First, JetBrains is a powerful IDE with a lot of unreasonable initial setup. When I first touched it, I had to go to great lengths in setting up in order to make the code appear more elegant. However, switching between two IDEs designed for different use cases is inevitable at the expense of some learning time. If one of my POST requests suddenly goes wrong, I have to open PyCharm to see if there is a problem with my backend API service; if I suddenly have a new optimization idea for the best recommendation algorithm in the recommendation class project, I need to open CLion. However, thanks to smart recognition, when opening different IDEs, I just need to take a moment to practice putting code . Switch to a . and pycharm. and other scripts.

Second, JetBrains' engine is powerful. When I replaced the IDE with JetBrains, I was impressed with its powerful engine performance. When I see some redline warnings in the editor, I just need to use the shortcut key comman+p to reload the current window once, and the redline warnings will disappear or give some useful hints. This simple and responsive code check makes me feel good when programming.

After five years of VS Code, I decided to switch to JetBrains...

As shown above, you only need one shortcut key to see all the references.

Finally, JetBrains is powerful in terms of refactoring capabilities, which is what really appeals to me. Just last week, during the construction of the final beta version of the company's platform, I refactored and added some components in order to make the components more extensible in the future. During this time, I moved about 200 components, and not a single compilation exception was caused by a reference error, illegal, or undefined component while the project was compiling. Then, in VS Code, I broke the entire cpp code by just reorganizing two files in a project of a data structure class. To do this, I had to manually fix some component imports and function references to make the project run correctly. In addition, JetBrains ensures that we have enough refactoring tools, and it also provides a variety of external tools such as safe deletion and global renaming.

JetBrains makes it clear to see all the calls and contextual graphs of the variables that will be refactored or renamed

The JetBrains Ecosystem IDE provides a reading help function

Capability comparison

Commissioning

VS Code: You can debug almost anything

VS Code's super debugging ability is due to its strong plug-in support. Each time you click the Run button to the left of VS Code, VS Code generates a .vscode folder with a settings.json file that contains all the debugging-related configurations. For most languages such as Python, JavaScript, etc., it is very convenient to use VS Code as their debugging tool. Even, if your environment is configured correctly, it will be easier to debug by clicking the debug button directly. In addition, it is very simple to change your current debugging content even by modifying the configuration in the settings.json file. However, if you use a specific build method or a specific platform language (such as the C/C++ language), the need to set gcc and clang will greatly increase the difficulty and complexity of debugging in VS Code, and it will be time-consuming and laborious to set up the debugging configuration of such files. To reduce this time investment, I tried to copy the setting.json files of other projects into the current project, but the effect was not ideal, and it took me many days of adjustments to make the current project run normally. At my university (University of Michigan, Ann Arbor), they maintained a common settings.json file for everyone to use in order to reduce the amount of effort they had to debug the configuration. But even then, people have to spend time tweaking the settings.json file.

After five years of VS Code, I decided to switch to JetBrains...

The figure above shows one of the simplest configurations required for C/C++ program debugging on MacOS

During actual debugging, VS Code is well placed in the debugging console for debugging breakpoint settings, identifying variables, and adding variable observers. However, if these features can be set directly in the code panel instead of on the side panel, it would be even better.

Thankfully, plugins and multilingual support are VS Code's biggest strengths, which allows people to set up code debugging in minutes or even seconds. For some simple debugging scenarios, VS Code's debugging capabilities are great. However, when it comes to debugging special languages, VS Code's debugging capabilities are often difficult to handle. At the same time, I also found that when the program needed to use more heap memory, vs Code's debugger stuck until it crashed.

JetBrains: A debug monster

Compared to VS Code, JetBrains is more powerful in debugging. Because all of jetBrains' idios run on a configuration-based basis, you can start any program debugging by clicking the Debug button. If you want to set a global debugging breakpoint, you only need to press the spacebar at the line number of the editor, which greatly improves the debugging experience of the program. In addition, the JetBrains family of IDEs has many other feature highlights throughout the debugging process, such as when entering the debugging process, the definition of all variables in the scope is visible to the definer. This allows us to observe the current change in the value of the variable in a very good way. I was impressed by the process of debugging the program with Pycharm a few days ago. When I run debugging in Pycharm and try to see the values of a data frame, as soon as I tap the data frame variable and press view as the data frame, Pycharm opens the data frame in SciView and displays all the data frame values and column headers:

After five years of VS Code, I decided to switch to JetBrains...

The figure above shows the monitoring of running debugs and variable values

As shown in the screenshot above, the bottom window shows all the values within the scope. The drop-down menu for history_and_returns displays all the property values of the dictionary object and the data frames nested within the dictionary object. In the panel on the right, like SciView, data frames that have been nested in the dictionary are displayed. It is useful for developers to have such an in-depth understanding of the code without setting any print statements or stack traces. Imagine that when all the assignments of variables are displayed next to them by the editor, we can easily find logical errors in the loop, fix glitches caused by indexes, and even do some more in-depth logical reasoning.

Like other IDE debuggers, the JetBrains debugger provides step-by-step debugging capabilities such as the next line, entering a function, and so on. In addition, JetBrains' Run to Cursor is a very useful feature that allows people to debug breakpoints as if they were setting breakpoints by placing a mouse. This ability to set breakpoints anytime, anywhere and take effect immediately is exactly the way I debug my code and greatly speeds up my programming.

Program debugging is one of the most common things developers do every day. So I think that when a developer chooses an IDE, whether the IDE has a good debugger is a factor that must be considered. Both VS Code and JetBrains provide very reliable debuggers, but I must say jetBrains are slightly better than VS Code in this regard. Because JetBrains can display variable values directly on the edges of variable declarations, this makes it easier to manage when tracking a large number of variables. In addition, JetBrains' debugger is more powerful and stable, and it doesn't require complex setup like the VS Code debugger. Therefore, combining these factors, jetbrains debugging helps us save more debugging time, which also makes JetBrains more attractive.

Integrate Git

VS Code: A powerful source control management is built-in

People who need teamwork or care about code security know the importance of Git in their workflows. Git-based versioning is an indispensable feature for any modern editor. THE INTEGRATION OF VS CODE AND GIT IS VERY GOOD, AND WHEN YOU OPEN A WORKING DIRECTORY, IT AUTOMATICALLY DETECTS IF IT'S A GIT REPOSITORY. If so, then it immediately provides many inherent Git commands such as push, pull, commit, and so on.

In VS Code's Git panel, people can clearly see which files have been modified and easily synchronize. At the same time, in the panel, you can also create branches and clone repositories. VS Code always tells you exactly what to do, which is one of the reasons I love it. When it detects a file modification, it will immediately prompt you to submit, and when you submit, it will prompt you to include a submission instruction. In addition, it detects and synchronizes local and remote branches at commit time. At the same time, it also provides a very stable rebase function.

In the line, you can clearly see where you need to do conflict merging

The ability to handle conflict merges reasonably is a major advantage of VS Code. With conflict resolution automatically provided by VS Code, I can choose to use the current changes or the incoming changes by clicking the button. This way of resolving merge conflicts has saved me a lot of time.

JetBrains: No longer need to use the command line for source code management

After switching fully to JetBrains, I barely touched my terminal command line. JetBrains provides overall functionality such as source code management including commits, conflict resolution, branch switching, and branch comparison. In my experience, JetBrains is much better at source control than VS Code. Below I list some screenshots of the experience:

After five years of VS Code, I decided to switch to JetBrains...

Compare a file between two branches

After five years of VS Code, I decided to switch to JetBrains...

Built-in branch details are displayed

Detailed git logs

On Git integration, both JetBrains and VS Code provide complete and identical functionality. No matter which IDE you choose, there are enough features to support source code management. Therefore, this aspect cannot be considered as a consideration for choosing an IDE, but it is just a matter of personal preference. For example, when resolving merge conflicts, I prefer jetBrains to the way THAT VS Code displays conflicting files separately instead of the way THEY stack them in one file.

Extensibility

VS Code: Rich extensibility

VS Code is one of the most extensible editors, and integration and extensibility are its core features. Among the many scaling capabilities, Python extensions, remote development extensions, and some IntelliSense-driven extensions are the hottest at the moment. In addition, VS Code also has some cool features, such as code formatting through Prettier, theme customization through icons and code editor themes, etc. Every thing or feature provided by VS Code is fully extensible, and the extension itself may be a process of augmenting the ability to scale.

After five years of VS Code, I decided to switch to JetBrains...

Support for remote docker containers is one of my favorite VS Code extensions. With this feature, users can program remotely inside the docker container in VS Code. If you have docker installed in your local or remote environment, you can easily run your code and do everything you needed to do in docker in VS Code. Want something more fun? What about remote development via SSH? Microsoft's extensions allow people to enter the server-side development environment through remote SSH in VS Code, as if they were local. In VS Code, if you want to integrate these functions, you only need to click to install it, you can run successfully, all of these functions, to achieve the greatness of VS Code.

JetBrains: Integration ecosystem

For JetBrains, extensibility isn't a point where it needs to stand out, because you'll find that most of the features you need will be released with the release of the IDE version. The advantage of installing a powerful IDE for a language is that when we need some new feature, we may just need to upgrade the IDE version and have it, without having to go to the expansion market to look for it.

For example, JetBrains provides strong built-in support for dockers. By specifying only a configuration type file such as a Dockerfile, all JetBrains IDEs provide complete control over all parameters, names, tags, ports, and environment variables through an easy-to-use GUI. At runtime, the IDE integrates docker to provide you with docker build logs, run logs, environment variables, and visual integration configuration information:

After five years of VS Code, I decided to switch to JetBrains...

In terms of integrating third-party capabilities such as FastAPI, Flask, shell, etc., JetBrains provides the same capabilities as integrating dockers.

In addition, the JetBrains IDE has a rich ecosystem of plugins. For example, I can install specific plugins to support Verilog and Matlab, respectively. Interestingly, these lightweight plugins offer a better programming experience than the locally installed Matlab and Quartus (Verilog's development environment).

There is no doubt that both have extensive communities and markets underpinning both in terms of extensions or plugins. Both IDEs have their own advantages in functionality. The features of the two editors are missing, and you may want them to enrich themselves. However, VS Code's community is slightly larger, so it has more extensions and some capabilities such as remote container extensions, which allows us to iterate faster. Therefore, if you have more needs for custom extensions such as Docker in your daily work, then VS Code can be said to be your own IDE.

Collaboration capabilities

VS Code: Plug-in-based for real-time sharing

While VS Code itself doesn't have a built-in real-time sharing feature, Microsoft has developed a plugin for it. In addition to that, people can now even access vscode.dev directly by using a browser for real-time sharing. The diversity of this need fulfillment is what makes VS Code so popular. As long as you have a good network environment, the real-time sharing experience will be good. In the process of real-time sharing, people can work together as if they were face-to-face. At the same time, in terms of source code control, VS Code also keeps track of those who help authors submit code. These show us how easy it is to turn on real-time sharing in VS Code. So, in my opinion, VS Code is better at real-time sharing than any other IDE and editor on the market.

However, there are still some points to pay attention to when using VS Code's real-time sharing function. Below I'll give an example of using real-time sharing in a Vue .js project. When sharing Vue code in real time, some plugins, including Vetur (Vetur is an important plugin for Vue visualization), are not shared. This kind of defect often makes people get into trouble and irritability. Fortunately, such a flaw will only affect certain users (in this case, only Vue users). Also, what I hate the most is that in real-time sharing, the undo function is actually tied to the machine rather than the current user, which causes my undo function to be confused between local and remote.

JetBrains: Secure, distributed

All JetBrains ecosystem IDEs provide a lot of settings for code sharing and online collaboration. These settings vary depending on the security level. One of the impressive capabilities I recently found was that with projector technology, any JetBrains IDE could be run in a docker container, which allowed me to connect to an IDE of JetBrains running on a cloud service while encoding in the browser with the full functionality of jetBrains' IDE. So now, I can securely code anytime, anywhere, with just one password, by using a headless service. This is just one of jetBrains' many shared configurations.

Of all JetBrains IDEs, real-time sharing via Code With Me is the dominant approach. This way you can view other people's projects directly in your local IDE. At the same time, you can run projects using someone else's development environment as if you were using a local development environment. An impressive scenario is that one of my team members encountered a Python problem, and he initiated a code real-time sharing for me through Code With Me, and through this sharing, in my own IDE, I used his configuration as if it were local, and after debugging the code, I easily helped him solve this problem.

A variety of great shared IDEs can be surprising at trying to improve security, collaboration, or how distributed teams work together.

If it had been two years ago, I would have thought that real-time sharing wouldn't have mattered. In fact, two years ago I didn't even know there was a code collaboration feature in the IDE. Because two years ago, when we needed to work together, we didn't initiate remote collaboration through the IDE at all, but sat directly in front of the same machine. But now, affected by the COVID-19 pandemic, this face-to-face collaboration has become a luxury and has become extremely difficult. Because of this, both IDEs are strongly supported by real-time code sharing. However, due to issues with undo functionality in VS Code, I highly recommend JetBrains. And support for video and audio calls and Git's tracking capabilities between users are just as important.

Summary

In addition to the 5 comparisons listed above, I also know that JetBrains charges a fee for non-student users compared to VS Code's completely free, which may be one of the reasons why many people do not consider JetBrains. However, for me, during the few months of using the JetBrains ecosystem, it gave me a very good experience. And I can't wait to use them more in my work. So I hope that even if JetBrains costs some money, you can consider it.

https://blankly.finance/vscode-vs-jetbrains/

About the Author:

Jeremy Liu is a full-stack engineer who currently works at Blankly as Lead Engineer.

Read on