Чем отличается visual studio от visual studio code
Перейти к содержимому

Чем отличается visual studio от visual studio code

  • автор:

Will VS Code Replace Visual Studio? — Mostly

This post explains why VS Code will mostly replace Visual Studio.

When I first learned about VS Code, I couldn’t help but wonder if it was going to replace Visual Studio. How could Microsoft invest an equal amount of time into both tools?

It’s clear that VS Code now has a significant market-share over Visual Studio. In a recent study done by Stack Overflow, 50.7% of respondents reported having used VS Code, whereas only 31.5% reported using Visual Studio.

Most popular development environments

I expect VS Code to continuing gaining market share over Visual Studio, into 2021 and beyond.

If this trend continues, is it going to completely kill Visual Studio?

I have concluded that VS Code will mostly replace Visual Studio. VS Code is better for most things, but Visual Studio has certain features and use-cases that VS Code can’t easily replicate.

Let’s go straight to the source. Here’s how Microsoft describes each:

VS Code

Tagline: «Code editing, redefined.»

Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages (such as C++, C#, Java, Python, PHP, Go) and runtimes (such as .NET and Unity).

Visual Studio

Tagline: «Code faster. Work smarter. Create the future with the best-in-class IDE.»

The Visual Studio integrated development environment is a creative launching pad that you can use to edit, debug, and build code, and then publish an app. An integrated development environment (IDE) is a feature-rich program that can be used for many aspects of software development. Over and above the standard editor and debugger that most IDEs provide, Visual Studio includes compilers, code completion tools, graphical designers, and many more features to ease the software development process.

  • VS Code is designed to be a lightweight code editor, centered around speed, flexibility, and extensibility. The built-in tooling is very good for web developers.
  • Visual Studio is a complete IDE (Integrated Development Environment) which aims to be a comprehensive, full-featured solution for building software.

Why is VS Code more popular?

For MOST use-cases, VS Code is a better choice. It’s:

1. Cross-platform

VS Code runs wherever you need it. Windows, MacOS, and Linux. It’s built with web technologies using the Electron framework. The application files are lean, and auto-updates are relatively seamless.

2. Fast (much faster than Visual Studio)

VS Code boots up incredibly fast compared to Visual Studio. I used to start up Visual Studio and go grab a cup of coffee while it launched. I would leave my project open all day to avoid the awful load time. Now, with VS Code, I open and close projects all day long without worrying about speed. It’s a non-issue with VS Code.

3. Highly flexible (there’s thousands of extensions you can install)

You can make VS Code do pretty much anything you want. Although it is designed to be a «code editor» and not an IDE, you can almost exactly replicate the features of an IDE by installing VS Code extensions. Extensions are great because they are community-made and maintained. This means there’s a massive marketplace of extensions for almost every use-case you can think of.

4. Simpler

VS Code’s simplicity means that the development experience is way more streamlined. You don’t have to worry about tons of complex built-in functionality that you will never use. If you want to add features to VS Code, that is at your discretion, in the form of extensions.

5. More Intuitive

From the moment you first launch VS Code, the experience is smooth. If you have any past development experience, you will understand the tool instantly. Visual Studio takes a bit more getting used-to.

6. Free and open-source (Visual Studio full-version has hefty license fees)

Unlike Visual Studio (full-version), VS Code is completely free and open-source. There are many contributors working day and night to make VS Code as great as it can be. If you’re an individual developer or work on a smaller startup team, the cost savings can be significant. Visual Studio costs $45 per month or $1,199 for the first year, and $799 every year thereafter for the perpetual license. The enterprise version bumps those numbers up to $250 per month and $5,999/$2,569 for the perpetual license.

7. Perfect for Web Development

VS Code has out-of-the-box support for Node.js development with JavaScript and TypeScript as well as built-in tooling for JSX/React, HTML, CSS, SCSS, Less, and JSON. It’s no wonder that web developers have adopted VS Code as their primary code editor.

Why would you use Visual Studio over VS Code?

Well, there are a few reasons.

To most developers and teams, these factors are insignificant, but for the minority these are important and will tip the scale in Visual Studio’s favor.

1. Large, out-of-the-box feature set

Visual Studio has much more functionality than VS Code out-of-the-box. In certain cases, it may perfectly fit your project/workflow requirements without any additional configuration / extensions. In other words, whenever you need an extension in VS Code, Visual Studio probably already has the feature baked-in. The comprehensive feature set may outweigh the poor load times.

This may be attractive for companies who want to standardize the tooling and workflows for all of their developers to avoid confusion.

2. Team collaboration features

Team collaboration on development and debugging is treated as a first-class-citizen in Visual Studio. If your team’s workflow is heavily integrated with the collaboration features of Visual Studio, you’re more than likely going to be using it.

3. Analysis, Profiling, Debugging

For things like heavy code analysis, performance profiling, and snapshot debugging, Visual Studio is also very well-suited.

4. Game Development

Visual Studio is also extremely common in the game development industry. If you’re a game developer who wants to assimilate with experienced game development teams, Visual Studio is probably the right choice.

There’s room for both to co-exist.

While you can achieve most of your software development goals more effectively using VS Code, Visual Studio still has use-cases that it excels at out-of-the-box. without all of the extensions that VS Code would require.

VS Code will (and has) mostly replaced Visual Studio, but Visual Studio will live on and continue to provide for teams working with complex software development requirements for some time.

How do I beautify the code in Visual Studio?

In an existing project, open the document that you want to format, right-click inside the document, and select Format Document. In the default configuration for Visual Studio Code, the command can be run using the shortcut Alt+Shift+F.

How do I rearrange code in Visual Studio Code?

29 Answers. The code formatting is available in Visual Studio Code through the following shortcuts: On Windows Shift + Alt + F. On Mac Shift + Option + F.

How do I Auto organize code in Visual Studio?

Auto format code shortcut in Visual Studio?

  1. Format Document (Ctrl+K, Ctrl+D) so type Ctrl+K, and then Ctrl+D as it is a sequence.
  2. Format Selection (Ctrl+K, Ctrl+F)

How do I enable formatting in Visual Studio?

To access this options page, choose Tools > Options from the menu bar. In the Options dialog box, choose Text Editor > C# > Code Style > Formatting.

How do you use prettier code formatter or code?

In the command palette, search format, then choose Format Document. You may then be prompted to choose which format to use. To do so, click the Configure button. Then choose Prettier – Code Formatter.

Does prettier work with C#?

Consistent formatting is a good thing. But what about C#? Well, there is a Prettier plugin for C#….

Why do we format code?

Well, the first and foremost reason for formatting your code appropriately is that it will make it considerably easier for someone else to read later. It’s also easier to fault find code that doesn’t fit appropriate form and style and potentially identify bugs within the system.

How do you replace a word in VS code?

You can use the Find control in code or text windows, such as Output windows and Find Results windows, by selecting Edit > Find and Replace or pressing Ctrl+F.

How do you activate Pretty?

The Format Document Command In the command palette, search format, then choose Format Document. You may then be prompted to choose which format to use. To do so, click the Configure button. Then choose Prettier – Code Formatter.

How to auto format Visual Studio Code?

Is ‘Visual Studio for Mac’ really Visual Studio?

What is visual code?

Improving Code Quality with Visual Studio Code Metrics

Visual Studio 2017 code metrics is a set of important software tools for measuring the quality, code maintainability, and complexity of code written by a developer. These metrics also provide developers better insight into the code they have written by understanding the types of classes/methods/modules that should be reworked and thoroughly tested, identify potential risks, current state of code, track progress of development, and so forth. Code metrics are available with the VS Community, Premium, and Ultimate editions. Developers also can download the extension and install it in Visual Studio. It’s a good practice to use code metrics to validate code; it will not only improve code quality but also make your application maintainable and less complex.

Software Measurements Metrics

Visual Studio provides following the list of the metrics to help you better understand your code:

  • Maintainability Index
  • Cyclomatic Complexity
  • Depth of Inheritance
  • Class Coupling
  • Lines of Code

Maintainability Index

Maintainability Index is a software metric that indicates how maintainable (easy to support and change) the source code is. A high value of the Maintainability Index means better code maintainability. The value of this index is between o to 100. Different color codes are used to signify the maintainability index. For example, a green rating, between 20 and 100, indicates that the code has highly maintainability. A yellow rating, between 10 and 19, indicates that the code is moderately maintainable. A red rating, between 0 and 9, indicates low maintainability.

Cyclomatic Complexity

As per Wikipedia: ‘Cyclomatic complexity is a software metric (measurement), used to indicate the complexity of a program.’ This metric measures the structural complexity of your code. It indicates a number of branches in the code by calculating the number of different code paths in the flow of the program. The value of this metric increases if we have nested if statements or switch statements. Your code will be highly maintainable if the value of this metric is lower.

Depth of Inheritance

This metric calculates how far down a class is declared in the inheritance hierarchy. The deeper the hierarchy in the inheritance tree the class is, the more complex it will be to develop, test, and maintain. A developer must implement inheritance carefully by keeping in mind that code should remain reusable and less complex.

Class Coupling

Class coupling is a measure on how one class is connected or dependent with another class. Good practice is to always implement fewer dependent classes or a low class coupling. A lower value of this metric is preferred because it also increases the complexity in your code.

Lines of Code

This one is relatively simple; it indicates the approximate number of lines of code written in a program. The count is based on the intermediate code generated by the Framework. A developer should design methods so that there are fewer lines of code. A high count indicates a method is trying to do too many things; that means a complex structure and it will be hard to maintain.

How To Generate Metrics Data

You can start calculating code metrics from the Analyze menu -> “Calculate Code Metrics for Solution.” In case you have multiple project selections, the menu option will also provide the “Calculate Code Metrics for Selected Project (s)” submenu.

Analyze code metrics

Figure 1: Analyze code metrics

Alternatively, you can start code metrics for a single project or an entire solution from the project content menu. Right-click -> “Calculate Code Metrics.”

Calculate code metrics

Figure 2: Calculate code metrics

Once you run the code metrics, Visual Studio will analyze the selected project/projects and display the code metrics results in the “Code Metrics Results” window. From the result window, you can drill down to each and individual method to analyze their metrics data.

Code metrics result window

Figure 3: Code metrics result window

You also can display the “Code Metrics Results” window by clicking the Analyze menu -> Windows -> “Code Metrics Results.”

Code metrics result

Figure 4: Code metrics result

A developer can filter the Code metrics data based on the type of code metrics and by providing min and max value of indexes of the selected metrics. The filter feature helps a developer easily find the code block or function they need to work on.

Filter option

Figure 5: Filter option

You can Add/Remove metrics columns by selecting the options from the “Add/Remove Columns” options. By default, all the metrics are checked.

Add/Remove columns

Figure 6: Add/Remove columns

To export result data in Excel format, right-click in Code metrics results and select “Export to Excel.” A developer can use the data for analysis once they have the information exported to Excel format.

Export to Excel

Figure 7: Export to Excel

Conclusion

That’s it for today. Visual Studio’s Code Metrics features are very powerful and, when used, ensure your code is written properly and well maintained. Every enterprise has their own standards of code maintenance, but I would recommend running the code metrics tool regularly for better code quality and good practice.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *