faster running and more compatiblity in c, c++ than .net?

ethicalhacker

Well-known member
Joined
Apr 22, 2007
Messages
142
Location
Delhi,India
Programming Experience
5-10
Big heavy software like photoshop, 3dmax, maya, flash, dreamweaver etc are generally made in c++ or c for faster running. The idea is that c and c++ is closer to machine language..Net is a real conveneance to programmers because of its drag and drop gui creation and coding features. But what really matters when it comes to productivity? Its SPEED, compatibility ease of use and minimum crashes.The .net applications have problems over older systems with windows 95 98 me etc and requires the .net framework to be installed. Im not talking about vista here. Im ytalking about Speed here mainly and the example big companies and successfull sofware have shown.
Personally I love vb.net because of its easy of use over java c and c++ but what about performance... why should the most important thing suffer?
look at these links
http://www.vex.net/~marc/resources/dotnetvsjava.shtml
 
Last edited:
Unmanaged code (non .Net) can be faster if programmed properly, but you also have code a lot more because you have to do all the managing that the .Net runtime does yourself, in many cases reinvent common utility classes already present in the .Net library. C# allows for unsafe code which still runs under CLR, but is not verified by it and where one can do fast pointer operations that is not routed through Interop (marshaled).

C++ is not closer to machine language (than VB.Net), assembly code is. Some parts of image/video processing is probably using pointers, and may even be coded in assembly. VC++ have the same visual designers and managed VC++ use the same .Net library and runs under same CLR management, but is still a generally more awkward language to write code with. What is more common when needed is to use VB.Net for design/code of the GUI and unsafe C# or unmanaged C++ libraries to do really heavy lifting operations.

I have no idea why you mention Window 9x at all. Installing .Net framework is really not an issue either, all managed code needs this, Java needs its own runtime library, classic VB in its time had its own runtime. Unmanaged (C) applications on their end usually bundle with loads of "third-party" libraries that keep up common library functionality, but unlike our common framework these has to be deployed each time, when deploying .Net the installer can detect and only get the library if needed. As you also kind of pointed to newer OS already has got a version installed, I think XP SP1 or SP2 included .Net 1.1, and Vista includes .Net 1.1 and .Net 2.0.
 
Unmanaged code (non .Net) can be faster if programmed properly, but you also have code a lot more because you have to do all the managing that the .Net runtime does yourself, in many cases reinvent common utility classes already present in the .Net library. C# allows for unsafe code which still runs under CLR, but is not verified by it and where one can do fast pointer operations that is not routed through Interop (marshaled).
But is still a generally more awkward language to write code with. What is more common when needed is to use VB.Net for design/code of the GUI and unsafe C# or unmanaged C++ libraries to do really heavy lifting operations.

First what do you mean by unsafe code?
do you mean accessing the memory address directly using pointers?
how is this unsafe?

Second why do you say c++ is an awkward language I know its complicated and tough but its very powerful. you can make anything from games, animation software and even operating systems using it...:confused:
 
Last edited:
well, using c++ means that you have more to keep track of and it's quite easy to leave memory leaks and buffer overflow problems in without realising it. I will say though that for some tasks it's simply easier and the better option. I wouldn't like to try programming a driver in .net for example. For tasks where raw processing is a necessity, c++ (yes assembly is better again) is what's needed. It's more a case of using the tool for the job. In general I'd use .net for most things but for some tasks I'd use c++ or a different language/tool entirely. Keep in mind that the .net framework itself is written in c++...
 
The .Net Framework libraries are managed, so in theory they could have been written with any .Net language, including VB.Net. But Framework functions also make calls to common Win32 API functions found in OS libraries that are not managed, so-called platform invokes. As for the runtime, debuggers, compilers and tools I would guess C++ and/or assembly.
 
I dunno... I'm pretty sure I remember coming across something on the msdn that the .net framework was written in c++. I think it was something to do with skinning in that it went on to say that you didn't have to wait for something to be implemented in the framework but could use the api directly to skin with the latest versions of the controls in vista and mentioned in passing that the framework itself was written in c++ anyway so extending it with c++ was a natural extension of the existing code base.

Mind you, I could be wrong so don't quote me on that :)
 
Managed C++ is also a .Net language, you know. You can view the disassembled source code for all .Net library assemblies in any .Net flavour with Roeders Reflector.
 
true but the c++ is only managed if compiled correctly and uses the .net framework. The code to "manage" is itself written in c++. What else would they write it in after all?
 
You need to differentiate between the .NET CLR and the framework. The CLR is probably mostly written in unmanaged C++, since that is what does the managing, but possibly part of it is even written in .NET. The framework is a set of class libraries that is almost certainly mostly written in .NET except where it needs to access API and stuff, where it goes unmanaged.
 
Microsoft staff on the MSDN forums were saying that the Framework and the CLR were made in C#
 
I don't understand how that would work, because c# is managed.... Surely a chicken / egg scenario there?
 
probably a lot of the CLR is C#, but there must at least be a small amount in C++.
 
Back
Top