On show #38 of Rockin’ the Code World with dotNetDave, I am ranting about far too many .NET software engineers DO NOT understand how memory management works when it comes to disposable objects! No matter what level of software engineer you are, you need to watch this episode… NOW!
Watch and let me know your comments below or Tweet them to @RockinCodeWorld or @realDotNetDave.
Call to Action
Here are my call to action for this episode. Watch for a full description!
-
The .NET Compiler & Runtime teams must figure out how to take the developer out of the equation and fast!
-
If not then…
-
Visual Studio Analyzers and other tools must find 100% of these issues!
-
Visual Studio should color (red?) variables that hold IDisposable types!
-
Visual Studio and the compliers must prevent code like this:
return (TResult)xs.Deserialize(new StringReader(xml));
-
Please let me know your thoughts by making a comment below.
Start off learning how to deal with Disposable types properly by going to this article: https://dotnettips.wordpress.com/2021/10/15/everything-that-every-net-developer-needs-to-know-about-disposable-types-part-1-properly-disposing-objects/
No arguments here, Dave. I’ve made a good living fixing the coding problems created by the engineering team, and this is certainly one of my peeves. The other big one is time zones and DST. Too many developers just don’t know how to manage this gracefully, and until humankind stops doing nonsense like DST, we’re still going to have the ‘null/duplicate’ issue for scheduled processes that occur in the ‘magic DST’ hour. Don’t even get me started on ‘Object reference not set to an instance…’ oy! You would think we’d be past this by now, right?
I’m in presales today after nearly 30 years, so I don’t much worry about coding anymore though I do miss it. Thanks for all you do!
Please Add links of the article here in this post as well
hey David, great article, do you think that implicit namespaces on net 6 will reduce the ammount of performance’s issues on newer system’s?
Yes, but not much really. Just makes it easier to me.
I don’t think by much. In the past, I have tested this and while there is a slight performance increase, not sure if it would add up to much.