
ALT A programming image titled "C#: Math methods that work for ANY numeric type with Generic Math & INumber<T>". It contrasts two ways of writing a `Sum` method. The "Before" section, marked with a red X, shows three separate `Sum` methods for `int`, `double`, and `decimal` types. Each method takes an `IEnumerable` of the respective type and uses `numbers.Aggregate((a, b) => a + b)`. The "After" section, marked with a green checkmark, presents a single, generic `static T Sum<T>(IEnumerable<T> numbers) where T : INumber<T>` method that achieves the same functionality for any numeric type, demonstrating code simplification. A "Quick Tricks Dev" logo is at the bottom right.

ALT A C# coding trick demonstrating how to use .NET 8's TimeProvider abstraction to avoid hardcoding time. The image displays a code snippet with three sections: First, an `OrderService` class injecting `TimeProvider time` in its constructor, using `time.GetUtcNow()` to check if an order is expired. A green text box explains: "Inject `TimeProvider` for testable, controlled time." Second, a test example shows `var fakeTime = new FakeTimeProvider();` and `fakeTime.SetUtcNow(new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero));` to create a service with controlled time. A blue text box states: "`FakeTimeProvider` allows precise time manipulation in tests." Third, a production example shows `services.AddSingleton(TimeProvider.System);` for dependency injection. A blue text box explains: "Register `TimeProvider.System` for production real-time." The title at the top reads "Stop hardcoding time in C# with .NET 8's TimeProvider abstraction", accompanied by a red stop sign icon. The bottom left

ALT A slide titled "Extension everything with C# 14!" displays C# code demonstrating new extension features. The code defines a `static class StringExtensions` with `extension (string target)`. An arrow points from this line to a text box stating, "Use target once for whole block, no more "this" parameter in each extension method". Inside the extension block, there's a `void PrintInfo()` method that writes the string's length, uppercase, and lowercase versions to the console. Below this method, an `int WordCount => target.Split(' ').Length;` extension property is defined. An arrow points from this property to a text box saying, "Now apart from methods you can extend types with additional properties!". The bottom right corner features the "QUICK TRICKS DEV" logo.

ALT A C# code example on a dark background demonstrating raw string literals interpolation. The title reads "C#: No more escape sequences! with raw string literals interpolation!" alongside a lightbulb icon. The code snippet shows `var numberToInterpolate = 10;` and `var jsonString` defined using a multi-line `$$"""` raw string literal. The JSON content includes properties for 'name', 'version', and 'features'. Features lists 'Multi-line support', 'No \\"escaping\\" 'quotes'', and 'Interpolation support: {{numberToInterpolate}}'. It also shows 'examplePath': 'C:\\\\Program Files\\\\MyApp'. Blue annotations explain: "The more $ signs you use the more braces are needed to interpolate the value" (referring to `$$"""`) and "Because we used double $$ sign the json object braces are escaped" (referring to the literal JSON curly braces). A "QUICK TRICKS DEV" logo is at the bottom right. The background is a dark abstract design with red and blue light.
![A coding tutorial slide titled ".NET Initialize like a boss using collection expressions" against a blue and purple gradient background. The main content is a dark purple rectangle showcasing C# code snippets. The top section, labeled "Collection initialization from C# 12 (.NET 8) 👍", demonstrates initializing `productsOnSale`, `sponsoredProducts`, and `allProducts` string arrays using concise collection expressions, including spreading existing arrays. The bottom section, labeled "And before 😐", shows the equivalent but more verbose initialization using `new[]`, `.Concat()`, `.Append()`, and `.ToArray()` methods. The slide contrasts the modern C# 12 syntax with previous versions for collection initialization. The bottom right corner features "QUICK TRICKS DEV" branding.](https://pbs.twimg.com/media/HG-r3kRXkAAdV_-.jpg?name=small&format=webp)
ALT A coding tutorial slide titled ".NET Initialize like a boss using collection expressions" against a blue and purple gradient background. The main content is a dark purple rectangle showcasing C# code snippets. The top section, labeled "Collection initialization from C# 12 (.NET 8) 👍", demonstrates initializing `productsOnSale`, `sponsoredProducts`, and `allProducts` string arrays using concise collection expressions, including spreading existing arrays. The bottom section, labeled "And before 😐", shows the equivalent but more verbose initialization using `new[]`, `.Concat()`, `.Append()`, and `.ToArray()` methods. The slide contrasts the modern C# 12 syntax with previous versions for collection initialization. The bottom right corner features "QUICK TRICKS DEV" branding.
![A visual explaining C#'s CallerArgumentExpression attribute. The title is "C#: Capture argument expressions as strings using CallerArgumentExpression attribute". A code snippet shows a `NotNull<T>` method with parameters `T value` and `string? expr = null`. The `expr` parameter has `[CallerArgumentExpression(nameof(value))]`, making the compiler automatically fill it with the string form of the `value`'s expression from the call site. The method throws `ArgumentNullException(expr)` if `value` is null. Example calls illustrate this: `NotNull(user)` results in `expr = "user"`, `NotNull(user.Profile)` makes `expr = "user.Profile"`, and `NotNull(GetConfig())` yields `expr = "GetConfig()"`. Annotations explain the compiler's automatic filling and that exceptions provide the exact expression used. "QUICK TRICKS DEV" is at the bottom right.](https://pbs.twimg.com/media/HF2YfuuXwAAWWgi.jpg?name=small&format=webp)
ALT A visual explaining C#'s CallerArgumentExpression attribute. The title is "C#: Capture argument expressions as strings using CallerArgumentExpression attribute". A code snippet shows a `NotNull<T>` method with parameters `T value` and `string? expr = null`. The `expr` parameter has `[CallerArgumentExpression(nameof(value))]`, making the compiler automatically fill it with the string form of the `value`'s expression from the call site. The method throws `ArgumentNullException(expr)` if `value` is null. Example calls illustrate this: `NotNull(user)` results in `expr = "user"`, `NotNull(user.Profile)` makes `expr = "user.Profile"`, and `NotNull(GetConfig())` yields `expr = "GetConfig()"`. Annotations explain the compiler's automatic filling and that exceptions provide the exact expression used. "QUICK TRICKS DEV" is at the bottom right.

ALT A coding trick demonstrating C# null checks. Title: "C#: Cleaner null checks with 'is not null'!" The image displays two code examples. The "Traditional way" uses `if (obj != null)` to check for non-null objects, followed by a `Console.WriteLine` statement. The "Modern C# 'is not null' pattern" uses `if (obj is not null)` for the same check, also followed by a `Console.WriteLine`. Below the code, a text explanation states: "'is not null' is safer and more semantically precise. It always checks for reference nullity, while != null can be intercepted by operator overloading." The code is on a dark purple gradient background, and the explanation is on a light green background.
![The image illustrates a C# coding concept with a title "🚀 BOOST C# Interfaces! Add new methods, no breaking changes!". Below the title is a code editor showing a C# interface `ILogger`. The interface contains two methods: `void LogMessage(string message);` and `void LogWarning(string warning) { Console.WriteLine($"[DEFAULT] WARNING: {warning}"); }`. A dark blue callout points to `LogMessage`, stating "Traditional interface methods must be implemented by classes." A green callout points to the `LogWarning` method with its implementation, stating "C# 8+ allows default implementations directly in interfaces." The image explains how to add new methods to C# interfaces without breaking existing implementations using default interface methods introduced in C# 8+.](https://pbs.twimg.com/media/HEo1xYKaMAAMbI6.jpg?name=small&format=webp)
ALT The image illustrates a C# coding concept with a title "🚀 BOOST C# Interfaces! Add new methods, no breaking changes!". Below the title is a code editor showing a C# interface `ILogger`. The interface contains two methods: `void LogMessage(string message);` and `void LogWarning(string warning) { Console.WriteLine($"[DEFAULT] WARNING: {warning}"); }`. A dark blue callout points to `LogMessage`, stating "Traditional interface methods must be implemented by classes." A green callout points to the `LogWarning` method with its implementation, stating "C# 8+ allows default implementations directly in interfaces." The image explains how to add new methods to C# interfaces without breaking existing implementations using default interface methods introduced in C# 8+.

ALT A code example demonstrating JavaScript Proxies, titled "Intercept like a Ninja JavaScript Proxies in Action!", with a ninja emoji. The image displays a code snippet that defines a `target` object with two messages, a `handler` object with a `get` method that logs the accessed property name, and then creates a `proxy` using `new Proxy(target, handler)`. Explanatory text boxes clarify each part: the `target` is the object to be proxied, the `handler` defines custom behavior, and the `get` trap intercepts property read operations for logging. The final lines of code show `console.log(proxy.message1)` and `console.log(proxy.message2)`, with a note that these property accesses now trigger the custom `get` trap, demonstrating how proxies allow custom logic on property access. The bottom right features "QUICK TRICKS DEV".

ALT A C# coding trick titled "C#: Ditch manual foreach loops! Master sequence generation with Range()" with a sparkle emoji. Below, a dark-themed code snippet demonstrates `Enumerable.Range()`. Line 2: `var sequence1 = Enumerable.Range(1, 5);` (generates numbers from 1 to 5). Line 5: `var sequence2 = Enumerable.Range(10, 3);` (generates numbers from 10 to 12 inclusive). Lines 8-11 show direct usage in a loop: `foreach (int i in Enumerable.Range(0, 3)) { Console.Write(i + " "); }` (prints 0 1 2).
![The image titled "Improve your C# loops with Index() method!" displays a C# code snippet demonstrating how to enumerate collections with both item and index. It initializes a string array `data` with "apple", "banana", "cherry". The first `foreach` loop, `foreach (var (item, idx) in data.Index())`, iterates through the array and prints `[{idx}] {item}` to the console, showing zero-based indexing. An annotation next to this loop explains, "Enumerate collections with both item and index." The second `foreach` loop, `foreach (var (item, idx) in data.Index(startIndex: 1))`, uses a `startIndex` parameter of 1. It also prints `[{idx}] {item}` to the console, demonstrating custom indexing starting from 1. An arrow points to this parameter with the text, "Use 'startIndex' for 1-based or custom indexing." The bottom left features the "QUICK TRICKS DEV" logo.](https://pbs.twimg.com/media/HC9TBuYW4AALBm-.jpg?name=small&format=webp)
ALT The image titled "Improve your C# loops with Index() method!" displays a C# code snippet demonstrating how to enumerate collections with both item and index. It initializes a string array `data` with "apple", "banana", "cherry". The first `foreach` loop, `foreach (var (item, idx) in data.Index())`, iterates through the array and prints `[{idx}] {item}` to the console, showing zero-based indexing. An annotation next to this loop explains, "Enumerate collections with both item and index." The second `foreach` loop, `foreach (var (item, idx) in data.Index(startIndex: 1))`, uses a `startIndex` parameter of 1. It also prints `[{idx}] {item}` to the console, demonstrating custom indexing starting from 1. An arrow points to this parameter with the text, "Use 'startIndex' for 1-based or custom indexing." The bottom left features the "QUICK TRICKS DEV" logo.
![A C# code snippet demonstrating how to use LINQ's `Chunk(n)` method for batching. The title reads: "C#: Stop creating batching loops! Unlock LINQ's Chunk(n) for elegant splits". The code initializes a list of numbers from 1 to 10 using `Enumerable.Range(1, 10)`, sets `batchSize` to 3, then uses a `foreach` loop with `numbers.Chunk(batchSize)` to iterate through and print each chunk. An annotation explains `Enumerable.Range` creates a sequence of integers. Another annotation states `Chunk()` divides sequences into fixed-size groups. The output shows the numbers batched into lists of three: `[1, 2, 3]`, `[4, 5, 6]`, `[7, 8, 9]`, and `[10]`.](https://pbs.twimg.com/media/HC9SWUPXsAEQ3HA.jpg?name=small&format=webp)
ALT A C# code snippet demonstrating how to use LINQ's `Chunk(n)` method for batching. The title reads: "C#: Stop creating batching loops! Unlock LINQ's Chunk(n) for elegant splits". The code initializes a list of numbers from 1 to 10 using `Enumerable.Range(1, 10)`, sets `batchSize` to 3, then uses a `foreach` loop with `numbers.Chunk(batchSize)` to iterate through and print each chunk. An annotation explains `Enumerable.Range` creates a sequence of integers. Another annotation states `Chunk()` divides sequences into fixed-size groups. The output shows the numbers batched into lists of three: `[1, 2, 3]`, `[4, 5, 6]`, `[7, 8, 9]`, and `[10]`.
![A coding tutorial slide titled ".NET Initialize like a boss using collection expressions" against a blue and purple gradient background. The main content is a dark purple rectangle showcasing C# code snippets. The top section, labeled "Collection initialization from C# 12 (.NET 8) 👍", demonstrates initializing `productsOnSale`, `sponsoredProducts`, and `allProducts` string arrays using concise collection expressions, including spreading existing arrays. The bottom section, labeled "And before 😐", shows the equivalent but more verbose initialization using `new[]`, `.Concat()`, `.Append()`, and `.ToArray()` methods. The slide contrasts the modern C# 12 syntax with previous versions for collection initialization. The bottom right corner features "QUICK TRICKS DEV" branding.](https://pbs.twimg.com/media/HCjhg1rXsAAVWqn.jpg?name=small&format=webp)
ALT A coding tutorial slide titled ".NET Initialize like a boss using collection expressions" against a blue and purple gradient background. The main content is a dark purple rectangle showcasing C# code snippets. The top section, labeled "Collection initialization from C# 12 (.NET 8) 👍", demonstrates initializing `productsOnSale`, `sponsoredProducts`, and `allProducts` string arrays using concise collection expressions, including spreading existing arrays. The bottom section, labeled "And before 😐", shows the equivalent but more verbose initialization using `new[]`, `.Concat()`, `.Append()`, and `.ToArray()` methods. The slide contrasts the modern C# 12 syntax with previous versions for collection initialization. The bottom right corner features "QUICK TRICKS DEV" branding.
![A JavaScript coding trick from 'Quick Tricks Dev' showing how to flatten nested arrays without recursion using Array.flat() and Infinity. The image displays code: const deepArray = [1, [2, 3], [4, [5, 6, [7, 8]]], 9];. Using deepArray.flat() flattens it one level to [1, 2, 3, 4, [5, 6, [7, 8]], 9]. Crucially, deepArray.flat(Infinity) flattens all nested levels into [1, 2, 3, 4, 5, 6, 7, 8, 9], with callouts explaining Infinity for full flattening and the completely flattened final result.](https://pbs.twimg.com/media/HCjc7-zX0AAYFaA.jpg?name=small&format=webp)
ALT A JavaScript coding trick from 'Quick Tricks Dev' showing how to flatten nested arrays without recursion using Array.flat() and Infinity. The image displays code: const deepArray = [1, [2, 3], [4, [5, 6, [7, 8]]], 9];. Using deepArray.flat() flattens it one level to [1, 2, 3, 4, [5, 6, [7, 8]], 9]. Crucially, deepArray.flat(Infinity) flattens all nested levels into [1, 2, 3, 4, 5, 6, 7, 8, 9], with callouts explaining Infinity for full flattening and the completely flattened final result.

ALT A code snippet on a dark background showing a C# method `ProcessNumbers` that uses local functions for clarity. The method defines `IsValid` (checks if a number is between 0 and 100) and `Transform` (multiplies a number by 2), then processes a list of numbers by filtering them with `IsValid` and transforming them with `Transform`. The title "C#: Elevate method clarity with local functions" is at the top, along with two spark icons. Text on the right states: "Since C# 7 you can define local functions inside your methods."
![A JavaScript code example demonstrating non-mutating array modification using the `.with()` method. The image displays the title "JS: Level-up array modifications using non-mutating replacements with .with()". The code shows an `originalArray` initialized with `['apple', 'banana', 'cherry', 'date']`. `indexToReplace` is set to `1` and `newValue` to `'blueberry'`. A `newArray` is created using `originalArray.with(indexToReplace, newValue)`. The output shows `newArray` as `["apple", "blueberry", "cherry", "date"]` and confirms that `originalArray` remains unchanged as `["apple", "banana", "cherry", "date"]`. The bottom right corner shows "QUICK TRICKS DEV".](https://pbs.twimg.com/media/HB6XKsCWAAA42RS.jpg?name=small&format=webp)
ALT A JavaScript code example demonstrating non-mutating array modification using the `.with()` method. The image displays the title "JS: Level-up array modifications using non-mutating replacements with .with()". The code shows an `originalArray` initialized with `['apple', 'banana', 'cherry', 'date']`. `indexToReplace` is set to `1` and `newValue` to `'blueberry'`. A `newArray` is created using `originalArray.with(indexToReplace, newValue)`. The output shows `newArray` as `["apple", "blueberry", "cherry", "date"]` and confirms that `originalArray` remains unchanged as `["apple", "banana", "cherry", "date"]`. The bottom right corner shows "QUICK TRICKS DEV".

ALT An image about C# programming titled "C#: Unbound generic parameters for nameof!" with a lightbulb icon. It displays C# code demonstrating the `nameof` operator with unbound generic types. The code initializes string variables using `nameof(List<>)`, `nameof(Dictionary<,>)`, and `nameof(GenericClass<,>)` for a custom `GenericClass<T1, T2>`. A red box explains, "Prior C# 14 above lines would throw compile-time error!" A blue box, connected by an arrow, clarifies, "Now nameof retrieves type name, ignoring generic arguments. i.e. List, Dictionary, GenericClass." The "QUICK TRICKS DEV" logo is at the bottom left.

ALT A dark-themed slide titled "C#: Multi-value method returns! With tuple deconstruction magic" features a C# code snippet. The code defines a static method `(int Sum, int Product) Calculate(int a, int b)` that returns a tuple `(a + b, a * b)`. Below the method, two examples of tuple deconstruction are shown: `(int sumResult, int productResult) = Calculate(10, 5);` demonstrates explicit type deconstruction, with an arrow pointing to a green box stating, "Deconstruct tuple results directly into typed variables." The second example, `var (s, p) = Calculate(7, 3);`, uses implicit types, with an arrow pointing to a blue box explaining, "Use 'var' for tuple deconstruction with implicit types." The bottom left corner displays "QUICK TRICKS DEV".
