Why does everyone advise to use c #, but in c ++ / cli they don’t want to? I tried c ++ / cli, sort of a normal language. I ask about him, and everyone says that I don’t need to program on it. Why is that?

Closed due to the fact that it is necessary to reformulate the question so that it was possible to give an objectively correct answer by the participants Andrey NOP , Pavel Mayorov , Kromster , slippyk , andreymal 2 Oct '18 at 10:25 .

The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • 6
    Change your social circle, and you will be advised to do something else - Kromster
  • @Kromster vmysle? - ʞɔᴉN ɹǝꓥ
  • Yes, even use winapi - ishidex2
  • In the sense that if you change your social circle to web developers, then everyone will begin to strongly advise JavaScript, and if you go to the game development team, then as lucky you are, Unity / C # or UE / C ++. That is, the tool depends on the tasks. What tasks you solve - take that tool for them. - Kromster
  • @Kromster Yes, I do the usual application - ʞɔᴉN ɹǝꓥ

1 answer 1

Let's be honest. Somewhere you once read that the C ++ language is incredibly cool and you can do almost anything on it (yes it is). So you decided to teach him. Having tried console programs in C ++, you wanted to make an application with a graphical interface. Sorry, you started with Visual Studio. Tried WinAPI - difficult and incomprehensible. And then we found the Windows Forms template. Oh, controls can be dragged to the form with the mouse - it is very easy to create a GUI. So you met (and I, and many others) with C ++ / CLI.

So why not continue to use it? Because C # is a more advanced language: it is simpler, more logical, thoughtful. It is constantly evolving, while C ++ / CLI is not. The fact that in C # is implemented by one or two lines of code, in C ++ / CLI often requires dozens of lines.

C ++ / CLI is intended, in fact, for one purpose: to serve as a “glue” for a managed (managed, .NET) bundle and unmanaged (native) code. For example, you have a high-performance library made in a native language like C / C ++ / Delphi, etc. And you want to create a desktop application using it. In C #, you can easily, quickly and simply do work with a DBMS, file system, network, various data formats (xml, json), GUI and much more. Implementing all of this in C ++ takes much more time and labor. But now how to connect that same library? This is what C ++ / CLI is used for: a wrapper is written on it, which redirects the calls of the managed code to unmanaged. Everything! This language is used (should be used) only for this!

Confirmation that the C ++ / CLI language does not develop (and it is practically not used) is the number of books (near zero), articles, questions and answers in the forums. Here you asked a question . The answer was never received. Because in C ++ / CLI, a bunch of code is needed for implementation, while in C # there are only a few.

See this answer . Evaluate how much effort (code) is needed to implement a simple C ++ / CLI feature and compare it with the concise and understandable C #.