Fragrance Of Programming
Those who are migrating to C# from Java and someone who doesn't want to migrate to Visual Studio, now have a new alternative for developing .NET applications, called Rider by JetBrains.
The Rider IDE uses the company's IntelliJ IDEA for a shell and incorporates its ReSharper Visual Studio Extension technology for various automated productivity tasks.
One of the main reason, Rider might be the good alternative to Visual Studio is the commercial license price, which is USD 449 for both "Rider + ReSharper Ultimate" for first year, while Visual Studio itself costs more than that.
Features of Rider:
For Java developers, it's now easy to migrate to C# with familiar IDE. Also, now C# developers have cheap and effective alternative to Visual Studio
There are many hidden tricks which are present in Visual Studio 2017 and can be really very useful. And one of them which I will be discussing today is "DebuggerDisplay".
Debugger Display helps to display runtime object data in simple and meaningful way. Of course meaningful data differs from developer to developer and also depends on what we are debugging. At least Debugger display gives control what to display and with the help of attributed debugging.
Attributed debugging gives type the ability to specify what it looks like when being debugged. The simplest form of this is the DebuggerDisplayAttribute. Below is the sample code.
After writing the above code, set a breakpoint at the end of the Main class and if you watch "Employees" in Watch, you will see something as below:
Now if you want to examine any of the employee object you first need to know which object inside the Employees collection. You can even override ToString and display the complete name but that will be functional evaluation and will be very slower and also not necessary the ToString implementation and the Debug view is same. So in such case "DebuggerDisplay" comes very handy and you can use it as shown below
After attaching the above attribute in the Employee class, you can see that now Debug display more sensible data and it's very easy to locate the object in the collection.
If you want you can even include the format specifiers in the expression.