Joona said:
Many newbies seem to think that variables, whose type is an interface,
not a class, can't hold references to objects with a concrete
implementation. This is of course not true, but this is not what I am
writing about. If it *were* true, then what point do the newbies think
there would *be* to interfaces at all? I'm curious to hear this.
I can't speak for the newbies in this, but I suspect that part of the answer is
that, for a lot of people, when you are learning a new language (or any skill,
I suppose) you don't *expect* everything to make sense. You are aware that
your knowledge is incomplete, you feel confused about a number of issues, and,
while the sensation of uncertainty may not be very pleasant, you just keep
plugging away, trying get some work done, and hoping that it'll all become
clear in the end.
Not all people can work like that -- some people (e.g. me) can find themselves
paralysed when they don't understand things -- but most programmers are willing
to work by a mixture of guesswork, following examples, and blind hope*. (As
proof of this I submit the existence of the C++ language -- if the only people
who used it were the ones that understood it, then it wouldn't have many
users).
-- chris
[*] I should make it plain that I don't think this is a bad thing -- too many
codebases end up in a state where that's the only way that anyone *can* work,
and being able to function effectively maintaining/extending such messes is a
very useful attribute.