This project demonstrates the modernization of COBOL to C# using AI pair programming with GitHub Copilot. It provides a walkthrough of simple use cases to aid in modernization efforts.
-
Setup: Spin up a codespace and install the Copilot extension.
-
Hello World Example: Open the
helloworld.cbl
file. Use the chat to ask 'what is this cobol code doing' or use the workspace/explain built-in hotkey. This demonstrates how developers unfamiliar with COBOL can understand its different elements. -
Documentation: Highlight the entire contents of
helloworld.cbl
and ask the chat 'document this code for me with inline comments'. This demonstrates the first step in modernization: documenting existing codebases. -
Modernization Discussion: Ask Copilot chat 'how would I modernize a COBOL program into C#'. Discuss how Copilot can be used to translate the codebase and aid in modernization efforts.
-
Translation: Highlight the entire contents of
helloworld.cbl
and ask Copilot chat to 'translate this into C#'. Discuss the response and the benefits of using Copilot for this task.
-
Switch to Financial File: Open the
financial.cbl
file. -
Documentation: Use Copilot Chat to document the code with inline comments.
-
Conversion: Run through the conversion of this COBOL program using the steps outlined by Copilot in the previous question from Demo 1 - 'how would I modernize a COBOL program into C#'.
-
Step-by-Step Modernization: Tell Copilot you want to run through the steps outlined previously. Prompt Copilot chat for each step and discuss the steps you are taking with the customer.
-
Summary: End the demo by summarizing what was discussed. Emphasize that GitHub Copilot can be used for modernization efforts as both a tool to translate from one language to another, write in the destination language from scratch, and aid in the steps needed to be taken to modernize.