Why is .NET so popular? (Serious Question)
-
Rob Graham wrote:
.Net JITs to native code, optimized for the particular OS and hardware it is running on, so it can in many cases actually be faster than pre-compiled Win32/64 code, since it can take advantage of OS specific and processor specific optimizations.
Baloney. The JIT compiler is still saddled with the constructs of .NET. I've done extensive benchmarking and have found that purely algorithmic code is 4x slower on average with .NET than native C++. When using the framework, there are portions of .NET that are faster, though once you figure out what they're doing, you can get almost always get better performance with C/C++. (A common trap is file i/o. .NET can make this look so fast until you realize that they are often caching the entire file!)
Rob Graham wrote:
not forcing developers to re-invent the wheel every time?
Laziness. There are plenty of libraries out there that offer fantastic functionality for C++. They are just as easy to learn as .NET and sometimes easier. The difference is that .NET puts all this massive amount of code (35MB of mostly native C++) in one place with one runtime. If you gave yourself a budget of even half that, you can easily build a list of fantastic C++ libraries that aren't very expensive. I will openly and totally conceded that dealing with COM is much easier in .NET. One reason is that the objects are actually documented (using undocumented objects in .NET is as big a pain as in C++ and Microsoft still has way too many undocumented "must use" COM objects.)
It's still compiling to native code. Algorithmic code is slower because that native code includes a lot of extra checks that you would have to do manually in C++ (Or just know they aren't needed). You sacrifice runtime speed for better stability and less chance of nasty little buffer overruns and the like. Personally, I find that C# is absolutely perfect for my current (professional) situation. I'm a solo developer writing in-house software to support a small trading desk. I have no QA staff and no other programmers to divide up the work. Bugfixes and added features need to be done and deployed to the end users quickly (Talking minutes or hours, not days). If I desperately need a performance boost somewhere, I either drop to unmanaged code or move the functionality into a Managed C++ assembly... Otherwise, I use C# for rapid development and easy maintenance, and WPF for good-looking and responsive interfaces (WPF's data binding is incredibly useful, once you get used to it). Now, if I was at a game development shop, or a mainstream commercial developer, and they were using C#/WPF, I'd probably be saying much the same things as you are. The name of the game is using the right tools in the right situations.
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels) -
It does not however, compile to native code, which was my point.
Rob Graham wrote:
It does not however, compile to native code,
May be I am not following you. Java HotSpot VM always compiled to native code and it works almost the same way as the .NET JIT compiler. Are you talking about "ngen" pre-compiler? I am not sure if there is a Java equivalent of that.
-
Look at the alternatives and you will get your answer. 0. MFC is a poor framework with a Spartan visual components library. 1. Java libraries are a complete duck-typed mess of poor and good technologies, most of them with an insane learning curve. 2. Delphi is not what it used to be in the late 90s. 3. Nokia’s Qt Developer – I see a spark here, but I can’t comment on it yet because I’m looking on this IDE only from a week. Am I missing some other popular framework?
The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word. Advertise here – minimum three posts per day are guaranteed.
modified on Wednesday, December 1, 2010 2:55 PM
Deyan Georgiev wrote:
0. MFC is a poor framework with a Spartan visual components library.
Not entirely true. MFC is not well designed as Windows API or .NET classes, but it still has its place. Who, on MSVC environment would use VCL ?
-
Look at the alternatives and you will get your answer. 0. MFC is a poor framework with a Spartan visual components library. 1. Java libraries are a complete duck-typed mess of poor and good technologies, most of them with an insane learning curve. 2. Delphi is not what it used to be in the late 90s. 3. Nokia’s Qt Developer – I see a spark here, but I can’t comment on it yet because I’m looking on this IDE only from a week. Am I missing some other popular framework?
The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word. Advertise here – minimum three posts per day are guaranteed.
modified on Wednesday, December 1, 2010 2:55 PM
Deyan Georgiev wrote:
Am I missing some other popular framework?
Yes, WX Widgets, for instance! ;)
-
Rob Graham wrote:
It does not however, compile to native code,
May be I am not following you. Java HotSpot VM always compiled to native code and it works almost the same way as the .NET JIT compiler. Are you talking about "ngen" pre-compiler? I am not sure if there is a Java equivalent of that.
I misspoke, having forgotten about the VM hotspot compiler. After actually checking on the facts :-O I note that Java now also has several precomilers like ngen available on various platforms...
-
Deyan Georgiev wrote:
Am I missing some other popular framework?
Yes, WX Widgets, for instance! ;)
Is it popular and well supported? I’ll give it a look.
The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word. Advertise here – minimum three posts per day are guaranteed.
-
It does not however, compile to native code, which was my point.
Of course it does. Bytecode and IL are basically equivalent concepts, and both get compiled just-in-time to whatever the CPU needs to execute them, i.e. native code. Unless you are using an interpreter on purpose. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
Is it popular and well supported? I’ll give it a look.
The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word. Advertise here – minimum three posts per day are guaranteed.
www.wxwidgets.org[^] It is quite powerful, had static binding, like MFC, unlike QT, which uses slots-signals (dynamic binding, thus slow). I always use MFC, WX is for cross platform. Many features are not even in MFC!
-
.Net is much more friendly to new programmers than something like MFC. .Net is a far more comprehensive library than MFC (or any other framework i've ever seen). also, .Net provides a far better way to do web programming than C++. (and i say this as a die-hard C++ programmer) and this "meta environment" you speak of is a bit exaggerated. .Net languages are compiled to native code, at run time. there isn't really any huge "runtime" between the code and the OS. there's an environment and a standard librar, just as there is with any other language. but it's not like .Net is interpreted or anything.
you really think .NET is good for web??? do you mean the c# language or the .NET runtime? if you mean c# then sure it's a nice language and works well for many tasks including web if you mean, however, .NET is good for web then i would respectfully say you are talking from the wrong end of your body ... .NET is the antithesis of what the web is about and consequently sucks at it ... the web is not the desktop and should not be treated as such ... just because someone can write a desktop app does not mean they can write a web app ... completely different problem domain with different rules and constraints that need to be understood properly to write a good web app (website / service / etc) would you think it a great idea to use say php to write desktop apps? that a good javascript programmer would necessarily be a good c++ programmer for desktop environments? no the inverse is true as well /end_rant
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
-
Assembly! Assembly? You youngsters today are spoiled. Machine Code is the way to go. :-D
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
Hardware Binary Editor :thumbsup: (aka toggle switches)
Steve _________________ I C(++) therefore I am
-
Assembly! Assembly? You youngsters today are spoiled. Machine Code is the way to go. :-D
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
You looking for your punch card collection, Henry?
I wasn't, now I am, then I won't be anymore.
-
I have some limited experience with C# and VS 2008 and I don't understand why the .Net framework is so popular. It is a meta environment running on top of the operating system just like Java and the non-Windows implementations do not have all of the capabilities of the Windows version so it's not truly cross platform. I don't see why -- other than Microsoft's semi-forcing the issue -- someone would choose to use this. Shouldn't Win32/64 code run just as well, if not better, since there is no runtime between the code and the system? I can't help thinking of Java or even UCSD P-System Pascal when I look at this. I realize .Net has a large amount of built-in functionality but the same thing could be implemented in native code as well. What am I not seeing here?
b_dunphy wrote:
What am I not seeing here?
Commercials. You answer it yourself when you say:
b_dunphy wrote:
I realize .Net has a large amount of built-in functionality but the same thing could be implemented in native code as well
Yes you can create these items in your own framework, but the key things are that somebody else has already done this for you and this cuts things out of the development that you don't have to do for yourself. Couple this with the fact that you get the benefit of thousands of others testing the framework for you, then this serves to inspire a lot of confidence in the corporate suits. I used to write applications in Informix 4GL, and I could crank out database applications very, very quickly. Then I moved over to C and my productivity dropped. Moving on to C++ and Windows improved my productivity marginally, but not by a great deal - fortunately I was writing applications that required raw speed over cut development times. Compare that with the VB types who could crank out database applications for companies in a fraction of the time. With the move to the .NET framework, MS has provided a framework that provides the speed of development of the VB types with a much fuller featured framework. Now, others have mentioned ASP.NET which is a much more credible alternative to Java web applications, but nobody has mentioned WPF and Silverlight. WPF makes DirectX developed interfaces easy to develop; letting you go well beyond the standard look and feel of Windows applications - effectively commercial applications can be limited only by the creativity of your designer. With Silverlight applications, we have a credible alternative to Flash applications and this has opened up a new way of developing applications; potentially targeting other platforms.
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
-
b_dunphy wrote:
why the .Net framework is so popular.
Depends on whom you ask? How many*desktop* applications which you use on a day to day basis are written in .NET? Let' see:- 1. Internet Browsers - Chrome, IE, FF, Opera -> None of them are in .NET 2. Microsoft Office - Not .NET (though some add-ons can be .NET) 3. Windows Live Messenger, Yahoo messenger, Google Talk etc - Not .NET 4. Notepad, Paint, Calculator - Not .NET 5. Visual Studio - Mainly .NET 6. SQL Server - Not.NET but portions of Management studio/BI Studio are .NET 7. Task Manager - Not .NET I am just talking about Windows here. Mac and Linux users may survive even without knowing about .NET. The place where .NET is popular is in Websites developed for IIS (lot of intranet sites). ASP.NET is almost the de-facto choice. Now again, IIS is a very small percent of total websites out there. The only other place where .NET is popular is enterprise applications or custom developed enterprise apps.
Rama Krishna Vavilala wrote:
Depends on whom you ask
Indeed. Let's see: 1. My editor: C# 2. My IDE: C# 3. My system tools: C# 4. My cross-compilers: C# 5. My simulators: C# 6. My image processing: C# + native C 7. My automation stuff: C# 8. My chess utilities: C# 9. My model railroad: C (on Mac), to be ported to C# 10. My web site: PHP (unfortunately) 11. My embedded stuff: C I'll use a native DLL when it is the right choice that fits the requirements, however I can't remember when I last did a native EXE. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
Of course it does. Bytecode and IL are basically equivalent concepts, and both get compiled just-in-time to whatever the CPU needs to execute them, i.e. native code. Unless you are using an interpreter on purpose. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
I love writing assembly, just can't find an excuse too. I really do believe assembly should be learned by all CS students very early on. It sheds a whole lot of light on what's really going on with the computer and makes you very jaded about claims of new technology (since you know that it's all just assembly in the end.)
Joe Woodbury wrote:
I really do believe assembly should be learned by all CS students very early on
Hear hear. I did 68000 assembly at Uni, and loved it. I still have a real fondness for it.
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
-
you really think .NET is good for web??? do you mean the c# language or the .NET runtime? if you mean c# then sure it's a nice language and works well for many tasks including web if you mean, however, .NET is good for web then i would respectfully say you are talking from the wrong end of your body ... .NET is the antithesis of what the web is about and consequently sucks at it ... the web is not the desktop and should not be treated as such ... just because someone can write a desktop app does not mean they can write a web app ... completely different problem domain with different rules and constraints that need to be understood properly to write a good web app (website / service / etc) would you think it a great idea to use say php to write desktop apps? that a good javascript programmer would necessarily be a good c++ programmer for desktop environments? no the inverse is true as well /end_rant
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
l a u r e n wrote:
you really think .NET is good for web??? do you mean the c# language or the .NET runtime?
if we're going to be pedantic, then i mean .Net + C# + ASP.Net + IIS + every other thing that's required to accomplish what everyone means when they say something like "using .Net for web apps".
l a u r e n wrote:
.NET is the antithesis of what the web is about and consequently sucks at it
i encourage you to read what i actually wrote.
l a u r e n wrote:
would you think it a great idea to use say php to write desktop apps?
i have no idea what you're talking about, now.
-
I have some limited experience with C# and VS 2008 and I don't understand why the .Net framework is so popular. It is a meta environment running on top of the operating system just like Java and the non-Windows implementations do not have all of the capabilities of the Windows version so it's not truly cross platform. I don't see why -- other than Microsoft's semi-forcing the issue -- someone would choose to use this. Shouldn't Win32/64 code run just as well, if not better, since there is no runtime between the code and the system? I can't help thinking of Java or even UCSD P-System Pascal when I look at this. I realize .Net has a large amount of built-in functionality but the same thing could be implemented in native code as well. What am I not seeing here?
It's really not popular at all. The latest batch of relaesed wikileaks documents shows that it's a plot by the government to distract everyone while they conduct covert operations all over the world. Nobody is safe. NOBODY! Why did the farmer cross the road?
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001 -
It's really not popular at all. The latest batch of relaesed wikileaks documents shows that it's a plot by the government to distract everyone while they conduct covert operations all over the world. Nobody is safe. NOBODY! Why did the farmer cross the road?
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001John Simmons / outlaw programmer wrote:
Why did the farmer cross the road?
To get a better vantage point to line up the sites on the chicken.
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
-
John Simmons / outlaw programmer wrote:
Why did the farmer cross the road?
To get a better vantage point to line up the sites on the chicken.
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads
Pete O'Hanlon wrote:
To get a better vantage point to line up the sites on the chicken.
You are not allowed to misspell the weapons parts when John is around!
There is only one Ashley Judd and Salma Hayek is her prophet! Advertise here – minimum three posts per day are guaranteed.
-
I have some limited experience with C# and VS 2008 and I don't understand why the .Net framework is so popular. It is a meta environment running on top of the operating system just like Java and the non-Windows implementations do not have all of the capabilities of the Windows version so it's not truly cross platform. I don't see why -- other than Microsoft's semi-forcing the issue -- someone would choose to use this. Shouldn't Win32/64 code run just as well, if not better, since there is no runtime between the code and the system? I can't help thinking of Java or even UCSD P-System Pascal when I look at this. I realize .Net has a large amount of built-in functionality but the same thing could be implemented in native code as well. What am I not seeing here?
On comparison, native memory management requires care, and MFC is a pain. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]