We’ve been able to call methods since the very beginning, but we’ve always had to pass all the parameters. Today we’ll add support for default parameters so you can skip them sometimes. There’s a surprising amount of detail involved with this, so read on to learn some caveats of C#, .NET, and C++.
Posts Tagged int
The language’s built-in types should be trivial, but they’re not. There are a lot of little details overlooked by many programmers. Today’s article continues the series by looking at subtleties found in seemingly-obvious language features like strings and integers. Read on to learn some tricks!
When you instantiate one of your classes, how much memory does it use? Today’s article tries out a lot of combinations and counts the bytes used. The conclusion is easy to remember and will give you a solid understanding of how much memory your app is using.
Dictionary can have
int keys and that
int keys are faster than
String keys, a natural performance test follows: which class is fastest at reading from and writing to those
int keys? Is there a difference between the four
Vector classes? Today’s article performs just that test and comes up with the answers.
Pop quiz: what’s the difference between an
Object and a
Dictionary? If you said “
Dictionary can have non-
String keys”, you bought into a common myth. Today’s article shows the cases where the lowly
Object class will use non-
String keys whether you like it or not. Read on for the details.
In last week’s primer on the new domain memory (“Alchemy”) opcodes the initial test showed that they couldn’t match the performance of good old
Vector when writing out a lot of float/
Number values. Today’s article expands on that test to check the performance of writing integers and the performance of reading integers and float/
Number values. Can the domain memory opcodes redeem themselves? Read on to find out.
Strings and integers sort differently. Unfortunately, this became a problem for me during some recent experiments with Starling. It could be a problem for you too in a variety of situations. Today we’ll look at a workaround I’ve developed to solve this problem, which isn’t nearly as straightforward as you might think.
Behind the scenes
Array holds its values in two ways: a densely-packed array at the beginning and a sparsely-packed map after that. This means it can be used as a map where the keys are indexes and not take up a huge amount of wasted space.
Dictionary can also have
int keys. Which is faster? Today we’ll find out!