Why is .NET slower anyway? I mean, what makes C++ faster than C#?
Why is .NET slower anyway? I mean, what makes C++ faster than C#?
Boy you stink, go take a shower before you continue to code. Better do your laundry and spray your chair too.
The one and only resource for finding information.
Next version of windows released!!!!
And why is visual basic .net syntax different from vb6 (i know it's an off-topic question.. but speaking about .net...)
what does signature stand for?
... Okay, let me smack into shape.
First off, .NET and C#.
.NET is slow because it is, in fact, an Object-Oriented psuedo language much like Java. Java is run through the JVM, which interprets ByteCode. ByteCode isn't machine code, or Opcodes. Bytecode is a special format that is interpreted by a Virtual Machine such as the JVM. The JVM takes the bytecode and translates it into Opcodes, which theoretically is what makes Java work *everywhere.* The Bytecode isn't platform and architecture dependent like Assembly or Win32 code. The JVM interprets it accordingly.
.NET is compiled into CIL I believe, which is just interpreted to the computer by the CLR. .NET works by doing JiT compilation or Just-in-Time compilation. The ideology behind JiT is `hunks' of bytecode are thrown into the interpreter/VM at a time and THEN translated into opcodes to feed. This way, the program is throw into opcodes as it is run.
The reason frameworks like .NET and The JDK are slow is because it takes a signifincatly larger amount of time to translate these pieces. In fact, I also bet that when the VM interprets .NET or JDK code, it probably produces and feeds the CPU badly made Opcodes as well.
That's the same reason languages like C++ are slower than their brother C. C++ is Object-oriented, therefore when it's compiled it comes out to more opcodes to accomodate the language, so it takes longer for the CPU to run them. That's why a C++ app that's big will take a long time to execute and lag sometimes.
This is also the reason, why Assembly is so damn fast, you control every step of how the computer mov's (bad joke) and thus it is compiled into the smallest, fastest and most lean opcodes.
This also, brings us to VB.NET and VB6.
As I mentioned earlier, .NET is object oriented. Therefore all the languages of .NET inherit this (another bad joke.) VB6 and VB.NET are built off totally different frameworks, one is Object-Oriented and one is not.
Hence why in a procedural language like C you would do strlen(string); but in VB.NET you might do string.Length(); because in that sense the string variable is not a variable, but an object to a string class with it's own methods and data.