Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
November 20, 2020 03:17 am GMT

Time to learn C with Notebook in VS Code

Jupyter Notebook is popular platform to write and execute your code. However, not many C# developer use it as we have Visual Studio as our preferred IDE.

However, according to Introducing the Jupyter Extension for VS Code article, VS Code start supporting Jupyter Notebook more and more these days. So it's time to try C# on Jupyter Notebook.

.NET Interactive Notebooks

.NET Interactive Notebooks is an extension for VS Code, and it's easy to start using with 3 steps.

1. Install Visual Studio Code Insiders as it's preview feature at the moment. By the time you read this article, it would be included in normal VS Code though.

Alt Text

2. Install .NET Core SDK, which I believe all C# developer already have. The official page says to install .NET Core 3.1.

3. Install .NET Interactive Notebooks extension.

Alt Text

Just restart VS code to complete the installation.

Create your first notebook

Now you're ready to use it. Go to command palette and select "Create new blank notebook"

Alt Text

It may take a bit of time for initial notebook creation, so just wait until you see new notebook. Once it's ready, you see the notebook like below.

Alt Text

Type your code and execute by either click arrow icon or Shift+Enter.

Alt Text

Of course you can define class and use it.

Alt Text

.NET 5?

.NET 5 GA this week! Yay! But the extension supports .NET Core 3.1 at the moment. Let's wait until it support .NET 5. Check GitHub issue for more detail. I cannot wait to try Record type in notebook :)

Other than C#?

Yes, the extension supports various other dotnet related languages.

Alt Text

For example, you can write and execute PowerShell as well :)

Alt Text

Reference

dotnet/interactive
notebook samples for C#


Original Link: https://dev.to/kenakamu/time-to-learn-c-with-notebook-2gfj

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To