教学OO [英] teaching OO

查看:65
本文介绍了教学OO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这篇文章并非严格针对Python,仍然是

我想学习其他大学教师的意见。


目前,我是''教学OO编程简介在本科生

等级。我的教学大纲这个学期包括一些Python(作为脚本语言的b $ b bb)和C ++(作为编译语言的一个例子)。

使用C ++,我一直到元编程。


我现在的问题是:你认为我应该完全切换到Python

(下次) ,并转储C ++的虚拟

类,重载和模板中涉及的所有有趣问题? (在Python中,所有这些只会

消失...... ;-))


(人们对这个NG的看法很可能是一个有点偏向

对Python,但那没关系;-)。)


对各种想法感兴趣。


祝你好运,

Gabriel。


-

/ -------- -------------------------------------------------- --------------- \

|有等待的作品,|

|哪一个人长时间不理解; [...] |

|对于这个问题,经常在答案后很长时间内到达。 |

| (奥斯卡王尔德)|

+ ------------------------------------ ------------------------------------- +

| za**@cs.uni-bonn.de __ @ /'' www.gabrielzachmann.org |

\ -------------- -------------------------------------------------- --------- /

解决方案

Gabriel Zachmann写道:

我现在的问题是:你认为我应该完全切换到Python(下次),并转储C ++的虚拟类,重载和模板中涉及的所有有趣问题吗? (在Python中,所有这些只会消失...... ;-))




不! Python作为一种动态语言比

编译语言具有一定的优势。

与C / C ++类似,在python中:

*所有函数函数指针

*所有方法都是虚拟的

*所有类都有一个虚拟表(__dict__)

*所有类型都是虚拟 ;

*因此一切都是多态的和通用的

*等


而且,在python中一个实例可以拥有它'自己的方法,所以

类/实例的区别与C ++和朋友不同。 Python的'

类更像是飞行字典。或者其他东西:)


IMO,最好继续用C ++教授OOP和

专门用于动态/解释语言以及如何可以

他们做OOP'想做的一切。

Stelios

------------- -------

PEP怎么样?


Gabriel Zachmann写道:

这篇文章并不是严格意义上的Python,还是
我想学习其他大学教师的意见。

目前,我正在教授OO的介绍编程"在本科
级别。本学期的教学大纲包括一些Python(作为脚本语言的一个例子)和C ++(作为编译语言的一个例子)。使用C ++,我一直到元编程。

我现在的问题是:你认为我应该完全切换到Python(下次),并转储所有的C ++的虚拟类,重载和模板中涉及的有趣问题? (在Python中,所有这些只会消失...... ;-)

(人们对这个NG的看法可能会有点偏向
Python,但那没关系;-)。)

对各种想法感兴趣。

最好的问候,
Gabriel。




Gabriel -


我处于类似的位置,并决定完全改为Python

。对我来说关键是我知道这些同样的学生,在某些时候,或者* b $ b及时,也会*参加几门涉及C ++的课程。用

换句话说,他们不需要这门课程来涵盖C ++,他们只需要它来获得介绍给OO编程的
,并通过切换到Python,我给了他们一个学习他们可以真正了解的环境。


如果学生不会沉浸在C ++中,否则我我不认为

我会做出转换,可能一直没有使用任何Python



$ b $蟒蛇,恕我直言,是一种很好的教学语言。在我的观察中,通过

切换到OO概念类的Python,我会说在相同的时间内我们可以轻松地覆盖
50%的材料。 br />

至于有趣的C ++问题,那些同样的学生能够在以后的课程中快速选择这些概念。 重载,对于

的例子来说,这是一个非常简单的概念,可以让那些以前花了整整一个学期的人们学习OO。


Rob


< snip>

至于有趣的C ++问题,那些同样的学生是能够在以后的课程中快速选择这些概念。对于
来说,重载是一个非常简单的概念,可以让那些曾经花了整整一个学期的人学习OO。

Rob



你好,


出于兴趣,学生们对于通过鸭子实现的多元化获得了多少感到困惑。打字和多态通过继承实现
。显然并非所有OO语言都有鸭子打字

而且它们是微妙的不同概念,可能会让学习者感到困惑。


只是一个问题,我不在教育所以我不知道最好的

方式进行结构化教育(我的老师朋友一直提醒我

这个!!)。


干杯,


Neil


-


Neil Benn

高级自动化工程师

Cenix BioScience

BioInnovations Zentrum

Tatzberg 47

D-01307

德累斯顿

德国


电话:+49(0)351 4173 154
$ b $电子邮件: be**@cenix-bioscience.com

Cenix网站: http://www.cenix-bioscience.com


This post is not strictly Python-specific, still
I would like to learn other university teachers'' opinion.

Currently, I''m teaching "introduction to OO programming" at the undergrad
level. My syllabus this semester consists of a bit of Python (as an example
of a scripting language) and C++ (as an example of a compiled language).
With C++, I go all the way up to meta-programming.

My question now is: do you think I should switch over to Python completely
(next time), and dump all the interesting issues involved in C++''s virtual
classes, overloading, and templates? (In Python, all of that would just
disappear ... ;-) )

(The opinion of the people on this NG might well be a little bit biased
towards Python, but that''s ok ;-).)

Interested in all kinds of thoughts.

Best regards,
Gabriel.

--
/-------------------------------------------------------------------------\
| There are works which wait, |
| and which one does not understand for a long time; [...] |
| for the question often arrives a terribly long time after the answer. |
| (Oscar Wilde) |
+-------------------------------------------------------------------------+
| za**@cs.uni-bonn.de __@/'' www.gabrielzachmann.org |
\-------------------------------------------------------------------------/

解决方案

Gabriel Zachmann wrote:

My question now is: do you think I should switch over to Python completely
(next time), and dump all the interesting issues involved in C++''s virtual
classes, overloading, and templates? (In Python, all of that would just
disappear ... ;-) )



No! Python, being a dynamic language has certain advantages over
compiled languages.
In analogy with C/C++, in python:
* all functions are pointers to functions
* all methods are virtual
* all classes have a virtual table (__dict__)
* all types are "virtual"
* as a result everything is polymorphic and generic
* etc.

Moreover, in python an instance can have it''s own methods, so the
class/instance distinction is different than C++ and friends. Python''s
classes are more like "flying dictionaries" or something:)

IMO, it would be better to proceed normally teaching OOP with C++ and
dedicate extra lessons on "dynamic/interpreted languages and how can
they do everything OOP''d like to".
Stelios
--------------------
How''s the PEP going?


Gabriel Zachmann wrote:

This post is not strictly Python-specific, still
I would like to learn other university teachers'' opinion.

Currently, I''m teaching "introduction to OO programming" at the undergrad
level. My syllabus this semester consists of a bit of Python (as an
example of a scripting language) and C++ (as an example of a compiled
language). With C++, I go all the way up to meta-programming.

My question now is: do you think I should switch over to Python completely
(next time), and dump all the interesting issues involved in C++''s virtual
classes, overloading, and templates? (In Python, all of that would just
disappear ... ;-) )

(The opinion of the people on this NG might well be a little bit biased
towards Python, but that''s ok ;-).)

Interested in all kinds of thoughts.

Best regards,
Gabriel.



Gabriel -

I was in a similar position, and decided to make the change over to Python
completely. Key for me was that I knew these same students, at some point
in time, would *also* being taking several courses that involved C++. In
other words, they didn''t need this course to cover C++, they only needed it
to get introduced to OO programming, and by switching to Python, I gave
them an environment to learn that they could really get their heads around.

If the students wouldn''t be getting immersed in C++ otherwise, I don''t think
I would have made the switch, and may have continued not using any Python
at all.

Python, IMHO, is an excellent teaching language. In my observations, by
switching to Python for the OO concepts class, I''d say we easily covered
50% more material in the same amount of time.

As for the interesting C++ issues, those same students were able to pick
those concepts up quickly in their later classes. "Overloading", for
example, was a pretty simple concept to grasp for people who had previously
spent a whole semester heads down learning OO.

Rob


<snip>

As for the interesting C++ issues, those same students were able to pick
those concepts up quickly in their later classes. "Overloading", for
example, was a pretty simple concept to grasp for people who had previously
spent a whole semester heads down learning OO.

Rob


Hello,

Just out of interest, did the students get confused between
polymorphism acheived through duck-typing and polymorphism acheived
through inheritence. Obviously not all OO languages have duck typing
and they are subtly different concepts which may confuse a learner.

Just a question, I''m not in education so I wouldn''t know the best
way to perform structured education (my teacher friends remind me of
this all the time!!).

Cheers,

Neil

--

Neil Benn
Senior Automation Engineer
Cenix BioScience
BioInnovations Zentrum
Tatzberg 47
D-01307
Dresden
Germany

Tel : +49 (0)351 4173 154
e-mail : be**@cenix-bioscience.com
Cenix Website : http://www.cenix-bioscience.com


这篇关于教学OO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆