Recently, we’ve discussed the adverse effects that boxing and unboxing can have on the performance of your application. Furthermore, during episode two, we mentioned the unintentional use of boxing when using interfaces and how using generic interfaces instead can help. [Read more…]
I could start by telling you that wrapping a value type in an Object is boxing. There, we’re done right? I mean, you now know what that means, yeah?! So, you could probably then deduce that unboxing would be taking that variable back out of the object?! SIMPLE! Cool…so then…why do we care? Good question. Let’s see if we can go ahead and answer that! [Read more…]
This episode is all about boxing and unboxing. We discuss memory management, the pros (yes, there are a few!) and cons of boxing/unboxing, some of the weird side effects and how to you can avoid it with generics and ToString methods.
Thanks for listening! [Read more…]
Unlike Java, C# has a unified type system. Both reference types AND values inherit from system.object which means that you can have a method that takes in both value and reference types by their common parent, System.Object.
These methods are really convenient, but unfortunately boxing occurs when you pass in value types.
However, we’ve come across a nice trick for skipping those operations. [Read more…]
You might have had the anti boxing and unboxing rhetoric pounded into your head.
In the .NET world they’re often mentioned as an unfortunate side-effect of backwards compatibility. A reminder of life before generics…
…before Linq. *shudder*
Let’s take a look at 7 of the reasons why programmers beat up on boxing. [Read more…]