Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# for win32 or c++ [closed]

I know C++ windows programming is harder than C#. Because we should Create WNDCLASS and Initalize it and using API Funcs and...

But My Question is here , for windows programming ,Is C# better than C++ ?

If yes , why large programs are created with C++ .

like image 298
S.A.Parkhid Avatar asked Nov 30 '22 09:11

S.A.Parkhid


1 Answers

Its not "large programs" when C++ is favored over C# managed code.

There are limits to what can be done with managed code, for instance you cannot write hardware drivers or other programs that interface with hardware. You cannot even access all of the Win32 API from purely managed code. Some programs have high performance requirements and are therefore more suited to C++. Sometimes C++ is used simply because the company developing the software has skilled C++ developers. Sometimes C++ is used because the developers don't want the software to be dependent on the .NET framework (which isn't installed out of the box on XP and earlier Windows versions). Sometimes C++ is chosen so that a cross platform application can be developed.

In broad terms, C# is easier to learn and is a more powerful and productive language & framework than C++/MFC/COM etc. But C++ is a very broad tool, and can produce solutions to many very diverse problems, from writing operating systems, real time systems, embedded applications, databases, business software, desktop software, server software, libraries/frameworks, etc, etc.

C# is better suited to a particular class of problem. It is pretty much limited to running on Windows (with the exception of Silverlight & Mono). C# suits rapid application development, which means it is better suited to one-off custom software, such as many internal applications developed within large organizations. And as I've indicated, its more suited to developing desktop and server application software over drivers and other low level software.

If you're looking at which language to start learning, a smart choice would be: C then C++ then C#. This will give you the foundation you need to become a really good object oriented programmer, with an understanding of how lucky we are to have C#! If you don't have 10 years to spare, then go ahead and start with C#. Whatever you do, don't start with C++ or you are likely to give up your programming career in despair and join the circus where things make more sense.

like image 103
saille Avatar answered Dec 18 '22 05:12

saille