These articles cover all areas of C# and the .NET / dotnet ecosystem. Code examples, tutorials, and different frameworks galore! Dive in!
As a C# developer, understanding the different simple data types in C# and when to use them is crucial for writing efficient and maintainable code. I've been trying to spend more time this year putting together some content aimed at really introductory level programming. There's plenty of resources available online, but I want to do my part to ensure I can help break down some of the barriers for people getting started on their programming journey. In this beginner's guide, we will look at the basics of the most commonly used simple data types in C#, including int, float, double, byte, char, bool, and string. We will also look at how these data types differ from each other and when to use them in your C# programming! Integer Data Types The most commonly used integer data types in C# are…
(This article is intended to be a spiritual successor to this previous entry, and now includes Tasks!) Even if you're new to C#, you've probably come across at least one of Tasks, Threads, or BackgroundWorkers. With a bit of additional time, it's likely you've seen all three in your journey. They're all ways to run concurrent code in C# and each has its own set of pros and cons. In this article, we will explore how each one operates at a high level. It's worth noting that in most modern .NET applications and libraries you'll see things converging to Tasks. The Approach I've gone ahead and created a test application that you can find here. Because this is in source control, it's possible/likely that it will diverge from what we see in this article, so I just wanted to offer…
If you have an internet connection then you have probably heard of ChatGPT from OpenAI by now. Odds are you might have even given it a whirl to see what it's all about. Personally, I know that I was quite skeptical at first but I've been blown away at how well it's able to converse about topics I ask it. I've even asked it to generate various scenarios for me and it will conclude by explaining why the different facets it chose were good choices. Incredible stuff. I'll be using this to help chip away at content for my role playing game. When it comes to using OpenAI effectively, I have a great deal to learn. It's all very new to me, especially with respect to how to structure prompts and get the most out of the interactions with such…
Looking for a better way to make Unity3D user interfaces? Love WPF/XAML but not the Unity UI Framework? You probably aren't using Noesis GUI, but you should be!
I love dependency injection frameworks ever since I started using them. Specifically, I'm obsessed with using Autofac and I have a hard time developing applications unless I can use a solid DI framework like Autofac! I've recently been working with Xamarin and found that I wanted to use dependency injection, but some of the framework doesn't support this well out of the box. I' was adamant to get something going though, so I wanted to show you my way to make this work. Disclaimer: In its current state, this is certainly a bit of a hack. I'll explain why I've taken this approach though! In your Android projects for Xamarin, any class that inherits from Activity is responsible for being created by the framework. This means where we'd usually have the luxury of passing in dependencies via a constructor and…
xUnit tests not running with .NET standard project settings? Here's a super quick solution to get you back up and running so you can test away!
Organizing code into Autofac modules can make maintaining code much easier and improve extensibility! It all starts with the Autofac module class. Check it out!
Why Consider Using Autofac With Unity3D? I think using a dependency injection framework is really valuable when you're building a complex application, and in my opinion, a game built in Unity is a great example of this. Using Autofac with Unity3D doesn't need to be a special case. I wrote a primer for using Autofac, and in it I discuss reasons why it's valuable and some of the reasons you'd consider switching to using a dependency container framework. Now it doesn't need to be Autofac, but I love the API and the usability, so that's my weapon of choice. Building a game can result in many complex systems working together. Not only that, if you intend to build many games it's a great opportunity to refactor code into different libraries for re-usability. If we're practicing writing good code using constructor…
Looking to get started using dependency injection with Autofac in your projects? Here's a quick primer on what it is and how to get going for your next project.
Should Every Class Have an Interface? This is part two in the sub-series of "Should Every Class Have an Interface?", and part of the bigger "What Makes Good Code?" series. Other Peoples' Code So in the last post, we made sure we could get an interface for every class we made. Okay, well that's all fine and dandy (I say half sarcastically). But you and I are smart programmers, so we like to re-use other peoples' code in our own projects. But wait just a second! It looks like Joe Shmoe didn't use interfaces in his API that he created! We refuse to pollute our beautiful interface-rich code with his! What can we do about it? Wrap it. That's right! If we add a little bit of code we can get all the benefits as the example we walked through originally. It's…