Settings Results in 4 milliseconds

Insert Data in Array In Style
Category: Databases

When I was reading about Stacks data structure, I found something interesting when trying to insert ...


Views: 294 Likes: 88
 The .NET Stacks #62: ?? And we're back
The .NET Stacks #62 ?? And we're back

This is the web version of my weekly newsletter, The .NET Stacks, originally sent to email subscribers on September 13, 2021. Subscribe at the bottom of the post to get this right away!Happy Monday! Miss me? A few of you said you have, but I'm 60% sure that's sarcasm.As you know, I took the last month or so off from the newsletter to focus on other things. I know I wasn't exactly specific on why, and appreciate some of you reaching out. I wasn't comfortable sharing it at the time, but I needed to take time away to focus on determining the next step in my career. If you've interviewed lately, I'm sure you understand ... it really is a full-time job.  I'm happy to say I've accepted a remote tech lead role for a SaaS company here. I'm rested and ready, so let's get into it! I'm trying something a little different this week—feel free to let me know what you think.?? My favorite from last weekASP.NET 6.0 Minimal APIs, why should you care?Ben FosterWe've talked about Minimal APIs a lot in this newsletter and it's quite the hot topic in the .NET community. An alternative way to write APIs in .NET 6 and beyond, there's a lot of folks wondering if it's suitable for production, or can lead to misuse. Ben notes "Minimal simply means that it contains the minimum set of components needed to build HTTP APIs ... It doesn’t mean that the application you build will be simple or not require good design.""I find that one of the biggest advantages to Minimal APIs is that they make it easier to build APIs in an opinionated way. After many years building HTTP services, I have a preferred approach. With MVC I would replace the built-in validation with Fluent Validation and my controllers were little more than a dispatch call to Mediatr. With Minimal APIs I get even more control. Of course if MVC offers everything you need, then use that."In a similar vein, Nick Chapsas has a great walkthrough on strategies for building production-ready Minimal APIs. No one expects your API to be in one file, and he shows practical ways to deal with dependencies while leveraging minimal API patterns. Damian Edwards has a nice Twitter thread, as well. As great as these community discussions are, I really think the greatest benefit is getting lost the performance gains.?? Community and eventsIncreasing developer happiness with GitHub code scanningSam PartingtonIf you work in GitHub, you probably already know that GitHub utilizes code scanning to find security vulnerabilities and errors in your repository. Sam Partington writes about something you might not know they use CodeQL—their internal code analysis engine—to protect themselves from common coding mistakes. Here's what Sam says about loopy performance issues "In addition to protecting against missing error checking, we also want to keep our database-querying code performant. N+1 queries are a common performance issue. This is where some expensive operation is performed once for every member of a set, so the code will get slower as the number of items increases. Database calls in a loop are often the culprit here; typically, you’ll get better performance from a batch query outside of the loop instead.""We created a custom CodeQL query ... We filter that list of calls down to those that happen within a loop and fail CI if any are encountered. What’s nice about CodeQL is that we’re not limited to database calls directly within the body of a loop?calls within functions called directly or indirectly from the loop are caught too."You can check out the post for more details and learn how to use these queries or make your own.More from last weekSimon Bisson writes about how to use the VS Code editor in your own projects.The Netflix Tech Blog starts a series on practical API design and also starts writing about their decision-making process.The .NET Docs Show talks about micr0 frontends with Blazor.For community standups, Entity Framework talks about OSS projects, ASP.NET has an anniversary, .NET MAUI discusses accessibility, and Machine Learning holds office hours.?? Web developmentHow To Map A Route in an ASP.NET Core MVC applicationKhalid AbuhakmehIf you're new to ASP.NET Core web development, Khalid put together a nice post on how to add an existing endpoint to an existing ASP.NET Core MVC app. Even if you aren't a beginner, you might learn how to resolve sticky routing issues. At the bottom of the post, he has a nice checklist you should consider when adding a new endpoint.More from last weekBen Foster explores custom model binding with Minimal APIs in .NET 6.Thomas Ardal debugs System.FormatException when launching ASP.NET Core.Jeremy Morgan builds a small web API with Azure Functions and SQLite.Ed Charbeneau works with low-code data grids and Blazor.Scott Hanselman works with a Minimal API todo app.?? The .NET platformUsing Source Generators with Blazor components in .NET 6Andrew LockWhen Andrew was upgrading a Blazor app to .NET 6, he found that source generators that worked in .NET 5 failed to discover Blazor components in his .NET 6 app because of changes to the Razor compilation process.He writes "The problem is that my source generators were relying on the output of the Razor compiler in .NET 5 ... My source generator was looking for components in the compilation that are decorated with [RouteAttribute]. With .NET 6, the Razor tooling is a source generator, so there is no 'first step'; the Razor tooling executes at the same time as my source generator. That is great for performance, but it means the files my source generator was relying on (the generated component classes) don't exist when my generator runs."While this is by design, Andrew has a great post underlying the issue and potential workarounds.More from last weekMark Downie writes about his favorite improvements in .NET 6.Sergey Vasiliev writes about optimizing .NET apps.Pawel Szydziak writes cleaner, safer code with SonarQube, Docker, and .NET Core.Sam Basu writes about how to develop for desktop in 2022, and also about developing for .NET MAUI on macOS.Paul Michaels manually parses a JSON string using System.Text.Json.Johnson Towoju writes logs to SQL Server using NLog.Andrew Lock uses source generators with Blazor components in .NET 6.Rick Strahl launches Visual Studio Code cleanly from a .NET app.Jirí Cincura calls a C# static constructor multiple times.? The cloudMinimal Api in .NET 6 Out Of Process Azure FunctionsAdam StorrWith all this talk about Minimal APIs, Adam asks can I use it with the new out-of-process Azure Functions model in .NET 6?He says "Azure Functions with HttpTriggers are similar to ASP.NET Core controller actions in that they handle http requests, have routing, can handle model binding, dependency injection etc. so how could a 'Minimal API' using Azure Functions look?"More from last weekDamien Bowden uses Azure security groups in ASP.NET Core with an Azure B2C identity provider.Jon Gallant works with the ChainedTokenCredential in the Azure Identity library.Adam Storr uses .NET 6 Minimal APIs with out-of-process Azure Functions.?? ToolsNew Improved Attach to Process Dialog ExperienceHarshada HoleWith the 2022 update, Visual Studio is improving the debugging experience—included is a new Attach to Process dialog experience.Harshada says "We have added command-line details, app pool details, parent/child process tree view, and the select running window from the desktop option in the attach to process dialog. These make it convenient to find the right process you need to attach. Also, the Attach to Process dialog is now asynchronous, making it interactive even when the process list is updating." The post walks through these updates in detail.More from last weekJeremy Likness looks at the EF Core Azure Cosmos DB provider.Harshada Hole writes about the new Attach to Process dialog experience in Visual Studio.Ben De St Paer-Gotch goes behind the scenes on Docker Desktop.Esteban Solano Granados plays with .NET 6, C# 10, and Docker.?? Design, testing, and best practicesShip / Show / Ask A modern branching strategyRouan WilsenachRouan says "Ship/Show/Ask is a branching strategy that combines the features of Pull Requests with the ability to keep shipping changes. Changes are categorized as either Ship (merge into mainline without review), Show (open a pull request for review, but merge into mainline immediately), or Ask (open a pull request for discussion before merging)."More from last weekLiana Martirosyan writes about enabling team learning and boost performance.Sagar Nangare writes about measuring user experience in modern applications and infrastructure.Neal Ford and Mark Richards talk about the hard parts of software architecture.Derek Comartin discusses event-sourced aggregate design.Steve Smith refactors to value objects.Sam Milbrath writes about holding teams accountable without micromanaging.Helen Scott asks how can you stay ahead of the curve as a developer?Rouan Wilsenach writes about a ship / show / ask branching strategy.Jeremy Miller writes about integration Testing using the IHost Lifecycle with xUnit.Net.?? Podcasts and VideosServerless Chats discusses serverless for beginners.The .NET Core Show talks about DotPurple With Michael Babienco.The Changelog talks to a lawyer about GitHub Copilot.Technology and Friends talks to Sam Basu about .NET MAUI.Visual Studio Toolbox talks about Web Live Preview.The ASP.NET Monsters talk about new Git commands.Adventures in .NET talk about Jupyter notebooks.The On .NET Show migrates apps to modern authentication and processes payments with C# and Stripe.


 The .NET Stacks #33: ?? A blazing conversation with Steve Sanderson
The .NET Stacks #33 ?? A blazing conversation wi ...

Happy Monday, all. What did you get NuGet for its 10th birthday?This weekMicrosoft blogs about more .NET 5 improvementsA study on migrating a hectic service to .NET CoreMeet Jab, a new compile-time DI libraryDev Discussions Steve SandersonLast week in the .NET worldMicrosoft blogs about more .NET 5 improvementsThis week, Microsoft pushed a few more blog posts to promote .NET 5 improvements Sourabh Shirhatti wrote about diagnostic improvements, and Mána Píchová writes about .NET networking improvements.Diagnostic improvementsWith .NET 5, the diagnostic suite of tools does not require installing them as .NET global tools—they can now be installed without the .NET SDK. There’s now a single-file distribution mechanism that only requires a runtime of .NET Core 3.1 or higher. You can check out the GitHub repo to geek out on all the available diagnostics tools. In other news, you can now perform startup tracing from EventPipe as the tooling can now suspend the runtime during startup until a tool is connected. Check out the blog post for the full treatment.Networking improvementsIn terms of .NET 5 networking improvements, the team added the ability to use cancellation timeouts from HttpClient without the need for a custom CancellationToken. While the client still throws a TaskCanceledException, the inner exception is a TimeoutException when timeouts occur. .NET 5 also supports multiple connections with HTTP/2, a configurable ping mechanism, experimental support for HTTP/3, and various telemetry improvements. Check out the networking blog post for details. It’s a nice complement to Stephen Toub’s opus about .NET 5 performance improvements.A study on migrating a hectic service to .NET CoreThis week, Avanindra Paruchuri wrote about migrating the Azure Active Directory gateway—and its 115 billion daily requests—over to .NET Core. While there’s nothing preventing you hosting .NET Framework apps in the cloud, the bloat of the framework often leads to expensive cloud spend.The gateway’s scale of execution results in significant consumption of compute resources, which in turn costs money. Finding ways to reduce the cost of executing the service has been a key goal for the team behind it. The buzz around .NET Core’s focus on performance caught our attention, especially since TechEmpower listed ASP.NET Core as one of the fastest web frameworks on the planet.In Azure AD gateway’s case, we were able to cut our CPU costs by 50%. As a result of the gains in throughput, we were able to reduce our fleet size from ~40k cores to ~20k cores (50% reduction) … Our CPU usage was reduced by half on .NET Core 3.1 compared to .NET Framework 4.6.2 (effectively doubling our throughput).It’s a nice piece on how they were able to gradually move over and gotchas they learned along the way.Meet Jab, a new compile-time DI libraryThis week, Pavel Krymets introduced Jab, a library used for compile-time dependency injection. Pavel works with the Azure SDKs and used to work on the ASP.NET Core team. Remember a few weeks ago, when we said that innovation in C# source generators will be coming in 2021? Here we go.From the GitHub readme, it promises fast startup (200x more than Microsoft.Extensions.DependencyInjection), fast resolution (a 7x improvement), no runtime dependencies, with all code generating during project compilation. Will it run on ASP.NET Core? Not likely, since ASP.NET Core is heavily dependent on the runtime thanks to type accessibility and dependency discovery, but Pavel wonders if there’s a middle ground.Dev Discussions Steve SandersonIt seems like forever ago when, at NDC Oslo in 2017, Steve Sanderson showed off a new web UI framework with the caveat “an experiment, something for you to be amused by.” By extending Dot Net Anywhere (DNA), Chris Bacon’s portable .NET runtime, on WebAssembly, he was able to load and run C# in the browser. In the browser!Of course, this amusing experiment has grown into Blazor, a robust system for writing web UIs in C#. I was happy to talk to Steve Sanderson about his passions for the front-end web, how far Blazor has come, and what’s coming to Blazor in .NET 6.Years ago, you probably envisioned what Blazor could be. Has it met its potential, or are there other areas to focus on?We’re not there yet. If you go on YouTube and find the first demo I ever did of Blazor at NDC Oslo in 2017, you’ll see my original prototype had near-instant live reloading while coding, and the download size was really tiny. I still aspire to get the real version of Blazor to have those characteristics. Of course, the prototype had the advantage of only needing to do a tiny number of things—creating a production-capable version is 100x more work, which is why it hasn’t yet got there, but has of course exceeded the prototype vastly in more important ways.Good news though is that in .NET 6 we expect to ship an even better version of live-updating-while-coding than I had in that first prototype, so it’s getting there!When looking at AOT, you’ll see increased performance but a larger download size. Do you see any other tradeoffs developers will need to consider?The mixed-mode flavour of AOT, in which some of your code is interpreted and some is AOT, allows for a customizable tradeoff between size and speed, but also includes some subtleties like extra overhead when calling from AOT to interpreted code and vice-versa.Also, when you enable AOT, your app’s publish time may go up substantially (maybe by 5-10 minutes, depending on code size) because the whole Emscripten toolchain just takes that long. This wouldn’t affect your daily development flow on your own machine, but likely means your CI builds could take longer.It’s still quite impressive to see the entire .NET runtime run in the browser for Blazor Web Assembly. That comes with an upfront cost, as we know. I know that the Blazor team has done a ton of work to help lighten the footprint and speed up performance. With the exception of AOT, do you envision more work on this? Do you see a point where it’ll be as lightweight as other leading front-end frameworks, or will folks need to understand it’s a cost that comes with a full framework in the browser?The size of the .NET runtime isn’t ever going to reduce to near-zero, so JS-based microframeworks (whose size could be just a few KB) are always going to be smaller. We’re not trying to win outright based on size alone—that would be madness. Blazor WebAssembly is aimed to be maximally productive for developers while being small enough to download that, in very realistic business app scenarios, the download size shouldn’t be any reason for concern.That said, it’s conceivable that new web platform features like Signed HTTP Exchanges could let us smartly pre-load the .NET WebAssembly runtime in a browser in the background (directly from some Microsoft CDN) while you’re visiting a Blazor WebAssembly site, so that it’s instantly available at zero download size when you go to other Blazor WebAssembly sites. Signed HTTP Exchanges allow for a modern equivalent to the older idea of a cross-site CDN cache. We don’t have a definite plan about that yet as not all browsers have added support for it.Check out the entire interview at my site.?? Last week in the .NET world?? The Top 3Andrew Lock introduces the ASP.NET Core Data Protection system.Maarten Balliauw writes about building a friendly .NET SDK.Josef Ottosson writes an Azure Function to zip multiple files from Azure Storage.?? AnnouncementsShelley Bransten announces Microsoft Cloud for Retail.Christopher Gill celebrates NuGet’s 10th birthday.Tara Overfield releases the January 2021 Security and Quality Rollup Updates for .NET Framework, and Rahul Bhandari writes about the .NET January 2021 updates..NET 6 nightly builds for Apple M1 are now available.The Visual Studio team wants your feedback on Razor syntax coloring.?? Community and eventsThe .NET Docs Show talks to Luis Quintanilla about F#.Pavel Krymets introduces Jab, a compile-time DI container.The Entity Framework Standup talks about EF Core 6 survey results, and the Languages & Runtime standup discusses plans for .NET 6 and VB source generators.Sarah Novotny writes about 4 open source lessons for 2021.IdentityServer v5 has shipped.Khalid Abuhakmeh rethinks OSS attribution in .NET.TechBash 2021 is slated for October 19-22, 2021.?? Web developmentDave Brock builds a “search-as-you-type” box in Blazor.Cody Merritt Anhorn uses localization with Blazor.Changhui Xu uploads files with Angular and .NET Web API.Mark Pahulje uses HtmlAgilityPack to get all emails from an HTML page.Jon Hilton uses local storage with Blazor.Anthony Giretti tests gRPC endpoints with gRPCurl, and also explores gRPCui.The folks at Uno write about building a single-page app in XAML and C# with WebAssembly.Marinko Spasojevic handles query strings in Blazor WebAssembly.Daniel Krzyczkowski continues building out his ASP.NET Core Web API by integrating with Azure Cosmos DB.?? The .NET platformSean Killeen describes the many flavors of .NET.Mattias Karlsson writes about his boilerplate starting point for .NET console apps.David Ramel delivers a one-stop shop for .NET 5 improvements.Sam Walpole discusses writing decoupled code with MediatR.Sourabh Shirhatti writes about diagnostics improvements with .NET 5.Mána Píchová writes about .NET 5 networking improvements.? The cloudAvanindra Paruchuri writes about migrating the Azure AD gateway to .NET Core.Johnny Reilly works with Azure Easy Auth.Muhammed Saleem works with Azure Functions.Chris Noring uses Azure Key Vault to manage secrets.Bryan Soltis posts a file to an Azure Function in 3 minutes.Damian Brady generates a GitHub Actions workflow with Visual Studio or the dotnet CLI.Thomas Ardal builds and tests multiple .NET versions with GitHub Actions.Dominique St-Amand works with integration tests using Azure Storage emulator and .NET Core in Azure DevOps.Aaron Powell uses environments for approval workflows with GitHub Actions.Damien Bowden protects legacy APIs with an ASP.NET Core YARP reverse proxy and Azure AD Auth.?? LanguagesKhalid Abuhakmeh writes about Base64 encoding with C#.Franco Tiveron writes about a developer’s C# 9 cheat sheet.Bruno Sonnino uses C# to convert XML data to JSON.Jacob E. Shore writes about his first impressions of F#.Matthew Crews writes about learning resources for F#.Mark-James McDougall writes an iRacing SDK implementation in F#.?? ToolsElton Stoneman writes about understanding Microsoft’s Docker images for .NET apps.Jon P. Smith writes about updating many-to-many relationships in EF Core 5 and above.Ruben Rios writes about a more integrated terminal experience with Visual Studio.Benjamin Day writes about tests in Visual Studio for Mac.The folks at Packt write about DAPR.Peter De Tender publishes Azure Container Instances from the Docker CLI.Nikola Zivkovic writes about linear regression with ML.NET.Patrick Smacchia writes how NDepend used Resharper to quickly refactored more than 23,000 calls to Debug.Assert().Mark Heath discusses his plans for NAudio 2.Michal Bialecki asks is Entity Framework Core fast?Jon P. Smith introduces a library to automate soft deletes in EF Core.?? XamarinLeomaris Reyes introduces UX design with Xamarin Forms.Charlin Agramonte writes about XAML naming conventions in Xamarin.Forms.Leomaris Reyes works with the Infogram in Xamarin.Forms 5.0.Rafael Veronezi previews XAML UIs.James Montemagno writes about how to integrate support emails in mobile apps with data and logs.Leomaris Reyes writes about the Xamarin.Forms File Picker.?? Design, testing, and best practicesSteve Gordon writes about how to become a better developer by asking questions.Derek Comartin says start with a monolith, not microservices.Stephen Cleary writes about durable queues.?? PodcastsScott Hanselman explores event modeling with Adam Dymitruk.At Working Code podcast, a discussion on monoliths vs. microservices.The .NET Rocks podcast checks in on IdentityServer.The .NET Core Show talks Blazor with Chris Sainty.The 6-Figure Developer podcast talks to Christos Matskas about Microsoft Identity.?? VideosThe ON.NET Show inspects application metrics with dotnet-monitor, works on change notifications with Microsoft Graph, and inspects application metrics with dotnet-monitor.Scott Hanselman shows you what happens when after you enter a URL in your browser.The ASP.NET Monsters talk about migrating their site to Azure Blob Storage..At Technology and Friends, David Giard talks to Mike Benkovich about GitHub Actions and Visual Studio.


 The .NET Stacks #18: RC1 is here, the fate of .NET Standard, and F# with Isaac Abraham
The .NET Stacks #18 RC1 is here, the fate of .NE ...

.NET 5 RC1 is hereThis week, Microsoft pushed out the RC1 release for .NET 5, which is scheduled to officially “go live” in early November. RC1 comes with a “go live” license, which means you get production support for it. With that, RC1 versions were released for ASP.NET Core and EF Core as well.I’ve dug deep on a variety of new features in the last few months or so—I won’t  rehash them here. However, the links are worth checking out. For example, Richard Lander goes in-depth on C# 9 records and System.Text.Json.The fate of .NET StandardWhile there are many great updates to the upcoming .NET 5 release, a big selling point is at a higher level the promise of a unified SDK experience for all of .NET. The idea is that you’ll be able to use one platform regardless of your needs—whether it’s Windows, Linux, macOS, Android, WebAssembly, and more. (Because of internal resourcing constraints, Xamarin will join the party in 2021, with .NET 6.)Microsoft has definitely struggled in communicating a clear direction for .NET the last several years, so when you pair a unified experience with predictable releases and roadmaps, it’s music to our ears.You’ve probably wondered what does this mean for .NET Standard? The unified experience is great, but what about when you have .NET Framework apps to support? (If you’re new to .NET Standard, it’s more-or-less a specification where you can target a version of Standard, and all .NET implementations that target it are guaranteed to support all its .NET APIs.)Immo Landwerth shed some light on the subject this week. .NET Standard is being thrown to the .NET purgatory with .NET Framework it’ll still technically be around, and .NET 5 will support it—but the current version, 2.1, will be its last.As a result, we have some new target framework names net5.0, for apps that run anywhere, combines and replaces netcoreapp and netstandard. There’s also net5.0-windows (with Android and iOS flavors to come) for Windows-specific use cases, like UWP.OK, so .NET Standard is still around but we have new target framework names. What should you do? With .NET Standard 2.0 being the last version to support .NET Framework, use netstandard2.0 for code sharing between .NET Framework and other platforms. You can use netstandard2.1 to share between Mono, Xamarin, and .NET Core 3.x, and then net5.0 for anything else (and especially when you want to use .NET 5 improvements and new language features). You’ll definitely want to check out the post for all the details.What a mess .NET Standard promised API uniformity and now we’re even having to choose between that and a new way of doing things. The post lays out why .NET Standard is problematic, and it makes sense. But when you’re trying to innovate at a feverish pace but still support customers on .NET Framework, the cost is complexity—and the irony is that with uniformity with .NET 5, that won’t apply when you have legacy apps to support.Dev Discussions Isaac AbrahamAs much as we all love C#, there’s something that needs reminding from time to time C# is not .NET. It is a large and important part of .NET, for sure, but .NET also supports two other languages Visual Basic and F#. As for F#, it’s been gaining quite a bit of popularity over the last several years, and for good reason it’s approachable, concise, and allows you to embrace a functional-first language while leveraging the power of the .NET ecosystem.I caught up with Isaac Abraham to learn more about F#. After spending a decade as a C# developer, Isaac embraced the power of F# and founded Compositional IT, a functional-first consultancy. He’s also the author of Get Programming with F# A Guide for .NET Developers.I know it’s more nuanced than this but if you could sell F# to C# developers in a sentence or two, how would you do it?F# really does bring the fun back into software development. You’ll feel more productive, more confident and more empowered to deliver high-quality software for your customers.Functional programming is getting a lot of attention in the C# world, as the language is adopting much of its concepts (especially with C# 9). It’s a weird balance trying to have functional concepts in an OO language. How do you feel the balance is going?I have mixed opinions on this. On the one hand, for the C# dev it’s great—they have a more powerful toolkit at their disposal. But I would hate to be a new developer starting in C# for the first time. There are so many ways to do things now, and the feature (and custom operator!) count is going through the roof. More than that, I worry that we’ll end up with a kind of bifurcated C# ecosystem—those that adopt the new features and those that won’t, and worse still the risk of losing the identity of what C# really is.I’m interested to see how it works out. Introducing things like records into C# is going to lead to some new and different design patterns being used that will have to naturally evolve over time.I won’t ask if C# will replace F#—you’ve eloquently written about why the answer is no. I will ask you this, though is there a dividing line of when you should use C# (OO with functional concepts) or straight to F#?I’m not really sure the idea of “OO with functional concepts” really gels, to be honest. Some of the core ideas of FP—immutability and expressions—are kind of the opposite of OO, which is all centered around mutable data structures, statements and side effects. By all means use the features C# provides that come from the FP world and use them where it helps—LINQ, higher order functions, pattern matching, immutable data structures—but the more you try out those features to try what they can do without using OO constructs, the more you’ll find C# pulls you “back.” It’s a little like driving an Audi on the German motorway but never getting out of third gear.My view is that 80% of the C# population today—maybe more—would be more productive and happier in F#. If you’re using LINQ, you favour composition over inheritance, and you’re excited by some of the new features in C# like records, switch expressions, tuples, and so on, F# will probably be a natural fit for you. All of those features are optimised as first-class citizens of the language, whilst things like mutability and classes are possible, but are somewhat atypical.This also feeds back to your other question—I do fear that people will try these features out within the context of OO patterns, find them somehow limited, and leave thinking that FP isn’t worthwhile.Let’s say I’m a C# programmer and want to get into F#. Is there any C# knowledge that will help me understand the concepts, or is it best to clear my mind of any preconceived notions before learning?Probably the closest concept would be to imagine your whole program was a single LINQ query. Or, from a web app—imagine every controller method was a LINQ query. In reality it’s not like that, but that’s the closest I can think of. The fact that you’ll know .NET inside and out is also a massive help. The things to forget are basically the OO and imperative parts of the language classes, inheritance, mutable variables, while loops, and statements. You don’t really use any of those in everyday F# (and believe me, you don’t need any of them to write standard line of business apps).As an OO programmer, it’s so painful always having to worry about “the billion dollar mistake” nulls. We can’t assume anything since we’re mutating objects all over the place and often throw up our hands and do null checks everywhere (although the language has improved in the last few versions). How does F# handle nulls? Is it less painful?For F# types that you create, the language simply says null isn’t allowed, and there’s no such thing as null. So in a sense, the problem goes away by simply removing it from the type system. Of course, you still have to handle business cases of “absence of a value,” so you create optional values—basically a value that can either have something or nothing. The compiler won’t let you access the “something” unless you first “check” that the value isn’t nothing.So, you spend more time upfront thinking about how you model your domain rather than simply saying that everything and anything is nullable. The good thing is, you totally lose that fear of “can this value be null when I dot into it” because it’s simply not part of the type system. It’s kind of like the flow analysis that C# 8 introduced for nullability checks—but instead of flow analysis, it’s much simpler. It’s just a built-in type in the language. There’s nothing magical about it.However, when it comes to interoperating with C# (and therefore the whole BCL), F# doesn’t have any special compiler support for null checks, so developers will often create a kind of “anti-corruption” layer between the “unsafe outside world” and the safe F# layer, which simply doesn’t have nulls. There’s also work going on to bring in support for the nullability surface in the BCL but I suspect that this will be in F# 6.F#, and functional programming in general, emphasizes purity no side effects. Does F# enforce this, or is it just designed with it in mind?No, it doesn’t enforce it. There’s some parts of the language which make it obvious when you’re doing a side effect, but it’s nothing like what Haskell does. For starters, the CLR and BCL don’t have any notion of a side effect, so I think that this would difficult to introduce. It’s a good example of some of the design decisions that F# took when running on .NET—you get all the goodness of .NET and the ecosystem, but some things like this would be challenging to do. In fact, F# has a lot of escape hatches like this. It strongly guides you down a certain path, but it usually has ways that you can do your own thing if you really need to.You still can (and people do) write entire systems that are functionally pure, and the benefits of pure functions are certainly something that most F# folks are aware of (it’s much easier to reason about and test, for example). It just means that the language won’t force you to do it.What is your one piece of programming advice?Great question. I think one thing I try to keep in mind is to avoid premature optimisation and design. Design systems for what you know is going to be needed, with extension points for what will most likely be required. You can never design for every eventuality, and you’ll sometimes get it wrong, that’s life—optimise for what is the most likely outcome.To read the entire interview, head on over to my site.?? Last week in the .NET world?? The Top 3.NET 5 RC 1 is out Richard Lander has the announcement, Jeremy Likness talks about EF updates, and Daniel Roth discusses what’s new for ASP.NET.Immo Landwerth speaks about the future of .NET Standard.Steve Gordon walks through performance optimizations.?? AnnouncementsThere’s a new Learn module for deploying a cloud-native ASP.NET microservice with GitHub Actions.Mark Downie talks about disassembly improvements for optimized managed debugging.Microsoft Edge announces source order viewer in their DevTools.Tara Overfield provides September cumulative updates for the .NET Framework.?? Community and eventsMicrosoft Ignite occurs this Tuesday through Thursday.The .NET Docs Show talks about the dot.net site with Maíra Wenzel.Three .NET community standups this week .NET Tooling finds latent bugs in .NET 5, Entity Framework talks EF Core 5 migrations, and ASP.NET discusses new features for .NET API developers.?? ASP .NET / BlazorShaun Curtis launches a series on building a database application in Blazor.Patrick Smacchia walks through the architecture of a C# game rendered with Blazor, Xamarin, UWP, WPF, and Winforms.David Ramel writes about increased Blazor performance in .NET 5 RC1.Rick Strahl warns about missing await calls for async code in ASP.NET Code middleware.Dominique St-Amand secures an ASP.NET Core Web API with an API key.Vladimir Pecanac discusses how to secure sensitive data locally with ASP.NET Core.David Grace explores why you app might not be working in IIS.?? .NET CoreKay Ewbank discusses the latent bug discovery feature coming with .NET 5.Michal Bialecki executes raw SQL with EF 5.Fredrik Rudberg serves images stored in a database through static URLs using .NET Core 3.1.Shawn Wildermuth talks about hosting Vue in .NET Core.? The cloudVladimir Pecanac configures the Azure Key Vault in ASP.NET Core.Richard Seroter compares the CLI experience between Azure, AWS, and GCP.Jon Gallant walks though the September updates to the Azure SDKs.Christopher Scott introduces the new Azure Tables client libraries.Daniel Krzyczkowski extracts Excel file content with Azure Logic Apps and Azure Functions.Kevin Griffin touts the great performance for Azure Static Web Apps and Azure Functions.Matt Small finds a gotcha you can’t use an Azure Key Vault firewall if you’re in a situation where you’re using App Gateway along with a Key Vault certificate for SSL termination.Gunnar Peipman hosts applications on Azure B-series virtual machines.?? C#Jeremy Clark shows how to see all the exceptions when calling “await Task.WhenAll.”.Jerome Laban uses MSBuild items and properties in C# 9 source generators.?? F#A nice rundown of 10 ways to try F# in the browser.Daniel Bykat talks about the PORK framework and its use with F#.Alican Demirtas discusses string interpolation in F#.Paul Biggar talks about his async adventures.?? ToolsDerek Comartin does a review of MediatR.Tom Deseyn uses OpenAPI with .NET Core.John Juback builds cross-platform desktop apps with Electron.NET.Andrew Lock continues his k8s series by deploying applications with Helm.You can now debug Linux core dumps on the Windows Subsystem for Linux (WSL) or a remote Linux system directly from Visual Studio.Adam Storr uses Project Tye to run .NET worker services.?? XamarinJoe Meyer wires up a fullscreen video background.Khalid Abuhakmeh animates a mic drop.Denys Fiediaiev uses MvvmCross to log with Xamarin.?? PodcastsThe .NET Rocks podcast talks about ML with Zoiner Tejada.Software Engineering Radio talks with Philip Kiely about writing for software developers.The Merge Conflict podcast discusses the new Half type.The Coding Blocks podcast asks is Kubernetes programming?The Azure DevOps Podcast talks with Steve Sanderson about Blazor.?? VideosThe ON .NET Show talks about Steeltoe configuration.Azure Friday talks about Azure landing zones.Scott Hanselman gives us a primer on the cloud.The ASP.NET Monsters send dates from JavaScript to .NET.


What is Computer Programming
Category: Computer Programming

<div class="group w-full text-gray-800 darktext-gray-100 border-b border-black/10 darkborder-gray- ...


Views: 0 Likes: 17
 The .NET Stacks #8: functional C# 9, .NET Foundation nominees, Azure community, more!
The .NET Stacks #8 functional C# 9, .NET Foundat ...

This is an archive of my weekly (free!) newsletter, -The .NET Stacks-. Consider subscribing today to get this content right away! Subscribers don’t have to wait a week to receive the content.On tap this weekC# 9 a functionally better releaseThe .NET Foundation nominees are out!Dev Discussions Michael CrumpCommunity roundupC# 9 a functionally better releaseI’ve been writing a lot about C# 9 lately. No, seriously a lot. This week I went a little nuts with three posts I talked about records, pattern matching, and top-level programs. I’ve been learning a ton, which is always the main goal, but what’s really interesting is how C# is starting to blur the lines between object-oriented and functional programming. Throughout the years, we’ve seen some FP concepts visit C#, but I feel this release is really kicking it up a notch.In the not-so-distant past, discussing FP and OO meant putting up with silly dogmatic arguments that they have to be mutually exclusive. It isn’t hard to understand why traditional concepts of OO constructs are grouping data and behavior (state) in single mutable objects, and FP draws a hard line between data and behavior in the name of purity and minimizing side effects (immutability by default).So, typically as a .NET developer, this left you with two choices C#, .NET’s flagship language, or F#, a wonderful functional language that is concise (no curlies or semi-colons and great type inference), convenient (functions as first-class objects), and has default immutability.However, this is no longer a binary choice. For example, let’s look at a blog post from a few years ago that maps C# concepts to F# concepts.C#/OO has variables, F#/FP has immutable values. C# 9 init-only properties and records bring that ability to C#.C# has statements, F# has expressions. C# 8 introduced switch expressions and enhanced pattern matching, and has more expressions littered throughout the language now.C# has objects with methods, F# has types and functions. C# 9 records are also blurring the line in this regard.So here we are, just years after wondering if F# will ever take over C#, we see people wondering the exact opposite as Isaac Abraham asks will C# replace F#? (Spoiler alert no.)There is definitely pushback in the community from C# 8 purists, to which I say why not both? You now have the freedom to “bring in” the value of functional programming, while doing it in a familiar language. You can bring in these features, along with C#’s compatibility. These changes will not break the language. And if they don’t appeal to you, you don’t have to use them. (Of course, mixing FP and OO in C# is not always graceful and is definitely worth mentioning.)This isn’t a C# vs F# rant, but it comes down to this is C# with functional bits “good enough” because of your team’s skillset, comfort level, and OO needs? Or do you need a clean break, and immutability by default? As for me, I enjoy seeing these features gradually introduced. For example, C# 9 records allow you to build immutable structures but the language isn’t imposing this on you for all your objects. You need to opt in.A more nuanced question to ask is will C#’s functional concepts ever overpower the language and tilt the scales in FP’s direction? Soon, I’ll be interviewing Phillip Carter (the PM for F# at Microsoft) and am curious to hear what he has to say about it. Any questions? Let me know soon and I’ll be sure to include them.The .NET Foundation nominees are outThis week, the .NET Foundation announced the Board of Director nominees for the 2020 campaign. I am familiar with most of these folks (a few are subscribers, hi!)—it’s a very strong list and you probably can’t go wrong with anyone. I’d encourage you to look at the list and all their profiles to see who you’d like to vote for (if you are a member). If not, you can apply for membership. Or, if you’re just following the progress of the foundation, that’s great too.I know I’ve talked a lot about the Foundation lately, but this is an important moment for the .NET Foundation. The luster has worn off and it’s time to address the big questions what exactly is the Foundation responsible for? Where is the line between “independence” and Microsoft interests? When OSS projects collide with Microsoft interests, what is the process to work through it? And will the Foundation commit itself to open communication and greater transparency?As for me, these are the big questions I hope the nominees are thinking about, among other things.Dev Discussions Michael CrumpIf you’ve worked on Azure, you’ve likely come across Michael Crump’s work. He started Azure Tips and Tricks, a collection of tips, videos, and talks—if it’s Azure, it’s probably there. He also runs a popular Twitch stream where he talks about various topics.I caught up with Michael to talk about how he got to working on Azure at Microsoft, his work for the developer community, and his programming advice.My crack team of researchers tell me that you were a former Microsoft Silverlight MVP. Ah, memories. Do you miss it?Ah, yes. I was a Microsoft MVP for 4 years, I believe. I spent a lot of time working with Silverlight because, at that time, I was working in the medical field and a lot of our doctors used Macs. Since I was a C# WinForms/WPF developer, I jumped at the chance to start using those skillsets for code that would run on PCs and Macs.you walk me through your path to Microsoft, and what you do at Microsoft now?I started in Mac tech support because after graduating college, Mac tech support agents were getting paid more than PC agents (supply and demand, I guess!). Then, I was a full-time software developer for about 8 years. I worked in the medical field and created a calculator that determined what amount of vitamins our pre-mature babies should take.Well, after a while, the stress got to me and I discovered my love for teaching and started a job at Telerik as a developer advocate. Then, the opportunity came at Microsoft for a role to educate and inspire application developers. So my role today consists of developer content in many forms, and helping to set our Tier 1 event strategy for app developers.Tell us a little about Azure Tips and Tricks. What motivated you to get started, and how can people get involved?Azure Tips and Tricks was created because I’d find a thing or two about Azure, and forget how to do it again. It was originally designed as something just for me but many blog aggregators starting picking up on the posts and we decided to go big with it—from e-books, blog posts, videos, conference talks and stickers.The easiest way to contribute is by clicking on the Edit Page button at the bottom of each page. You can also go to http//source.azuredev.tips to learn more.What made you get into Twitch? What goes on in your channel?I loved the ability to actually code and have someone watch you and help you code. The interactivity aspect and seeing the same folks come back gets you hooked.The stream is broken down into three streams a weekAzure Tips and Tricks, every Wednesday at 1 PM PST (Pacific Standard Time, America)Live Interviews with Developers, every Friday at 9 AM PST (Pacific Standard Time, America)Live coding/Security Sunday streams, Sundays at 1030 AM PST (Pacific Standard Time, America)What is your one piece of programming advice?I actually published a list of my top 12 things every developer should know.My top one would probably be to learn a different programming language (other than your primary language). Simply put, it broadens your perspective and permits a deeper understanding of how a computer and programming languages work.This is only an excerpt of my talk with Michael. Read the full interview over at my website.Community roundupAn extremely busy week, full of great content!MicrosoftAnnouncementsAKS now supports confidential workloads.The Edge team announces the storage access API.Microsoft introduces the Text Analytics for Health APIs.Pratik Nadagouda talks about updates to the Git experience in Visual Studio.Eric Boyd shows off new Azure Cognitive Services capabilities.The .NET Foundation has the nominees set for the 2020 campaign.VideosThe Visual Studio Toolbox begins a series on performance profiling and continues their series on finding code in Visual Studio.The Xamarin Show discusses App Center and App Insights.Data Exposed continues their “why Azure SQL is best for devs” series.So many community standups we have the Languages & Runtime one, Entity Framework, and ASP.NET Core.Blog postsJason Freeberg continues his Zero to Hero with App Service series.Miguel Ramos dives into WinUI 3 in desktop apps.Jayme Singleton runs through the .NET virtual events in July.Leonard Lobel highlights the Azure CosmosDB change feed.Community BlogsASP.NET CoreChristian Nagel walks through local users with ASP.NET Core.Andrew Lock continues talking about adding an endpoint graph to ASP.NET Core..Thomas Ardal adds Razor runtime compilation for ASP.NET Core.Anthony Giretti exposes proto files in a lightweight gRPC service.Neel Bhatt introduces event sourcing in .NET Core.Dominick Baier talks about flexible access token validation in ASP.NET Core.The .NET Rocks podcast talks about ASP.NET Core Endpoints with Steve Smith.The ON.NET show discusses SignalR.BlazorWael Kdouh secures a Blazor WebAssembly Application With Azure Active Directory.Jon Hilton discusses Blazor validation logic on the client and the server.Marinko Spasojevic consumes a web API with Blazor WebAssembly.Matthew Jones continues writing Minesweeper for Blazor Web Assembly.Entity FrameworkKhalid Abuhakmeh talks about adding custom database functions for EF Core.Jon P. Smith discusses soft deleting data with Global Query Filters in EF Core.LanguagesDave Brock goes deep on C# 9, with records, pattern matching, and top-level programs.Ian Griffiths continues his series on C# 8 nullable references with conditional post-conditions..Khalid Abuhakmeh walks through reading from a file in C#.AzureJoseph Guadagno uses Azure Key Vault to secure Azure Functions (hi, Joe!).Visual Studio Magazine walks through Azure Machine Learning Studio Web.Damien Bowden walks through using external inputs in Azure Durable Functions.Azure Tips and Tricks has new content about Azure certifications for developers.Jason Gaylord discusses adding Azure feature flags to client applications.XamarinSimon Bisson pontificates on .NET MAUI and the future of Xamarin.Leomaris Reyes uses biometric identification in Xamarin.Forms.Kym Phillpotts creates a pizza shop in Xamarin.Forms.The Xamarin Podcast discusses Xamarin.Forms 4.7 and other topics.ToolsJetBrains introduces the .NET Guide.Jason Gaylord shows us how to create and delete branches in Visual Studio Code.Mike Larah uses custom browser configurations with Visual Studio.Muhammad Rehan Saeed shows us how to publish NuGet packages quickly.Patrick Smacchia talks about his top 10 Visual Studio refactoring tips.Bruce Cottman asks if GitHub Actions will kill off Jenkins.ProjectsOren Eini releases CosmosDB Profiler 1.0.Manuel Grundner introduces his new Tasty project, an effort to bring the style of his favorite test frameworks to .NET.Community podcasts and videosScott Hanselman shows off his Raspberry Pi and shows off how you can run .NET Notebooks and .NET Interactive on it, talks about Git pull requests, shows off Git 101 basics, and walks through setting up a prompt with Git, Windows Terminal, PowerShell, and Cascadia Code.The ASP.NET Monsters talk about NodaTime and API controllers.The 6-Figure Developer podcast talks about AI with Matthew Renze.The No Dogma podcast talks with Bill Wagner about .NET 5 and unifying .NET.The Coding Blocks podcast studies The DevOps Handbook.New subscribers and feedbackHas this email been forwarded to you? Welcome! I’d love for you to subscribe and join the community. I promise to guard your email address with my life.I would love to hear any feedback you have for The .NET Stacks! My goal is to make this the one-stop shop for weekly updates on developing in the .NET ecosystem, so I look forward to any feedback you can provide. You can directly reply to this email, or talk to me on Twitter as well. See you next week!


Stack Data Structure
Category: Databases

When I was reading about Stacks d ...


Views: 269 Likes: 91

Login to Continue, We will bring you back to this content 0



For peering opportunity Autonomouse System Number: AS401345 Custom Software Development at ErnesTech Email Address[email protected]