POV-Ray : Newsgroups : povray.off-topic : Lots of statistics : Re: C# Server Time
29 Jul 2024 00:34:58 EDT (-0400)
  Re: C#  
From: Warp
Date: 13 Aug 2012 10:53:14
Message: <502914d9@news.povray.org>
Invisible <voi### [at] devnull> wrote:
>     "C# programs run on the .NET Framework, an integral component of 
> Windows"

> It tickles me that by "integral component of Windows", what they 
> /actually/ means is "quarter of a gigabyte optional download". :-P

Is there actually a version of Windows out there that does not come with
the .NET libraries out-of-the-box? (I mean newer than 10 years.)

> First of all, C# does that Java thing where it doesn't actually support 
> multiple inheritance (because that's too complicated), but it /does/ 
> support interfaces. *sigh*

I have never quite understood the reason why C++ and Eiffel seem to be
the only programming languages in existence that support multiple
inheritance, while the rest of OO languages only support a highly
crippled version of it.

If diamond inheritance is the problem, then forbid diamond inheritance.
It's not that hard. Just make the compiler say "sorry, the parent classes
cannot inherit from the same class".

And it's not like diamond inheritance is forbidden with interfaces (AFAIK,
although I haven't checked this.)

> OTOH, C# does that thing that C++ does where it's impossible to override 
> a method, unless you manually declare it as "virtual". This violates one 
> of the ideas behind OO, which is that if you've got a class that does 
> nearly what you want, but not quite, you can subclass it and change it 
> to make it do what you want. Well, no you can't, not if some of its 
> methods can't be overridden.

In C++ it's because of the policy that you don't have to pay for what you
don't use. If you make a class that needs no dynamic dispatch, then you
don't pay the price for the (unused) dynamic dispatch. (The price is
basically increasing the size of the class by a pointer, but even that
can be a drag if you are writing code that should be as memory-optimized
as possible. Also methods that could otherwise be inlined probably can't,
if they have to do double indirection via a virtual table.)

> People have criticised OOP for being ad hoc and lacking a coherent 
> theoretical foundation many times, of course. There was a time (around 
> about 1998 or so) when I thought that OOP was the ultimate answer to 
> every possible coding problem, and it was the way of the future. Today, 
> it just looks overly complex and ill thought out. Especially when 
> looking at something like C#.

Modular programming (the cornerstone upon which object-oriented programming
builds upon) is so ubiquitously useful that I can't understand how any
big project could live without it. Object-orientedness on top of it can
be quite useful as well (because it solves problems that are quite
complicated otherwise).

But you should be liking C#. It doesn't leak memory and if it crashes, it
tells you where and why. Probably.

-- 
                                                          - Warp


Post a reply to this message

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