The Single Drawbacks of C# Programming Language

Discussion in 'C#' started by Hooman Bahreini, Dec 5, 2021.

  1. #1
    5 years ago I started building my own marketplace website from scratch. It's a platform for buying and selling goods, similar to Ebay or Gumtree.

    I decided to build it using ASP.NET MVC 5 and C#. I had experience with C++ and knew a little bit about Java, so it made sense to work with C#. After 5 years of working on the platform, I am quite happy with my decision, C# has a lot advantage:
    1. Like Java, it does the memory management for you so you don't need to bother allocating and relapsing memory.
    2. Similar to Java, it uses JIT compiler which allows having a portable code
    3. It's a true object orient programming language
    4. Has a great Editor (Visual Studio)
    Unfortunately, generally we run C# on a Windows machine which is more expensive than Linux... so we can argue that this is a disadvantage of C#... however I think this is not that big a deal. Programmers are a lot more expensive that computers. If a programming language can help save programmers time, then it still worth using it even though it runs on Windows.

    However C# has a single major drawback that really makes me think twice before starting a new project with it, and that is it does not support Multiple Inheritance.

    Now, I am a big proponent of Clean Architecture and OO principles and more often than not, I find myself in a situation that C# prevents me from an elegant design. When I want to group my components into base classes, more often than not, I see that a child require attributes from 2 parents and unfortunately that's not something that you do using C#... And in my opinion, that's the only drawback of C# but a pretty serious one!
     
    Hooman Bahreini, Dec 5, 2021 IP
  2. Andrii Ozemko

    Andrii Ozemko Active Member

    Messages:
    79
    Likes Received:
    11
    Best Answers:
    1
    Trophy Points:
    58
    #2
    Yes. C# doesnt support Multiple Inheritance. However, you can derive your class from multiple interfaces. This approach is better from a clean architecture point of view. I also started from C++ and then switched to C# and found this "disadvantage." But then I realized that this is an advantage.
     
    Andrii Ozemko, Dec 6, 2021 IP