[Prev][Next][Index][Thread]

Re: Students/techniques



On 5 Jun 2000, Edward Jason Riedy wrote:
> And dauclair@hotmail.com writes:
>  - 
>  - > Does anyone have experience with less experienced programmers?  C++
>  - > hackers already know how to battle with a complex language...
>  - ...
> ...
> The baggage loads I'd expect from semi-seasoned C++ programmers ares 1) 
> don't trust the compiler, and 2) objects are packages of stuff (contain
> methods, too).  I'm fishing for examples that the Dylan / CLOS-style 
> object systems are still accessible to those people.  ...

While brushing up my C++ recently, I realised that C++ actually does have
"generic functions" in one particular limited case: overloaded global
operator methods, like operator+.  In fact, you can even reproduce Dylan's
"ambiguous method" problem by

  - defining a class C and subclass S
  - writing operator+ methods for (C, S) and (S, C)
  - calling operator+ on instances (sOne, sTwo) of S

MS VC++ catches this error at compile time, as you might expect from C++.

Now, given that C++ has unary, binary and ternary (?:) operators, it's
maybe not such a big step to "n-ary".  The tricky bit would be explaining
to them what "next-method()" does in this context (and why they'd want it
in general, I suppose!)

> I'm also fishing for any actual evidence that they're more accessible to
> beginners. 

That I'm not sure of.

Hugh




References: