Posts Tagged variable

C++ For C# Developers: Part 25 – Intro to Templates

Tags: , , , ,

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.

Read the rest of this article »

2 Comments

C++ For C# Developers: Part 23 – Compile-Time Programming

Tags: , , , , , ,

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!

Read the rest of this article »

5 Comments

C++ For C# Developers: Part 17 – Namespaces

Tags: , , , ,

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!

Read the rest of this article »

4 Comments

C++ For C# Developers: Part 8 – References

Tags: , , , ,

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#!

Read the rest of this article »

7 Comments

C++ For C# Developers: Part 3 – Variables and Initialization

Tags: , , , ,

Today we continue the series by introducing variables and how they’re initialized. This is another basic topic with surprising complexity for C# developers.

Read the rest of this article »

5 Comments

IL2CPP Output for C# 7.3: ref Return Values and Local Variables

Tags: , , , ,

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.

Read the rest of this article »

No Comments

Should You Bother Giving Variables a Type?

Tags: , , ,

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 *.

Read the rest of this article »

7 Comments

Making describeTypeJSON 50x Faster than describeType

Tags: , , , , , , , , , , ,

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!

Read the rest of this article »

1 Comment

Function Performance Update

Tags: , , , , , , , ,

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.

Read the rest of this article »

4 Comments

Why Static Is Slow

Tags: , , , , ,

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.

Read the rest of this article »

26 Comments