A. Stepanov on the STL
antiquark.com
antiquark.com
> Java is a very new language
:-)
I really love this quote
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.
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.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.
Concepts were one of the most expected features of C++0x, the one that got just recently dropped from the consideration due to being "not ready".
Alt-Shift-T for refactor. Select "Generate Hash-code and Equals".
Generally speaking, Eclipse gets it correct. Implementing equals properly boils down to following a set of rules - something that computers are exceptionally good at.
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.
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).