C# generics (List<T>
) look a lot like C++ templates (list<T>
), but they’re different in many key ways. It’s a big subject, so today we’ll start by looking at some of the most common uses of templates: applying them to classes, functions, members, lambdas, and variables.
Posts Tagged variable
The vast majority of the code we write executes at runtime. Today’s article is about the other kind of code, which runs during compilation. C# has very limited support for this. In C++, especially its newer versions, most of the language features are usable at compile-time. Read on to learn how to take advantage of this!
With structs wrapped up, we can move on to other features of C++. Today we’ll take a look at namespaces. We’ll cover the basics that C# provides, but go so much further and cover a lot of advanced functionality. Read on to learn all about them!
The series continues today by picking up where we left off with pointers. We’ll discuss a popularly-used alternative in C++: references. These are quite different from the various concepts of references in C#!
Today we continue the series by introducing variables and how they’re initialized. This is another basic topic with surprising complexity for C# developers.
Today we continue the series by looking at a pair of powerful, related features in C# 7.3: ref
return values and local variables. These enable some great optimizations, so let’s look at the IL2CPP output for them to make sure it’s as good as it looks.
Many modern strongly-typed languages have introduced a way for you to not have to type a variable’s type. In C#, you can use var
instead of the actual type. In C++, you use auto
. AS3 has a similar feature with it’s “untyped” type: *
. In those other languages, var
and auto
are syntax sugar that the compiler replaces with the actual type. Will the AS3 compiler and/or Flash Player do the same for us? Today’s article finds out if it’s safe to skip the type and just use *
.
The hidden describeTypeJSON
function is faster than the XML-based describeType
function by default, but we can make it even faster. Today’s article describe just how this is done and achieves a nearly 10x speedup!
Above all others, there is one article I refer back to most: 2009’s Function Performance. It was updated for Flash Player 10.1 and 10.2, but not 10.3, 11.0, 11.1, or 11.2. Today I’m updating this article for Flash Player 11.2, adding some missing function types, and including a set of graphs to make for the ultimate function performance reference.
Using static variables and functions is slow. That was the conclusion of the previous article on statics, but the subject is actually more nuanced than that. Today we’ll explore static more in-depth and find out just why it is so slow.