Don't mix await and compound assignment
The 5.0 release of C# introduced the await keyword which makes it extremely easy to use Task
The 5.0 release of C# introduced the await keyword which makes it extremely easy to use Task
During a review of some low level bit manipulation logic a developer raised a question about the correctness of a piece of code which allowed any arbitrary byte to be seen as a bool. No one could recall if true was defined as not 0 or simply 1. If it was the latter then the code was allowing for a large range of invalid bool values to be created. A quick look at the CLI spec revealed the immediate answer (partition III section 1.1.2)
As I’ve developed VsVim over the years I’ve authored quite a few reusable Visual Studio components. For the last 6 months I’ve had many of these factored out to a separate utility library and this last week I decided to publish them as a separate NuGet package. Even if no one else every uses the library I want to reuse the utilities in other projects I’m working on and NuGet is the perfect distribution mechanism. For those interested I’ll be blogging about these components and why I authored them in the coming weeks (hint: perf, perf and more perf). I wanted to blog about my the rules I learned from this exercise because even as a seasoned extension author I hit a couple of very surprising problems along the way. Hopefully the lessons I learned will help out the next person to attempt this
The DebuggerDisplayAttribute is a powerful way to customize the way values are displayed at debug time. Instead of getting a simple type name display, interesting fields, properties or even custom strings can be surfaced to the user in useful combinations