

Imagine you have: private void DoSomething() Using regions in this case can also make the refactoring more difficult. If your method does A, then B, it's logical to create two regions, but this is a wrong approach instead, you should refactor the method into two separate methods. Regions, on the other hand, are intended to separate different things. If there are only ten lines in a method, you probably wouldn't use regions to hide five of them when working on other five.Īlso, each method must do one and one only thing. Don't use regions inside methods refactor instead They require more work which doesn't increase the quality or the readability of the code, which doesn't reduce the number of bugs, and which may only make the code more complicate to refactor. If you want to open VS Code in a certain directory, navigate to the directory and enter the code -r command.A code smell is a symptom which indicates that there is a problem in the design which will potentially increase the number of bugs: this is not the case for regions, but regions can contribute creating code smells, like long methods.Īn anti-pattern (or antipattern) is a pattern used in social or business operations or software engineering that may be commonly used but is ineffective and/or counterproductive in practice If you want to continue working from where you left off in the previous coding session, enter the code command without the -n flag. This will prompt VS Code to start and display a fresh instance. You can install the latest version of Visual Studio Code from their official website.Īfter installation, you can run the editor by entering the code -n command into the terminal. The image below shows how these regions are displayed: To simplify user experience, VS Code is divided into five main regions: The VS Code user interface allows for a lot of interaction compared to other text editors. Moreover, VS Code allows you to add on and even creating new extensions including code linters, debuggers, and cloud and web development support. VS Code supports a wide array of programming languages from Java, C++, and Python to CSS, Go, and Dockerfile.
