I know that GPT-4 is all the rage right now, but I decided to spend some time this weekend on something a little less sexy: learning to work with Microsoft’s original attempt at a Java killer, C#. Some quick projects:
- A basic Hello World, of course.
- A “input 2 numbers”.
- A minimal clone of
dc
, the reverse Polish notation calculator. This one’s a fun one because it’s very easy, but finally gets you to use an honest-to-God data structure. - A minimal HTTP server that counts pageviews.
“Really, C#? Why? You already know like, Python and Haskell and a million random command-line tools. What’s the appeal?” Money, baby. Outside of the Valley everyone and their uncle is still using either Java or C#, and I had enough Java in AP Computer Science twelve years ago. Besides, working my way through Haskell Programming from First Principles last year while I was unemployed was something I did for me, not for the market; I’m a firm believer in listening to the market when it’s giving you hints.
I’m also a firm believer in the wisdom of the traveling salesman. Your first programming language might be an arbitrary choice, but your second one almost certainly won’t be, nor will the first database you work with, the first third-party library import, etc. How do you choose what to learn or do next? Turns out you can get pretty far just learning the most obvious, popular thing.
In my case, the “most obvious, popular thing” is C#. I already know PowerShell better than I have any reason to, and C# ties in to PowerShell beautifully. The backend developers at my current job all use C# - and a lot of them are veterans, having progressed to C# from the halcyon days of Finnish ’90s and ’00s C++. These guys know their stuff! And, finally, I’ve already been immersed in the Microsoft and Azure twin ecosystem for months now – SQL Server is in my bloodstream right now, as are all the most common assets created on that cloud platform. C# works with all of those technologies impressively well.
Here’s what my setup looks like so far:
- Although I’ve switched to Neovim by way of NvChad for most command-line text editing needs, I knew that with C# in particular the IDEs available have a stellar reputation. Since I run Linux at home I opted to try out the free trial of JetBrains Rider. I’ll probably switch back to Visual Studio or VS Code once the free trial ends, however, since that’s what I use at work anyway.
- I only have a few extensions on for right now:
- IdeaVim, so I can keep the 80/20 (more like 99/1) of Vim motions;
- CognitiveComplexity, a really interesting evolution from cyclomatic complexity by G. Ann Campbell of SonarSource which tickled me pink when I found it because it reminded me heavily of some advice I heard first in Mark Seemann’s book _Code That Fits In Your Head (himself an landmark example of a Haskell/C# dual wielder).