* MikeP, on 17.04.2011 18:57:
Use C# when you can, use C++ when you still have to.
Certainly good advice from a programmer effectiveness perspective.
But I think I'd hate for more of the "not-small" garbage collected programs
infesting the PC environment. This is not provable, it is perhaps not even
measurable in any consistent way!, but right now on my old machine, the newer
versions of Thunderbird, Firefox and Opera, not to mention Windows Update (which
is almost exotic in how many ways it just acts as malware, and its sheer extreme
inefficiency), bog things down to a crawl, a snail's pace. I think what's going
on is a subtlety that I call *the stretch effect* (he he, I guess some folks
will say that it is also a stretch as a hypothesis):
* One garbage collector based process is fine OK. As it allocates more
virtual memory than the system is comfortable with, things slow down
and the garbage collector kicks in, fixing it. Anyway, you don't get
into that situation unless it's necessary for the program.
* Two or more garbage collector based processes are Bad. As they
happily allocate more and more virtual memory the OS just obliges,
providing virtual memory at higher and higher cost (the stretching),
and goes into *trashing* behavior. In general the processes never get
to the point where their garbage collectors could have fixed things.
One problem is that each process does not see the *cost* of its allocation(s).
And another problem is that even if it did, and took that into account, one
would still have the problem of the Tragedy Of The Commons. In this scenario a
process that behaves nicely for the common good will apparently perform worse
than a greedy egoist process that just allocates for its own good.
I think a solution would have to involve both cost measure, user choice and OS
policing -- punishing the greedy ego processes, unless told otherwise by user.
But we don't have that yet. And perhaps never will. And if we did then with
costs and policing and such it would sort of introduce politics. Do you want a
communist, social-democratic or capitalist (or other) society of processes? They
compete for global resources; they can do harm, or good; they need to be
organized in some way... Me, I want to be the benevolent dictator of my PC. I do
not want my OS or other software to cut me out of the loop and make choices.
Anyway I think it would be not nice to the users to heap more garbage collector
based programs onto the PC scene (point: Microsoft has made it legally very
difficult to publish any performance measurements of .NET and .NET
applications). And yes, I'm aware that that's apparently in conflict with the
goal of making programs scriptable. I don't know any good solution to that.
Cheers,
- Alf (subjective)