且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Visual C ++ 2010中编写TCP/IP聊天应用程序

更新时间:2023-10-17 21:45:40

没有偏见很难回答,我也不想引发一场火焰大战.

我认为,.NET更加容易,您需要的手工工作更少,需要更多的了解. MFC很老,对我来说,它已经过时了. .NET充满了现代思想. MFC和Windows API具有很多遗留问题,包括遗留错误. .NET非常清晰.有些库是基于Windows遗留的,并且存在遗留问题(例如System.Windows.Forms,它不是ISO或EMCA标准的一部分,但是由于Mono软件,它可以移植到许多系统中;在Mono上运行我的Windows应用程序而无需重新编译).

CLR已成为ISO和ECMA标准;图书馆的基本部分; MFC…甚至不提它.

是的,.NET有时比MFC和本机Windows慢,但这主要是因为它是Windows上的额外一层.当Microsoft从头开始开发Singularity OS时( http://en.wikipedia.org/wiki/Singularity_(operating_system) [ ^ ]),目标是安全和性能被完全忽略了.但是,在衡量性能时,它击败了Windows,甚至在某些方面甚至超过了Linux.那是沉重的遗产.奇异性基于直接位于HAL上的纯CLR.

此外,我希望Windows会逐渐退出市场,但是.NET不会终止.将.NET用作新系统的基础有不同的方向. MFC甚至都不是生存之选.

(顺便说一下,我个人在原始Windows API级别上进行了非常广泛的开发.对于UI,即使我尝试使用MFC进行开发,我什至没有考虑MFC -它可以工作(但是,我广泛使用了STL).我使用了Delphi.而是加上原始的Windows API.)

让我们看看其他专家是否有不同的看法.我必须承认我几乎以自己的方式做所有事情...

—SA
It''s hard to answer without any bias, and I don''t want to sparkle a flame wars.

In my opinion, .NET is much easier, you need less manual work, more understanding. MFC is very old, to me, it''s obsolete. .NET is full of modern ideas. MFC and Windows API has a lot of legacy, including legacy bugs. .NET is very clear. Some libraries are based on Windows legacy and carry legacy problems (such as System.Windows.Forms, it''s not a part of ISO or EMCA standard, nevertheless it''s done portable to many systems, thanks to Mono software; I run my Windows applications on Mono without recompilation).

CLR is made ISO and ECMA standard; fundamental parts of the library too; MFC… don''t even mention it.

Yes, .NET is sometimes slower than MFC and native Windows, but this is mostly because it is an extra layer over windows. When Microsoft developed Singularity OS from scratch (http://en.wikipedia.org/wiki/Singularity_(operating_system)[^]), the goal was security and performance was completely neglected. Nevertheless, when performance was measured, it beat Windows and in some criteria even Linux. That is a weight of heavy legacy. Singularity is based on pure CLR sitting directly on HAL.

Besides, I hope that Windows will gradually leave the scene, but .NET is not planned for termination; there are different directions where .NET is put as a basis for new systems. MFC is not a candidate for survival even remotely.

(By the way, I personally developed very extensively at the level of raw Windows API. For UI, I did not even consider MFC even though I tried to develop with MFC — it works (however, I used STL extensively). I used Delphi instead. Plus raw Windows API.)

Let''s see if other experts say different opinions. I must admit I do almost everything in my own way…

—SA