Why C# is Still Worth Learning Today

These days with all the programming rage is JavaScript and related web frameworks or data science with Python or R, C# isn't as popular as it used to be. Of course, that makes sense. Programming languages come and go as languages and compilers are evolving. However, I think C# is still a good language not only to learn but to master.

With the recent release of StackOverflow Trends we can see how popular tags have been on the platform. Considering how popular and influential StackOverflow is in terms of getting help, this data is worthwhile to look at.

Here's a look at the current list of popular languages according to TIOBE index (we'll talk more about this further down this post).

That's a lot to gather in one chart, so let's break it down a bit.

From this graph, C# was very much used due to the amount of questions on StackOverflow back around 2009.

Sure, it has steadily gone down in time and will probably continue to decrease. But think, all of those companies who picked up C# and .NET back when it was much bigger...they need to support those applications. Some may decide to rewrite them depending on their budget and what kind of experience their current developers have, but I'm sure C# will continue to run a lot of those applications in the future.

This reminds me of the current state of Cobol. A HackerRank post mentions an interesting statistic about Cobol:

70-80% of all business transactions worldwide are written in COBOL today

That's a lot of businesses still running Cobol! I believe it'll be the same with C#.

Every year for the past few years StackOverflow has conducted a big developer survey. What they find there can be very interesting!

Here's the most popular technologies of 2016:

https://insights.stackoverflow.com/survey/2016#technology-most-popular-technologies

https://insights.stackoverflow.com/survey/2016#technology-most-popular-technologies

Most popular doesn't always mean that developers enjoy working with it, does it? In terms of C#, it seems developers still enjoy it!

https://insights.stackoverflow.com/survey/2016#technology-most-loved-dreaded-and-wanted

https://insights.stackoverflow.com/survey/2016#technology-most-loved-dreaded-and-wanted

C# is here to stay

Developers still ejoy working with it, but what about the industry itself? All of the data presented so far was from StackOverflow which was derived from surveys, where people can lie if they want, or from their own data with tags, which just means people ask a lot of questions about it. The TIOBE index mentioned earlier gathers a lot more data. Here's their list of the top five languages:

Source: www.tiobe.com

Source: www.tiobe.com

Still impressive to be in the top five and I don't see it getting below that very much in the near future.


With all the debate about what will be next to learn to keep you on the edge in terms of development, a good solid understanding in C# is still a contender. Not bleeding edge, of course, unless you're getting alpha of the newest C# versions to try out new language features.

C# is a great languge to learn from since the tooling is great and there is no shortage of tutorials and courses for it.

First Wintellect Blog Post + A New Series On Design Patterns

Just recently, I published my first blog post to the Wintellect (my awesome new employer) site. May not seem like much, but it's pretty exciting for me.

One of the things to keep yourself learning, I feel, is to tackle the stuff you feel you understand the least. For me, one of those things was the concept and implementation of different design patterns. I'm probably already too late in the game for this, but better than not learning it at all, right?

Head First Design Patterns - Part 1: Observer Pattern

Core C#: Delegates

Microsoft has made it easier for aspiring developers to easily get started creating something when they came out with the C# language. However, there are definitely some advanced aspects of the language that take quite a bit longer than others to fully grasp. Delegates is one of those types of language features. Hopefully by the end of this article you'll have a deeper understanding of how utilize delegates in your C# code. 

I, myself, had trouble trying to fully understand what the purpose of delegates were. If you were to ask me before what a delegate was, I would just give a small answer indicating that it's similar to a method template. While that's true, it does quite a bit more.

The simplest way I know to go over delegates is to just go through a small example to allow you to also do the same so you can use that to experiment around with the code.

Let's go through this a bit. The first line is where you actually declare the delegate and give it a return type, name, and any parameters if it needs any. In our Main method is where we'll initiate a couple of variables to hold the delegates. The first one, myDelegate , does so using the method syntax. Our second variable, however, we declare it using an anonymous delegate, or a delegate without a function name.

After we've declared the our variables with our delegate, we can then invoke our delegate by calling it just like a method just like in lines 15 and 16 above. We declared our delegate to take in a single string parameter, so that's how we'll invoke it. 

Built in Delegate Types 

The folks at Microsoft were kind enough to give us a few built in delegates that we can also use within our code. Let's take a quick look at them. 

The first one, which may be the most commonly used, especially if you've messed quite a bit with the LINQ method syntax, is the Func  delegate type. This one will take in zero or more parameters and will return something back to the caller. In the example above I have one parameter of a string and I return back an integer.

The second one is the Action delegate type. Like the Func type it takes in zero or more parameters, however it returns void (returns nothing).

The third one, Predicate, is a bit closer to the Func type where it takes in parameters and returns. The difference with this is that it will always return a boolean true or false back to the caller.

Invocation Lists

One of the magic things that delegates have is they keep track of all invocations of it. When we instantiate our delegates we are actually adding to the invocation list. Another way to do this is to simply add a delegate to another delegate. 

We'll see the true power of delegates and their invocation lists in the next part, when we talk about events.