Modernize your legacy code with GitHub Copilot

In this exercise, you’ll modernize a legacy codebase (from Cobol to Node.js) with the help of GitHub Copilot, practicing refactoring and modernization techniques.

You will learn:

  • Assess and explain the current state of a legacy codebase.
  • Identify modernization/refactoring opportunities.
  • Use GitHub Copilot to generate and validate modern code replacements.

Before you start

To complete this exercise, you need:

  • Completion of the “Getting Started with GitHub Copilot” Skills exercise.
  • Familiarity with Visual Studio Code (VS Code).
  • Basic coding principles.

Complete the exercise on GitHub

In this exercise, you’ll complete a guided GitHub Skills tutorial focused on understanding and modernizing legacy code.

The exercise consists of the following activities:

  1. Open a web browser and navigate to the exercise page:
    https://github.com/skills/modernize-your-legacy-code-with-github-copilot
  2. Follow the instructions provided in the repository to complete all challenges.
  3. Work through each step to:
    • Explain the current state of your legacy code.
    • Create a diagram of the data flow in your code.
    • Identify areas of the legacy code that can be improved.
    • Use GitHub Copilot to generate modern code snippets.
    • Replace old code with new snippets and test the changes.

When you finish, return to your learning experience to complete any knowledge check and earn completion credit.

What you’ve learned

After completing this exercise, you should be able to:

  • Assess and explain the current state of a legacy codebase.
  • Identify modernization/refactoring opportunities.
  • Use GitHub Copilot to generate and validate modern code replacements.

Congratulations — you’ve completed the legacy code modernization exercise!