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

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 »

From AS3 to C#, Part 12: Generics Wrapup and Annotations

Most of C#’s support for generics was covered in the previous article, but today we’ll wrap it up by discussing covariance and contravariance. We’ll also talk about C#’s support for annotations and compare to what’s available in AS3.

Read the rest of this article »

From AS3 to C#, Part 11: Generic Classes, Interfaces, Methods, and Delegates

Continuing once again, today we cover an exciting new topic: generics! Have you ever wished your classes could be parameterized with a type like Vector.<Type> is? With C# generics, you can! Even better, you can parameterize your interfaces, methods, and delegates too. Read on to learn how.

Read the rest of this article »

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

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 »

From AS3 to C#, Part 9: Even More Special Functions

Last week’s article continued the discussion of special types of functions in C#’s class system, including variable numbers of arguments (“var args”), indexers, and conversion operators. Today’s article should finish up the topic of special functions. Read on to learn about the built-in support for delegates, events, and object initializers!

Read the rest of this article »

From AS3 to C#, Part 8: More Special Functions

Today we’ll continue talking about special types of functions in C#. Specifically, today’s article will cover indexers, explicit and implicit conversions, and variable numbers of arguments (“var args”).

Read the rest of this article »

From AS3 to C#, Part 7: Special Functions

Last week we discussed extension methods and virtual functions and today we’ll continue with more special kinds of C# functions. We’ll cover operator overloading, out parameters and reference parameters.

Read the rest of this article »

From AS3 to C#, Part 6: Extension Methods and Virtual Functions

Today’s article continues from the last two in discussing features of C# classes that AS3 doesn’t have. We’ll discuss extension methods and the virtual function system that trips up so many C# newcomers.

Read the rest of this article »

From AS3 to C#, Part 5: Static Classes, Destructors, and Constructor Tricks

Last week’s article mostly covered abstract classes, but this week we’ll discuss an even more abstract type of class: static classes. We’ll also explore C#’s anti-constructor, known as a destructor, and some fancy ways to construct a class. Read on and learn some more class-related features that were never available to us in AS3.

Read the rest of this article »

From AS3 to C#, Part 4: Abstract Classes and Functions

Continuing from last time, this article begins covering features of C# classes that aren’t in AS3. We’ll begin with abstract classes and functions, which AS3 required workaround code to enforce even at run-time. Today’s article shows you how to use C# to cleanly enforce these at compile-time.

Read the rest of this article »