Posts Tagged default

C++ For C# Developers: Part 4 – Functions

Tags: , , , , ,

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.

Read the rest of this article »

10 Comments

IL2CPP Output for C# 7.3: Everything Else

Tags: , , , , ,

Today we conclude the series by looking at all the remaining features in C# 7.3 that we get access to in Unity 2018.3. Read on to learn about new kinds of structs, in parameters, new where constraints, discards, default literals, generalized async returns, and new preprocessor symbols!

Read the rest of this article »

3 Comments

The Effects of Useless Code

Tags: , , , ,

There are a lot of ways to write C# code that has no effect. One common way is to initialize class fields to their default values: public int Value = 0;. Today we’ll go over five types of useless code and see what effect it has on the actual machine code that the CPU executes. Do IL2CPP and the C++ compiler always do the right thing? Let’s find out!

Read the rest of this article »

No Comments

C++ Scripting: Part 24 – Default Parameters

Tags: , , , , ,

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

Read the rest of this article »

No Comments

Redundant Code

Tags: , , ,

Why do I see so many AS3 programmers writing so much redundant code? Are you one of them? Today’s tips may save you a lot of typing. It may even save you a lot of SWF size.

Read the rest of this article »

20 Comments

Default Arguments

Tags: , , , , ,

I’ve talked about var args, the arguments keyword, and even the length of a function that has default arguments, but I’ve never written an article all about default arguments… until today.

Read the rest of this article »

11 Comments

Function Length

Tags: , , , , , ,

In my last article on getProperties, there was one strange finding in the tests of standard classes: the Function class seems to have a length field. What is it? Today we’ll see

Read the rest of this article »

4 Comments