Posts Tagged struct

Better CPU Caching with Structs

Tags: , , , ,

While little utilized, C#’s struct type can come in really handy sometimes. Today’s article shows how to use it to get a lot more mileage out of modern CPUs’ caches to really boost your app’s performance. Read on for some quick tips!

Read the rest of this article »

5 Comments

Adding Unions to C#

Tags: ,

C and C++ have a great feature call the “union”. It’s like a struct except it only has one of the fields at a time. C# lacks this feature, but with some trickery it can be added in. Today’s article shows how to do that!

Read the rest of this article »

6 Comments

Using Structs to Avoid Creating Garbage

Tags: , , ,

It’s easy to forget about struct in C#. After all, it’s not available in other languages like Java or AS3 and it seems to have fewer features than good old class. But struct can really help you out when it comes to garbage creation! Today’s article discusses some strategies to get the most out of struct. Read on to learn how to use structs to put a stop to that pesky garbage collector!

Read the rest of this article »

8 Comments

From AS3 to C#, Part 13: Where Everything Goes

Tags: , , , ,

Today we continue the series by wrapping up C#’s class/interface/struct/enum system with a discussion of where to put them all. We’ll focus on package/namespace, organizing types into files, and some details of using/import.

Read the rest of this article »

2 Comments

From AS3 to C#, Part 10: Alternatives to Classes

Tags: ,

Now that we’ve finished discussing special functions, we can move on to two alternatives to classes: structures and enumerations. These are commonly called structs and enums as most languages use those keywords, including C#. Of course we’ll talk about how to mimic these in AS3, too. Read on to learn about these two important types of data structures available in C#!

Read the rest of this article »

10 Comments