The pitfalls of C#
If you've ever heard me talk about programming in any regard, you'll likely be aware that I simp for C#. I have never met any other language that lets me develop at the speed I'm able to. It is hands down my favourite language and I will challenge anyone who tries to change my mind.
But that doesn't mean it's perfect. C#, much like every other language, has its drawbacks. I'm going to talk about some of the features that I've stumbled across in other languages that accomplish some goal better than C#.
MonoBehaviours DO support constructors
Quite often, I come across people who are under the impression that a class which inherits MonoBehaviour cannot or should not define a constructor. If you are one of those people then buckle up. I'm going to dispel this myth once and for all.
You're exposing state badly
Every now and then - okay… pretty much every day - I encounter someone who has decided to publicly expose state with fields, and it hurts my core.
Let's talk about that.
Unity lies to you about null
What is the difference between component == null, component is null, and !component?
How I recreated Unity's coroutine system
Early last year, I wrote a blog post which explained how Unity's coroutines work. In my conclusion, I expressed that I underestimated the level of wizardry they involved, so much so that it went far beyond the scope of the article. I figured it was time to perhaps elaborate on that, and show you a glimpse of Unity's game loop and how the coroutine system works in the engine (at least, my interpretation of it.)