Why the claim that c# people don't get object-oriented programming? (vs class-oriented)

前端 未结 14 1901
有刺的猬
有刺的猬 2021-02-07 12:15

This caught my attention last night.

On the latest ALT.NET Podcast Scott Bellware discusses how as opposed to Ruby, languages like c#, java et al. are not truly object o

14条回答
  •  粉色の甜心
    2021-02-07 13:10

    Maybe they are alluding to the difference between duck typing and class hierarchies?

    if it walks like a duck and quacks like a duck, just pretend it's a duck and kick it.

    In C#, Java etc. the compiler fusses a lot about: Are you allowed to do this operation on that object?

    Object Oriented vs. Class Oriented could therefore mean: Does the language worry about objects or classes?

    For instance: In Python, to implement an iterable object, you only need to supply a method __iter__() that returns an object that has a method named next(). That's all there is to it: No interface implementation (there is no such thing). No subclassing. Just talking like a duck / iterator.

    EDIT: This post was upvoted while I rewrote everything. Sorry, won't ever do that again. The original content included advice to learn as many languages as possible and to nary worry about what the language doctors think / say about a language.

提交回复
热议问题