C# Is Dangerous

I was asked why C# is still relevant in 2018. What makes a language relevant to me? Someone pays me to work on it. Preferably a lot of money. With that there is this risk reward of developing rare skills. To me Cobol is relevant in 2018. A few people make a lot of money maintaining Cobol systems. However, (at least where I live) I don’t see a lot of ads for Cobol developers. I see a bunch of C# ads and a ton for Javascript developers. You need to seek the balance between valuable skills and available work.

Within a few days another friend asked me what programming language to learn as a first language in 2018. You might think I would suggest C#, but I didn’t. The truth is, as a professional software engineer I have little affinity for C#. I’ve written some articles on C# tooling because that’s what I look at day in and day out. But I would also be happy and very effective working in another language.

Building software is a bit like building houses. Take a builder who does brick houses vs one who does wood framing. Each material has strengths. Brick is fireproof. Wood withstands earthquakes. Each has regions of better pricing and availability. A superior builder knows building systems and when to use each material. Can a builder switch from building brick houses to wood-framed houses? A professional builder should be able to switch with time and study. The underlying building principles remain constant. But the materials, tooling, and techniques are different. Switching could take some trial and error.

Superior software engineers know principles over languages. GRASP Patterns. SOLID Principles. These do not change from language to language.

Now to the heart of the matter. Microsoft tries hard to reduce workload for developers. You click on new project in visual studio, select a template, and immediately you have a working web application with a database and everything. If this is your introduction to software development then you are building your software engineering base on sandy ground. For example, you will see dependency injection introduced by the template but not necessarily understand how it is working and why it is important. Without a proper foundation an IDE is a crutch as much as a tool.

This is why C# is dangerous. The Microsoft tooling makes it easy for inexperienced developers to build poor software. And this problem is not exclusive to C# but I worry that is it more prevalent with C# (and Visual Basic.NET).

C# as a relevant language in 2018 is not in question. It has any feature available that I’ve come to expect. Like a building system (think brick vs wood) some of these are better in C# and some are better in other languages. All of these are available in most languages but no language that I’ve found is perfect.

Openness / portability – Free. Cross-platform. Open source. Public design reviews. Weekly open calls. (contrast this to the new commercial licensing for java)

Modern language constructs– generics/ lambda expressions / anonymous functions / delegates. The list goes on and the specification evolves regularly. Microsoft hires some really smart people to oversee this.

Package management – NuGet. So convenient for software re-use. Integral to dotnet core.

Great libraries – well-documented, reliable, mostly open-source, and clean. Anything I need to do I can find a package and easily reference it.

Supported by cloud infrastructure – There are lots of different ways to host your application in the cloud. PAAS options on azure. Or container-based solutions using docker on pretty much any host (e.g. digital ocean droplets).