Skip to main content

Visual Studio Code (VSCode)

Visual Studio Code (VSCode) is a free, open-source code editor developed by Microsoft. It's lightweight yet powerful, offering features like syntax highlighting, intelligent code completion, and integrated debugging. Launched in 2015, VSCode has quickly become one of the most popular development tools due to its extensibility and cross-platform support.

Why VSCode for the NHS?​

VSCode is particularly advantageous for NHS projects because it provides:

  • Cost-effective: As a free, open-source tool, VSCode aligns with NHS budget constraints with the NHS Open Source Programme emphasizing the cost-effectiveness of open-source software, noting that "The licensing of open source software is significantly reduced compared to its proprietary counterpart"1.
  • Versatility: VSCode supports multiple programming languages used in the NHS, including Python, R, and SQL. This versatility is crucial for NHS projects that may involve data analysis, web development, and other technical tasks.
  • Extensibility: VSCode's vast marketplace of extensions allows customization for specific NHS needs. For example, there's a dedicated NHS.UK extension for Visual Studio Code that includes snippets to help build NHS Digital services.
  • Collaboration: Built-in Git support facilitates version control and team collaboration on NHS projects.
  • Security: Regular updates and a strong focus on security make it suitable for handling sensitive healthcare data.

Getting Started with VSCode​

  1. Download and install VSCode from the official website. The process is straightforward and typically takes only a few minutes. For Windows users, the installer will be named VSCodeUserSetup.exe2.

  2. Familiarize yourself with the interface:

    • Explorer: Navigate your project files and folders 3.
    • Editor: The main area where you'll write and edit code4.
    • Integrated Terminal: Run commands without leaving the editor5
  3. Install relevant extensions.

  4. Set up your workspace and configure settings:

    • Create a new file or open an existing project.
    • Customize your editor with themes to suit your preferences6.
    • Adjust settings like font size, line numbers, and auto-save7.
  5. Explore the Interactive Editor Playground to learn more about VSCode features8.

  6. Familiarize yourself with keyboard shortcuts to improve your productivity. You can even migrate shortcuts from other editors using keymap extensions9.

Basic VSCode Concepts​

Workspaces​

Organize your projects and files efficiently. A workspace in VSCode is typically a collection of one or more folders that are opened in a VSCode window. This allows you to group related projects and manage them together10.

Extensions​

Extensions are used to add functionalities to VSCode. You can find extensions for virtually any programming language, tool, or framework. There's even a dedicated NHS.UK extension that includes snippets to help build NHS Digital services.

Integrated Terminal​

Run commands without leaving the editor. This feature allows you to execute command-line tasks directly within VSCode.

IntelliSense​

Smart code completion for faster development. VSCode provides intelligent code completion based on language semantics and an analysis of your source code. This feature can significantly speed up your coding process11.

Debugging​

Built-in tools to help find and fix errors in your code. VSCode includes an interactive debugger, allowing you to step through source code, inspect variables, view call stacks, and execute commands in the console12.

Customization​

VSCode allows you to customize every feature to your liking. You can adjust settings, change themes, and modify keyboard shortcuts to suit your preferences.

Useful VSCode Extensions​

  • Python: Essential for data analysis and machine learning in healthcare. The Python extension for vscode provides rich support for the Python language, including features like IntelliSense and debugging.
  • R: Statistical computing and graphics for medical research. The R extension for vscode offers language support for R, including syntax highlighting and code completion.
  • SQL Tools: For working with healthcare databases. This extension provides database management, query execution, and schema exploration features.
  • Markdown All in One: For creating documentation and reports. This extension provides comprehensive support for Markdown, which is useful for writing clear, formatted documentation.
  • GitLens: Enhanced Git integration for tracking changes in NHS projects. This extension supercharges Git within vscode, helping you visualize code authorship and seamlessly navigate and explore Git repositories.
  • NHS.UK Extension: This extension includes snippets to help build UK's NHS digital services, making it easier to create consistent and compliant NHS web applications.
  • Jupyter: For interactive data analysis and visualization in healthcare research. This extension allows you to create and manage Jupyter notebooks directly within vscode.
  • Docker: For containerizing healthcare applications, ensuring consistency across different environments.
  • ES7+ React/Redux/React-Native snippets: Extensions for React, React-Native and Redux in JS/TS with ES7+ syntax.
  • indent-rainbow: A simple extension to make indentation more readable
  • Pip Manager: Manage Python packages inside of VSCode.
  • Plotly Dash Snippets: Snippets extension plugin for VS for the Plotly Dash microframework
  • Plotly Express Snippets: Python code snippets for creating statistical and scientific graphics using Plotly Express.
  • Rainbow CSV: Highlight CSV and TSV files, Run SQL-like queries.

Further Learning Resources​

Footnotes​

  1. Anonymous. "Open Source Programme" NHS England, Link ↩

  2. Anonymous. "Visual Studio Code on Windows" Visual Studio Code, Link ↩

  3. Anonymous. "Explorer View" Visual Studio Code, Link ↩

  4. Anonymous. "Basic Editing" Visual Studio Code, Link ↩

  5. Anonymous. "Getting started with the terminal" Visual Studio Code, Link ↩

  6. Anonymous. "Themes" Visual Studio Code, Link ↩

  7. Anonymous. "Settings" Visual Studio Code, Link ↩

  8. Anonymous. "Basics - Getting Started" Visual Studio Code, Link ↩

  9. Anonymous. "Key Bindings for Visual Studio Code" Visual Studio Code, Link ↩

  10. Anonymous. "What is a VS Code "workspace"?" Visual Studio Code, Link ↩

  11. Anonymous. "IntelliSense" Visual Studio Code, Link ↩

  12. Anonymous. "Debugging" Visual Studio Code, Link ↩