

A. Stepanov on the STL - sfk
http://www.antiquark.com/escape/public_html/stepanovusa.html

======
davidmathers
He has a book now, Elements of Programming:
<http://www.amazon.com/dp/032163537X/>

------
huhtenberg
Boy, that's old.

> _Java is a very new language_

:-)

------
ryanpetrich
"As the chief proponent of Java at SGI told me: 'Alex, you have to go where
the money is.' But I do not particularly want to go where the money is - it
usually does not smell nice there."

I really love this quote

------
d0m
T max<T>(Comparable a, Comparable b) { if (a.compareTo(b) < 0) { return a; }
else { return b; } }

Or something..

Explicitly specifying that a and b needs to be comparable instead of shooting
an endless template error message.

And: "My approach works, theirs does not work." explains perfecly why C++ is
what it is.

~~~
sketerpot
Is that similar to this Haskell code?

    
    
        max :: Ord a => a -> a -> a
        max a b = if a > b then a else b
    

The concepts that Stepanov was talking about, where algorithms are defined for
classes of data structures supporting certain operations (iteration,
comparison, etc.), sounds very familiar to anyone who's familiar with
Haskell's type classes.

~~~
jemfinch
That Haskell code, as I understand it, will dynamically dispatch the call to
max through the Ord typeclass dictionary passed at runtime. The C++ code will
statically choose the appropriate function.

~~~
klipt
I'm pretty sure that Haskell typeclasses are also resolved at compile time.
That's why you can't have a list containing different ordered types, for
example (unless they can all be coerced to the same type).

~~~
jemfinch
No, you can't have a list containing different ordered types because the
signature for comparison only permits two values of the same exact type, not
any arbitrary member of class `Ord`.

As I said before, Haskell passes [runtime
dictionaries](<http://www.haskell.org/haskellwiki/OOP_vs_type_classes>). The
compiler can perhaps infer many cases statically, but the core implementation
is to pass around runtime dictionaries for typeclasses.

------
zephjc
Stepanov is a really smart guy, but I find his arguments that OOP methodology
is "wrong" or somehow is no good, doesn't hold water. The truth is that a lot
of the world is build on at least some OOP principles and that they have
worked for countless designs, and been included into languages by lots of
other really smart people.

It also seems like this interview was done quite some time ago (see his
comments about generics in Java) but I can't find a date.

Nevertheless, a very interesting interview.

~~~
sorbits
I think you are misrepresenting him.

He says his paradigm is “start with the algorithm” (to make it generic) and
_that_ does not work in the OO model, and as an example he gives a simple
max(a, b) function which he wouldn’t know how to write in Java.

The “OOP principles” adopted by others, which you think voids his argument,
you can argue are also used by Stepanov himself. He just calls it data
abstraction (iirc).

~~~
seancribbs
His argument actually seems to point to dynamically-typed functional
programming, which is not surprising, considering his work with Scheme.

