The further a society drifts from the truth, the more it will hate those who speak it. ... In a time of deceit, telling the truth is a revolutionary act. George Orwell

Sunday, October 25, 2009

Will C++ destroy Microsoft Corp.?


The last 2 weeks of struggle to install my wife's "Simply Accounting 2008 Premium Student's Ed." (SA) by Sage, on Windows XP convinced me that the answer has to be positive.

Problem.

The package installer program would crash at the end of installation. Event Log showed that the crashes were due to a missing class, message issued by CLR module from the .NET2 framework. Turns out SA was compiled using Visual Studio 2005 and uses .NET2 but some changes after 2005 (most likely .NET3.5 or some service packs) broke the compatibility. It's not just one application problem. Apparently, the same happens to Microsoft SQL Server 2005 on a fully upgraded and fully service-packed WinXP Pro. It hangs or crash on install, except when installed on a fresh un-upgraded WinXP.

Solution.

Think about Linux then uninstall in this order: .NET3.5, .NET3.0, then .net-sp2, then unistall .NET2 . If uninstallation fails at any of the stage use dotnetfx_cleanup_tool.zip (from Microsoft web site). Get rid of all .NET down to .Net1.1. Turn off automatic upgrades. Re-install .NET2 using dotnetfx_Net2.exe from Microsoft web site. Reboot. Reinstall application program. Think about Linux again.

Conclusions.

1. .NET framework issued with Visual Studio 2008 appears to break old applications that use .NET2.

2. With C++ being Microsoft's language of choice, .NET framework was introduced by Microsoft to overcome C++ inherent flaw - it's inter-modular binary incompatibility. Clearly that does not seem to be working very well. However C++ does work very well for Linux/Unix OS where applications are distributed as sources and binary incompatibility does not matter! In short: C++ + GPL = sucess, C++ + $$$ = failure!

3. Microsoft is probably not using .NET for it's own new applications, so shouldn't we either!

Microsoft used to tout like crazy ASP.NET and all .NETx.x plus a small herd of other impossible to remember acronyms like WPF etc, from every media outlet. I believe that they may have already quietly scrapped all that new Application Programming Interface garbage! Ever tried installing Internet Explorer 8 without the latest .NET3_3.5? It works like a charm, no problem! I wonder what was the truth behind the rumors of their Vista development "Reset" (code scrap & re-write) in 2005? Is that only my nagging heretical suspicion that it may have had something to do with a hypothetical major flaw in their .NET framework?

4. I have seen the future and it might just work... My view on Objective-C and C++

5. Think about Linux...

6. Why do I think that C++ is an upside-down language...
.

8 comments :

dav0sbooks said...

AFAIK all the dot net languages are translated under the hood to a common runtime language. Surprisingly I did some benchmarking in VS2005 and found VB ran faster than C++ executing the same task. The benchmark was inverting a big Hilbert matrix iteratively using conjugate gradient algorithm. The bottom line is that all the .NET bells and whistles which I neither want nor need were still imposing run time constraints on the code.

Stan (Heretic) said...

Hi Dav0,

To overcome C++ name-mangling problem, the compiler itself would have to generate the byte-codes (or whatever name for the meta-code they use). Still the error messages I was getting mentioned some missing classes in Microsoft-Speak (never clear and not up to the point).

I am curious to know how exactly did MS implemented that supposedly binary compatibility interface allowing C++ to work across independently compiled libraries, and why is it breaking down now. Is that the reason behind issuing all those new versions of .NET over the years? What has gone wrong, apart from the original "sin" of adopting C++ as the base language?

On the other hand, perhaps we shall be better off by forgetting about that Microsoft disease and learn something positive that works like Python, Objective-C, Pyjamas, Ruby etc. Did you notice that Objective-C has got a superior higher-level OO model yet it predates C++?

Amazing how nobody looked into it but a vast majority of those baby boomers programmers just followed the C++ herd...

Just like with a diet! They probably use C++, eat low fat and take Lipitor... 8-:)

Stan

Sara Reid said...

According to me, I don't think so that C++ will destroy the Microsoft Corporation. Microsoft Corporation is the environment which works on many languages, servers and ITES enabled products. One languages like c++ does not do anything to the Microsoft corporation.

Stan (Heretic) said...

Hi Sara,

Welcome to my blog! I believe that C++ does more harm than good to Microsoft, because it becomes unmanageable for large teams development due to extreme complexity that makes possible to implement even a trivial algorithms in hundred different ways that make mokery out of the idea of clarity and code esthetics. Does anyone remembers PL/I and what happened to ADA?) In addition, perhaps an even more serious falt is C++ binary incompatibility, that is you cannot develop independently-recompilable libraries and modules but are forced to work with large teams on the source code level at all time. Also, C++ rigid static-typing structure (every class is a painfully different type) does not really yield itself to binary portability across systems and networks. No remedy has ever worked! No matter what did they try to do to work-around that fault. To make that work you really need weakly typed languages or simpler languages with fewer types such as C, or better yet use dynamically typed languages.

Microsoft has made a bad bad suicidal decision with C++ a good few years ago, and now they do not have an easy way out. Anyway, not to worry, have a look at Linux.

Stan

Stan (Heretic) said...

Microsoft must rely heavily on C++ for their internal development because C++ knowledge is one of the requirement for their new hirees.

Carl M. said...

Windows still beats linux for the average user. I say this as someone who learned UNIX years before ever seeing Windows. UNIX/linux became a dead end when XWindows replaced SUN's proprietary GUIs.

C++ style object oriented programming in C was common enough in GUI programming before C++ took hold. Look up the old SunView API.

The problem with MS-Windows (and XWindows) is that they aren't C++. C++ objects are used as wrappers around cruder C objects. Xt is a nightmare. MFC is slightly less bad. (But where MFC/Windows clobbers X is: Windows does a much better job of abstracting the graphics hardware. And Windows has a consistent API for printers and displays.)

For C++ done right from the ground up, see BeOS. Alas, BeOS was never completed.

I looked into Objective C for the Mac but was grossed out by the overhead of using message passing even for low level string functions. Worse yet, reference counting is explicit. I can write a better automatic reference counter with C++ templates.

Now, if only someone would write an OS using D...

Stan (Heretic) said...

Hi Carl,

You are the first person who mentioned MFC in a "less bad" light! 8-:)

I too worked with pre C++ graphics API and they were all easier to use, I think _because_ they were written in more primitive languages not in-spite of that! I will clarify this: I think that C++ is particulary badly suited for encapsulating graphics and non-graphics API because it encourages building vertical hierarchy of objects; encouraged by misguided form of inheritance polymorphism etc. It takes real guts to resist that and keep your code tidy, manageable and understandable in spite of the C++ too rich a structure that too often misses the target.

Stan (Heretic) said...

Re: "UNIX/linux became a dead end when XWindows replaced SUN's proprietary GUIs."

Interesting, I just read a chapter from "Coders At Work" where Joe Armstrong talks about it(see page 211). He claims that it is the C/C++ library wrapper around the X Windows protocol that is ugly and too big to be easily used. The underlying "black-box" (X protocol) is based on message passing and is easier to use that the library wrapper.

Armstrong says that it is better not to bother with the API library with hundreds of objects and member functions, but instead learn about 20 messages, that is enough for a start to do things under X protocol.