Posts

Showing posts from 2020

A .Net Development Rig in Linux

Image
After playing with Rider for a while, I decided to play around with Linux again to see what .Net development is like on Linux rig in 2020. So I fired up an Ubuntu 20.04 LTS VM and started installing. .Net Core After updating the OS with all the latest patches, I installed both .Net Core 2.1 LTS and 3.1 LTS following Microsoft's instructions . wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb sudo apt-get update; \ sudo apt-get install -y apt-transport-https && \ sudo apt-get update && \ sudo apt-get install -y dotnet-sdk-3.1 dotnet-sdk-2.1 JetBrains IDEs I have a JetBrains Ultimate subscription, so my next setup was installing JetBrains Toolbox. There is zero documentation on doing so, but it's pretty simple. Just download the tar ball from JetBrains, extract it to a directory of your choosing, and run it. Using the ToolBox, I installed my IDEs--Rider, In...

My Experience with JetBrains Rider

Disclaimer: This is an OpEd and mostly anecdotal. Performance wasn't measured, just perceived based on whether it left like the IDE was hanging a lot or productivity was impacted. I'll start off by saying: there is no replacement for Visual Studio. None. That's my opinion anyway. That said, JetBrains Rider is a decent .Net IDE, especially if you are a ReShaper fan (I am not) or IntelliJ fan (I am). What made me decide to give it a go? Well, I started work at Linedata as a Cloud Solution Architect and Application Architect. They are heavy users of ReSharper, and use it to enforce code formatting, quality, standards, and test coverage ( dotCover ) as part of their CI builds. It only took a few hours of me getting fed up with ReSharper crippling Visual Studio for me to install Rider and give it a go. I've been using it at work since. Some take-aways After using Rider as my primary C# IDE for a few months, here's my impression... Good Impressions P...

Static Readonly instead of Const in C#

I have always considered it a best practice to use  static readonly  instead of  const  in C#. Here’s why… The  const  keyword tells the compiler to replace the constant token in your code with the literal value you have defined for the constant. You can see this if you look at the IL: The C# code… const string HELLO = "Hello" ; ... Console . WriteLine ( HELLO ); Console . WriteLine ( HELLO ); Compiles to the IL… .field private static literal string HELLO = "Hello" ... IL_0001: ldstr "Hello" IL_0006: call void [System.Console]System.Console::WriteLine(string) IL_000b: nop IL_000c: ldstr "Hello" IL_0011: call void [System.Console]System.Console::WriteLine(string) Notice that the literal  "Hello"  is loaded twice. Using  static readonly  provides us similar semantics–a global value that cannot be changed–but rather than references being replaced with literals by the compiler, it remains ...