POV-Ray : Newsgroups : povray.off-topic : Learning C# : Re: Learning C# Server Time
28 Jul 2024 22:16:50 EDT (-0400)
  Re: Learning C#  
From: Warp
Date: 28 Sep 2012 16:32:37
Message: <50660965@news.povray.org>
Orchid Win7 v1 <voi### [at] devnull> wrote:
> Like anything else, there are some good things, and not so good things. 
> The one that really tickles me is the author insisting that because 
> assemblies are loaded dynamically, and because CIL takes up less space 
> than machine code and is JIT-compiled, you can "drastically reduce the 
> working set of your application".

I don't even understand what that means.

I have seen several arguments in the past (but I think they have mostly
died alongside the prejudice against C++ and templates) that C++ templates
are bad because they increase code size, thus increasing memory usage.

That's one of the stupidest arguments ever. The reason is that the
alternative proposed by these critics is to use runtime polymorphism.

Yes, rather than have the same function repeated for each used type you
will have one single function that handles all the types. However, if all
your objects are dynamically allocated and dynamically bound (which is
necessary for runtime polymorphism) they will end up taking enormously
more memory than duplicating that function a few times (optimized to handle
each type statically).

In other words, their solution to the "huge" "problem" of increased code
size is to increase memory usage ten-fold in order to make the executable
binary slightly smaller. Great job.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.