Why teaching .NET for web development - introducing minimal API

Published Nov 09 2021 05:00 AM 879 Views
Microsoft

As a teacher, or student, you might wonder why I should be teaching or learning .NET, there's so many other languages out there like JavaScript or Python, isn't that enough?

 

JavaScript and Python are great choices

JavaScript and Python are both great choices, it will set up your students in a position where they know how to program and understand concepts like ecosystem, libraries, how to test and even deploy to the Cloud and more.

 

How to select a programming language/ecosystem

Let's talk about why we would teach/learn something though in general:

 

What do we want out of a language and it's frameworks:

 

- simplicity, it should be simple to get started. You want to write few lines of code to get things done. Getting setup with installs and configuration should also be simple.

- big community. You don't want to pick a langage or framework that no one is using, that makes it hard to get help if you need it.

- great documentation. You will get stuck sooner or later and having great docs is important.

- a grow up story. When you pick a language or framework, it's a time investment. You are not only learning a language but you are learning the tools that go with it. For you, it should be important that you can use it for multiple areas. If you pick Iot or ML today, it should be possible to use it for say web or Cloud development tomorrow. Only you know what areas you need your chosen language/framework to support, but choose wisely.

 

So why .NET, isn't that closed source? So .NET core is open source, it runs on on Linux. macOS and Windows. There are great editors for all those OS's. 

 

Isn't it hard to get started, lots of files, concepts that students will need to know?  Not really, with minimal API, it has never been simpler to get started. Here's an API:

 

 

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

if (app.Environment.IsDevelopment())
{
    app.UseDeveloperExceptionPage();
}

app.MapGet("/", () => "Hello World!");

app.Run();

 

 

.NET is a big ecosystem of things as well for client development, web, mobile (via MAUI) and works great on Azure (so does JavaScript and Python as well).

 

If you want to learn more, a 3-part learning path was just released:

 

Learn more

Check out these LEARN modules on learning to use minimal API

 

 

 

 

%3CLINGO-SUB%20id%3D%22lingo-sub-2942547%22%20slang%3D%22en-US%22%3EWhy%20teaching%20.NET%20for%20web%20development%20-%20introducing%20minimal%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2942547%22%20slang%3D%22en-US%22%3E%3CP%3EAs%20a%20teacher%2C%20or%20student%2C%20you%20might%20wonder%20why%20I%20should%20be%20teaching%20or%20learning%20.NET%2C%20there's%20so%20many%20other%20languages%20out%20there%20like%20JavaScript%20or%20Python%2C%20isn't%20that%20enough%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--296170893%22%20id%3D%22toc-hId--296170868%22%3EJavaScript%20and%20Python%20are%20great%20choices%3C%2FH2%3E%0A%3CP%3EJavaScript%20and%20Python%20are%20both%20great%20choices%2C%20it%20will%20set%20up%20your%20students%20in%20a%20position%20where%20they%20know%20how%20to%20program%20and%20understand%20concepts%20like%20ecosystem%2C%20libraries%2C%20how%20to%20test%20and%20even%20deploy%20to%20the%20Cloud%20and%20more.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--2103625356%22%20id%3D%22toc-hId--2103625331%22%3EHow%20to%20select%20a%20programming%20language%2Fecosystem%3C%2FH2%3E%0A%3CP%3ELet's%20talk%20about%20why%20we%20would%20teach%2Flearn%20something%20though%20in%20general%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhat%20do%20we%20want%20out%20of%20a%20language%20and%20it's%20frameworks%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E-%20%3CSTRONG%3Esimplicity%3C%2FSTRONG%3E%2C%20it%20should%20be%20simple%20to%20get%20started.%20You%20want%20to%20write%20few%20lines%20of%20code%20to%20get%20things%20done.%20Getting%20setup%20with%20installs%20and%20configuration%20should%20also%20be%20simple.%3C%2FP%3E%0A%3CP%3E-%3CSTRONG%3E%20big%20community%3C%2FSTRONG%3E.%20You%20don't%20want%20to%20pick%20a%20langage%20or%20framework%20that%20no%20one%20is%20using%2C%20that%20makes%20it%20hard%20to%20get%20help%20if%20you%20need%20it.%3C%2FP%3E%0A%3CP%3E-%20%3CSTRONG%3Egreat%20documentation%3C%2FSTRONG%3E.%20You%20will%20get%20stuck%20sooner%20or%20later%20and%20having%20great%20docs%20is%20important.%3C%2FP%3E%0A%3CP%3E-%20%3CSTRONG%3Ea%20grow%20up%20story%3C%2FSTRONG%3E.%20When%20you%20pick%20a%20language%20or%20framework%2C%20it's%20a%20time%20investment.%20You%20are%20not%20only%20learning%20a%20language%20but%20you%20are%20learning%20the%20tools%20that%20go%20with%20it.%20For%20you%2C%20it%20should%20be%20important%20that%20you%20can%20use%20it%20for%20multiple%20areas.%20If%20you%20pick%20Iot%20or%20ML%20today%2C%20it%20should%20be%20possible%20to%20use%20it%20for%20say%20web%20or%20Cloud%20development%20tomorrow.%20Only%20you%20know%20what%20areas%20you%20need%20your%20chosen%20language%2Fframework%20to%20support%2C%20but%20choose%20wisely.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%20why%20.NET%2C%20isn't%20that%20closed%20source%3F%20So%20.NET%20core%20is%20open%20source%2C%20it%20runs%20on%20on%20Linux.%20macOS%20and%20Windows.%20There%20are%20great%20editors%20for%20all%20those%20OS's.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIsn't%20it%20hard%20to%20get%20started%2C%20lots%20of%20files%2C%20concepts%20that%20students%20will%20need%20to%20know%3F%26nbsp%3B%20Not%20really%2C%20with%20minimal%20API%2C%20it%20has%20never%20been%20simpler%20to%20get%20started.%20Here's%20an%20API%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-csharp%22%3E%3CCODE%3Evar%20builder%20%3D%20WebApplication.CreateBuilder(args)%3B%0Avar%20app%20%3D%20builder.Build()%3B%0A%0Aif%20(app.Environment.IsDevelopment())%0A%7B%0A%20%20%20%20app.UseDeveloperExceptionPage()%3B%0A%7D%0A%0Aapp.MapGet(%22%2F%22%2C%20()%20%3D%26gt%3B%20%22Hello%20World!%22)%3B%0A%0Aapp.Run()%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E.NET%20is%20a%20big%20ecosystem%20of%20things%20as%20well%20for%20client%20development%2C%20web%2C%20mobile%20(via%20MAUI)%20and%20works%20great%20on%20Azure%20(so%20does%20JavaScript%20and%20Python%20as%20well).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20want%20to%20learn%20more%2C%20a%203-part%20learning%20path%20was%20just%20released%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-383887477%22%20id%3D%22toc-hId-383887502%22%3ELearn%20more%3C%2FH2%3E%0A%3CP%3ECheck%20out%20these%20LEARN%20modules%20on%20learning%20to%20use%20minimal%20API%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Flearn%2Fmodules%2Fbuild-web-api-minimal-api%3Fwt.mc_id%3Dacademic-0000-chnoring%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EYour%20first%20minimal%20API%20%2B%20Swagger%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Flearn%2Fmodules%2Fbuild-web-api-minimal-database%3Fwt.mc_id%3Dacademic-0000-chnoring%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eminimal%20API%20with%20Entity%20Framework%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Flearn%2Fmodules%2Fbuild-web-api-minimal-spa%3Fwt.mc_id%3Dacademic-0000-chnoring%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eminimal%20API%20with%20React%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2942547%22%20slang%3D%22en-US%22%3E%3CP%3EBuild%20a%20Web%20API%20in%204%20lines%20of%20code%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202021-11-08%20at%2017.14.52.png%22%20style%3D%22width%3A%20276px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F325520iD530D1EC1FA4453A%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202021-11-08%20at%2017.14.52.png%22%20alt%3D%22Screenshot%202021-11-08%20at%2017.14.52.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2942547%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPI%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edotnet%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ewebdev%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Nov 09 2021 05:01 AM
Updated by: