Visual Studio Tips and tricks: Undock/Re-dock a tool window

  • Tips
The layout of Visual Studio is very flexible. You can dock the tool windows you use the most at the location you prefer. Sometimes, you want to undock it for instance to move it to another display. Sometimes, you also undock a tool window by error 😦. When you want to dock the window where it was before, it can be complicated by dragging the window. There is a very quick way to dock the window at the same…[read more]

Visual Studio Tips and tricks: Multi-line and multi-cursor editing

  • Tips
Visual Studio allows to edit multiple lines at the same time. This is very useful to apply the same change to multiple lines. For instance when you want to add the modifier to multiple properties. Multi-line editing using mouse Press Alt while selecting the block with the mouse: Multi-line editing using keyboard Press Alt+Shift+Arrow to select the block to edit: Multi-carets editing If you want to edit…[read more]

Nullable<T>: Value vs GetValueOrDefault() in term of performance

  • .NET
Nullable types represent value-type variables that can be assigned the null value. You can use the Nullable<T>.HasValue and Nullable<T>.Value properties to test for null and retrieve the value, as shown in the following example: if (x.HasValue) // or x != null { _ = x.Value; } In CoreFX issue about adding new analyzers in Microsoft.NetCore.Analyzers, Stephen Toub suggests to replace Nullable<T>.Value…[read more]

Website performance: How I've improved the performance of this website?

  • Web
In the previous post, I wrote about why performance is important and how to measure it for your website. In this post, I'll talk about what the different things I've made on this website to improve the performance. Some of the optimizations are just some configuration flags to turn on, others require more changes in your code. Enable HTTP/2 HTTP/2 is an evolution of HTTP/1 which comes with new features to…[read more]