Paweł Łukaszuk
Tips, tricks and quirks in .NET
#1about 2 minutes
The surprising internal structure of generic lists
The generic `List<T>` in .NET is not a linked list but is implemented as a resizable array, which has important performance implications.
#2about 4 minutes
Comparing the performance of for and foreach loops
While `for` loops were historically faster, optimizations in .NET 7 have made `foreach` performance nearly identical due to reduced enumerator overhead.
#3about 4 minutes
Why `Where().Count()` is faster than `Count(predicate)`
Using `Count()` with a predicate is significantly slower than chaining `Where()` and `Count()` because it results in a virtual method call instead of an instance method call.
#4about 4 minutes
When not to use `StringBuilder` for concatenation
`StringBuilder` is not always the fastest option for joining strings; for a small number of short strings, simple concatenation with `+` can be more performant due to `StringBuilder`'s resizing overhead.
#5about 3 minutes
The difference between `string.Empty` and an empty literal
Despite generating different IL code, `string.Empty` and the `""` literal compile to identical assembly instructions and have the same performance, with the only difference being compile-time usage constraints.
#6about 5 minutes
Safer null checking and the risk of operator overloading
Using the `==` operator for null checks is unsafe because it can be overloaded; the `is null` pattern should be used instead to avoid unexpected behavior.
#7about 4 minutes
How to terminate an application instantly
The `Environment.FailFast` method immediately terminates an application without executing `catch` or `finally` blocks, making it a drastic way to handle catastrophic failures.
#8about 4 minutes
Understanding the default banker's rounding in .NET
The `Math.Round` method in .NET uses banker's rounding by default, which rounds values ending in .5 to the nearest even integer, a behavior that can be surprising.
Related jobs
Jobs that call for the skills explored in this talk.
Matching moments
01:57 MIN
Presenting live web scraping demos at a developer conference
Tech with Tim at WeAreDevelopers World Congress 2024
Unlock Moments
Create a free account to watch a limited number of Moments each month.
Upgrade to PRO for unlimited access to the full archive.
Upgrade to PRO for unlimited access to the full archive.
You have an account? Log in
04:23 MIN
Q&A on performance, interfaces, and advanced learning
Where we're going we don't need JavaScript - Programming with Type Annotations
Unlock Moments
Create a free account to watch a limited number of Moments each month.
Upgrade to PRO for unlimited access to the full archive.
Upgrade to PRO for unlimited access to the full archive.
You have an account? Log in
03:33 MIN
Q&A on performance, tooling, and alternatives
Discover .NET MAUI
Unlock Moments
Create a free account to watch a limited number of Moments each month.
Upgrade to PRO for unlimited access to the full archive.
Upgrade to PRO for unlimited access to the full archive.
You have an account? Log in
07:45 MIN
Q&A on production code analysis and performance bottlenecks
Data Science on Software Data
Unlock Moments
Create a free account to watch a limited number of Moments each month.
Upgrade to PRO for unlimited access to the full archive.
Upgrade to PRO for unlimited access to the full archive.
You have an account? Log in
16:37 MIN
Q&A on developer tooling and testing best practices
Data Mining Accessibility
Unlock Moments
Create a free account to watch a limited number of Moments each month.
Upgrade to PRO for unlimited access to the full archive.
Upgrade to PRO for unlimited access to the full archive.
You have an account? Log in
02:35 MIN
Overview of modern C# community-loved features
Modern C#: A Dive into the Community's Most Loved new Features.
Unlock Moments
Create a free account to watch a limited number of Moments each month.
Upgrade to PRO for unlimited access to the full archive.
Upgrade to PRO for unlimited access to the full archive.
You have an account? Log in
13:10 MIN
Q&A on Blazor development and the speaker's journey
Blazing Accessibility Basics
Unlock Moments
Create a free account to watch a limited number of Moments each month.
Upgrade to PRO for unlimited access to the full archive.
Upgrade to PRO for unlimited access to the full archive.
You have an account? Log in
02:13 MIN
Introduction to five key features in C# 10
5 features that help you get the most out of C# 10
Unlock Moments
Create a free account to watch a limited number of Moments each month.
Upgrade to PRO for unlimited access to the full archive.
Upgrade to PRO for unlimited access to the full archive.
You have an account? Log in
Featured Partners
Related Videos
Hacking C# from the inside - how to do anything in NET
Adam Furmanek
Exploring the Latest Features of .NET and C# by Building a Game
Rainer Stropek
C# 13 Unleashed: Live Demos of my Top 10 Cutting-Edge Features!
Ambesh Singh & Sachin Kumar
Why you must use TDD now!
Alex Banul
Turbocharged: Writing High-Performance C# and .NET Code
Steve Gordon
5 features that help you get the most out of C# 10
Louëlla Creemers
Asynchronicity and multithreading in C#
Grzegorz Lang
Building a Compiler with C#
Florian Rappl
Related Articles
View all articles


.webp?w=240&auto=compress,format)
From learning to earning
Jobs that call for the skills explored in this talk.


RZL Software GmbH
€54K
Entity Framework
Dependency Injection
Software Architecture






