Given reasons indicating why following identifiers are invalid,
1)goto
2)Struct
3)true
4)2k
goto - Blaming it for being encoded becomes unreadable, poorly optimized and bugs may appear.
struct - First, the use of structures beats both performance and memory. Each call is a copy, any array of structures is almost guaranteed to fall into the Large Object Heap, which will once again hit both performance (due to increased GC time) and memory (a fragmented heap is very bad).
class Program
{
static void Main(string[] args)
{
Foo[] f = new[] {new Foo {Field = 5}};
for (int i = 0; i < f.Length; i++)
{
Foo foo = f[i];
foo.Field = 10;
Console.WriteLine(foo.Field);
}
Console.WriteLine(f[0].Field);
}
}
struct Foo
{
public int Field;
}
* This source code was highlighted with Source Code Highlighter.
Second, the use of structures is error prone. For example:
Comments
Leave a comment