Code Editors and IDEs#

Goal#

Learn about different code editors and integrated development environments (IDEs), and how to choose one that fits your needs. We’ll also show you how to set up a recommended editor (VS Code) with useful extensions for Python and Git development.

Prerequisites#

1. Introduction#

A code editor is a tool where you write code. It’s different from a text editor like Notepad because it understands programming languages and provides helpful features like:

  • Syntax highlighting: Colors different parts of code (keywords, strings, comments) to make them easier to read

  • Auto-completion: Suggests function names and variables as you type

  • Error detection: Highlights mistakes before you run the code

  • Integration with Git: Makes it easy to commit and push changes without using the terminal

  • Extensions/Plugins: Add functionality for specific languages and tools

An IDE (Integrated Development Environment) is a more powerful version that also includes a debugger, built-in terminal, and project management tools.

4. Basic VS Code Workflow#

Opening a Project#

  1. File → Open Folder and select your project directory

  2. VS Code will recognize it as a workspace

Writing and Editing Code#

  1. Create new files with File → New File or Ctrl+N

  2. VS Code’s intellisense will suggest completions as you type

  3. Errors appear as red squiggles—hover over them for details

Running Code#

  1. Open a Python file

  2. Click the ▶ button in the top right, or press Ctrl+F5

  3. Output appears in the Terminal pane

Using the Terminal#

  1. Press `Ctrl+`` (backtick) to open the integrated terminal

  2. You can run commands without leaving the editor

Using Version Control#

  1. Open Source Control (Ctrl+Shift+G)

  2. Stage files by clicking the + icon

  3. Write a commit message and press Ctrl+Enter

  4. Push with Push button or from the Source Control menu

5. Verification#

You can verify your setup is complete when:

  • VS Code opens successfully

  • You can create a new Python file and see syntax highlighting

  • Intellisense suggests code completions as you type

  • You can see your Git repositories in the Source Control panel

  • You can run a simple Python script by clicking the ▶ button

Next Steps#

Congratulations! You now have a professional development environment. You’re ready to write some code! While we’re developing our own Python tutorial series, we recommend exploring the Intro to Python course to learn Python fundamentals before moving on to more advanced topics.