The series continues today with functions. These are obviously core to any programming language, but it’s not obvious how many ways they differ from functions in C#. From compile-time execution to automatic return value types, there are a lot of differences to cover today.
Posts Tagged var args
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++.
While I was working on last week’s article it became apparent that something strange was going on with the arguments keyword in AS3. Last week I showed that even after you’ve changed the parameters of a function, you can still get the original values by indexing into arguments. This implies a copy and a copy implies a slowdown. Read on to see if there really is a slowdown and, if there is, what kind of performance impact there is.