Aleksey Pavlichenko

"CopyAndPaste is InformationLoss about similarity".


Comments

It's clear that:

An example of what you call "primary information" that is not impossible to regenerate would be, say, the factorization into primes of 10^73-1. That factorization has been completed, and if it were lost, it could be done again, but only with non-trivial difficulty (I believe it would take days or weeks or more of computation to factor on a single cpu these days, IIRC), so it might be pretty important to hang on to the information of its prime factors.


Information carrier:


Deterministic destructors for C#

C# and Java could be improved with reference counted destructors that force programmers to clean resources explicitly (force programmers to do duplication).

...

In my experience these days, when you have to manage limited hardware resources at the application level (as opposed to the OS level), there is almost always a second requirement of feeding the hardware some isochronous or otherwise realtime data. If that is the case, then .NET is absolutely the wrong tool for the job. If there is no realtime requirement, then you are stuck with IDisposable or a homebrew pooling system.

...

The third thing I used RAII for was cleaning up program state after an exception. In .NET, the suggested approach is to use the finally construct. I think RAII is much more elegant and maintenance-proof, but for whatever reason, they chose to go this route with .NET. I suspect it has something to do with luring in "lesser" programmers. There is a whole army of VB programmers out there who would have simultaneously gone cross-eyed if Microsoft tried to force RAII onto them. Don't forget that .NET was heavily influenced by marketing considerations.

...

I think Microsoft made a good move by using GC instead of reference counting. There are technical reasons and practical reasons. For the technical end, GC is often faster than reference counting for most applications. If tuned properly, it also leads to better responsiveness. Those are minor issues. The real win with GC is that it eliminates entire classes of programmer errors. Circular reference problems are the least of them.

So, GC eliminates several classes of programmer errors, but the absence of RAII makes it more likely that errors of another class will occur. Does it all come out as a wash then? I don't think so. Think about the average programmer who uses these Microsoft products. The average programmer probably runs into issue after issue with explicit memory management in C++. Also, the average programmer using these products has probably never heard of RAII or written any code to that pattern. The net effect is a big decrease in the number of bugs.


I was busy and away but still noted you had quite a bit of discussion related to PrimaryInformation and other pages. I am wondering whether the term PrimaryInformation in your case would have been better named differently on hindsight, perhaps FirstOrderInformation or something similar? -- DavidLiu

I agree, I think the best name would be GivenInformation?, I don't see any problem with it (unlike duplication vs derivation and DuplicationMachine vs DerivationMachine?). We could use DerivedInformation instead of SecondaryInformation, but in that case it will be logical to use derivation instead of duplication ... -- Aleksey


CategoryHomePage


EditText of this page (last edited May 4, 2008) or FindPage with title or text search