Experiences/guidance on teaching Python as a first programming language
Roy Smith
roy at panix.com
Wed Dec 18 20:56:45 EST 2013
In article <l8snr8$snu$1 at reader1.panix.com>,
Grant Edwards <invalid at invalid.invalid> wrote:
> On 2013-12-18, Chris Angelico <rosuav at gmail.com> wrote:
>
> > Well, okay. In C you can't have Foo.foo().
>
> If "Foo" is a structure with a field named "foo" that is a pointer to
> a function, then you can indeed "have" Foo.foo().
Sigh. This has gone off in a direction I never intended.
What I meant was that in C++, when you write call a method by name, it
can sometimes be difficult to know exactly what method is being called.
Between inheritance, optional parameters, automatic type promotion,
default constructors, and maybe a few other things I've forgotten, even
if you've got all the signatures of foo() in front of you, it can
sometimes be hard to figure out which one the compiler will pick.
And that sort of confusion never happens in C.
More information about the Python-list
mailing list