Post

Avatar
1/One other Dotnet feature I want to highlight is Language Integrated Query, aka LINQ - learn.microsoft.com/en-us/dotnet.... LINQ is an amazing tool for #developers. The beauty is that you can query just about any type of collection - including the DB - using the same syntax.
1/Venturing back into #developer territory, I had a thought about experience in relation to programming. I'm rewriting an app I began developing in '08 that's expanded over the years as the business changed. I've been a solo dev for the duration so all the good ideas - and mistakes - are all mine.
Language Integrated Query (LINQ) - C#learn.microsoft.com Introduces Language Integrated Query (LINQ) in C#.
Avatar
2/Combined with the power of Dotnet collections, it's changed how I code in C#. In very complex or DB-intensive functions, I now look at what data I'll need from the DB for the entirety of the function (obviously excluding conditionally-retrieved data) and grab it all at the beginning.
Avatar
3/Later in the function when I'm looping or operating on a subset of the data from the DB, I'm working strictly with in-memory data. It was truly shocking how much faster some of my functions became! Most of these functions worked just fine when we only had a few 00's of records to retrieve.
Avatar
4/But after 14 years of data growth (~250k Purchase Orders and ~2 mil. Items), performance was awful. Another lesson taught by experience - it's nearly impossible to gauge the impact of coding decisions early on unless you have experience doing this, gained via painful hours spent with SQL profiler.
Avatar
5/Another ex. - I didn't realize that by not calling one of the "To" functions and creating the collection during the DB call, your data is lazy loaded, only pulling records from the DB (one by one!) as they're operated on. In certain transactions, I was making 1500+ round trips to the DB!
Avatar
6/One more ex. - I also didn't realize that C# will create generic objects for you when needed, by declaring type "var", selecting only the columns you need from the DB, and then calling ToList(). I can't overstate how powerful this is as a #developer.
Avatar
7/And what about the users? When I fixed Item handling in our system, I had a user come to me nearly in tears thanking me. The PO she was working on went from 1.5 minutes(!!) to load, to 375 msec. Of course I didn't tell her it was my crappy code that created the problem in the first place 😏
Avatar
We are using the new Metaplay SDK for a mobile game, built on akka.net using C# for Unity compatibility for the client. The entities on the server work so that their data is loaded to memory from a binary blob in the DB. Works well for games where there’s simple data but lot of users. metaplay.io
Custom Game Backend for Live Service Unity C# Mobile Games - Metaplaymetaplay.io Build and operate Unity games at scale, featuring a liveops platform, game economy pipelines, scalable cloud servers, game programming tools, and more.
Avatar
I think people tend to overlook C# because of prejudices against M$, but C# gives you everything from direct mem access to single-LoC web APIs. Plus the fact that Dotnet is open source has led to a robust ecosystem around it. Unlike some of the other M$ tech, Dotnet isn't going away.
Avatar
I've never really done game dev myself, but that Metaplay SDK looks cool. I think there's potentially a huge market to implement 3rd party libs/SDKs for the Dotnet world. Also, with the availability of Azure/Dev Box, I think there's a market for cloud solutions too. 🤔