DEV Community

Discussion on: Pitch me on C#

Collapse
 
nikfp profile image
Nik F P • Edited

For me there are a few things that stand out in C#.

  • LINQ - Language integrated query. some other languages have tried to incorporate parts of this, but what you can do with LINQ in either a fluent syntax or the SQL-esque LINQ syntax is pretty incredible. Complex data operations on multiple data sources are the easiest to write that I've seen in any language.

  • Task Parallel Library (TPL) - This makes building multithreaded apps much easier to write and works with async / await patterns OR using task continuations. Both of these patterns will look similar to what Javascript does.

  • Generics and Delegates - the starting points for more functional styles of programming in an OOP language.

  • C# is mature and feature rich. There is a way to do anything you can think of.

  • NuGet - LARGE ecosystem of libraries to speed development.

  • Events - built upon Delegates and allows for simple Pub/Sub patterns to be built up between code modules. Code is easier to decouple as a result.

  • Extensive documentation - everything from the basics of variable assignment to the extensive tutorials on building certain kinds of apps is centralized on the Microsoft language documentation. One place to look.

  • Direct interop with F# - write some libraries in a functional language, consume them in an OOP language, no big deal. Do it the other way, no big deal. It all compiles down to "Intermediate language" and runs on the same runtime. (This also works with VB.NET, but just don't. VB is on sunset status)

AND some drawbacks:

  • C# is mature and feature rich. This is slated as a good thing also, but when there are 9 different ways to do anything, you see a lot of different patterns in the wild that accomplish the same thing. Thus, no "idiomatic" C# like we're currently seeing in Go.

  • NuGet is huge and there is a package for everything, but you have to be really careful about licenses when using anything. Some of the biggest players in the ecosystem and strictly for-profit are write libraries that they expect you to pay for. Fine for enterprise, but not for someone starting out.

  • Extensive documentation - sometimes it's just too much. Like sipping from a fire hose.