Showing results for C# - Developer Support

Oct 16, 2017
0
0

Dissecting the pattern matching in C# 7

Sergey Tepliakov
Sergey Tepliakov

C# 7 finally introduced a long-awaited feature called "pattern matching". If you're familiar with functional languages like F# you may be slightly disappointed with this feature in its current state, but even today it can simplify your code in a variety of different scenarios. Every new feature is fraught with danger for a developer working on a...

seteplia
Oct 3, 2017
1
2

Dissecting the local functions in C# 7

Sergey Tepliakov
Sergey Tepliakov

The Local functions is a new feature in C# 7 that allows defining a function inside another function. When to use a local function? The main idea of local functions is very similar to anonymous methods: in some cases creating a named function is too expensive in terms of cognitive load on a reader. Sometimes the functionality is inherently local ...

seteplia
Feb 21, 2017
0
0

A common execution path optimization

Sergey Tepliakov
Sergey Tepliakov

Today I want to talk about one interesting optimization pattern that you may face in framework code or in high-performance libraries. The idea is simple: suppose you have a commonly used method that has two execution paths – one is very common and simple, and the second one takes longer to execute, has more steps but happens not that often...

seteplia
Feb 1, 2017
0
0

Dissecting the new() constraint in C#: a perfect example of a leaky abstraction

Sergey Tepliakov
Sergey Tepliakov

Most likely you’ve heard about The Law of Leaky Abstractions coined by Joel Spolsky. Even if you never heard of it, you definitely faced it in your day-to-day job. The “law” is pretty simple: “All non-trivial abstractions, to some degree, are leaky”. And this is 100% true. But sometimes even not that complicated abstractions can leak ...

seteplia