From IT Skills
Jump to: navigation, search


In computer science, an associative array, map, symbol table, or dictionary is an abstract data type composed of a collection of (key, value) pairs, such that each possible key appears at most once in the collection... dictionary problem, a classic computer science problem... two major solutions to the dictionary problem are a hash table and a search tree... directly addressed arrays, binary search trees... tree is reasonably balanced, which is to say the leaves at either end are of comparable depths... advantage is that B-trees do not need to be re-balanced as frequently

Lookup times are different in List and Dictionary... O(1) constant time complexity. The List has an O(N)


прохання всім при оголошенні змінної з ініціалізацією не вказувати явно тип а писати var. І утримуватись від оголошень змінних без одночасної ініціалізації.

тобто, замість:

string regexInvalidPathChars = "[" + Regex.Escape(wrongSymbols) + "]";

хотілось би бачити як:

var regexInvalidPathChars = "[" + Regex.Escape(wrongSymbols) + "]";

а замість

SomeClass obj = SessionLoad("bla-bla");


var obj = SessionLoad("bla-bla") as SomeClass;


.Contains(pr); // better than
.Exists(mf => string.Compare(mf, pr) == 0);


An event is just a wrapper for a multicast delegate. Adding a public event to a class is almost the same as adding a public multicast delegate field... delegate is a .NET object which points to a method that matches its specific signature.

Action is a delegate (pointer) to a method, that takes zero, one or more input parameters, but does not return anything. Func is a delegate (pointer) to a method, that takes zero, one or more input parameters, and returns a value (or reference). Predicate is a special kind of Func often used for comparisons.

lambdas are just syntactic sugar for anonymous delegates


Short-lived objects are stored in the first generation, generation 0. The longer-lived objects are pushed into the higher generations, 1 or 2. The garbage collector works more frequently in the lower generations than in the higher ones.


System.Drawing.Common is not supported on non-Windows platforms.

System.Drawing.Common only supported on Windows... Starting in .NET 6, the platform analyzer emits compile-time warnings when referencing code is compiled for non-Windows operating systems. In addition, the following run-time exception is thrown

Some types in the System.Drawing namespace rely on GDI+, which is not supported in Windows services and ASP.NET Core and ASP.NET apps... recommended alternatives include ImageSharp, SkiaSharp, Windows Imaging Components, and Microsoft.Maui.Graphics.

other C# guides[edit]

Pages in category "CSharp coding guide"

The following 7 pages are in this category, out of 7 total.