Hiding class pointers -- was it a good idea?

eao197 eao197 at intervale.ru
Thu Aug 16 10:04:23 PDT 2007


On Thu, 16 Aug 2007 13:20:28 +0400, Walter Bright  
<newshound1 at digitalmars.com> wrote:

>>  From my expirience this is a problem of C++ beginners.
>
> I was talking to a person who is a C++ developer for a major game  
> company just today. He told me that it is very difficult to find  
> experienced C++ developers, hire them, or even recognize them in a job  
> interview. When you are able to hire them, they cost plenty.
>
> It's true that every problem with C++ can be solved by getting more  
> advanced C++ programmers. The problem is getting those C++ programmers.  
> And even the best ones have bad days and make mistakes <g>.

I know.
But I know that getting experienced programmer is very hard for _any_  
language. And they cost plenty.

> Defining a problem out of existence is preferable, cheaper, and more  
> reliable than depending on convention or more training.
>
> If I was paying top dollar for a programming expert, I'd rather he  
> focused his energies on something more productive than dodging C++'s  
> potholes.
>
> If I was in charge of writing software that absolutely, positively must  
> work correctly, I'll prefer a language guarantee over reliance that my  
> programmers, no matter how good they are, didn't overlook something.

I'm totaly agree with you. This is why I'm interested in D, not in C++.
But in the case with value type/reference type separation there are some  
benefits and drawbacks in the current D version. So I think that 'slicing'  
is not an important argument in defense of such separation.

Because value/reference separation it is a fundamental feature of D so it  
is better to concentrate to minimization of value/reference/pointer  
conceptions. For example, what's about removing 'reference' at all? Lets D  
has only values and pointers:

int i; // value.
int * pi; // pointer to value.
struct S { ... }
S s; // value.
S * ps; // pointer to value.
class C { ... }
C c; // Error! Value type cannot be used as value.
C * c; // OK. Pointer to reference type.

void f( int i, S s, S * s, C * c ) { ... }

-- 
Regards,
Yauheni Akhotnikau



More information about the Digitalmars-d mailing list