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

前端 未结 14 1911
有刺的猬
有刺的猬 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:08

    That was an abstract-podcast indeed!
    But I see what they're getting at - they just dazzled by Ruby Sparkle. Ruby allows you to do things that C-based and Java programmers wouldn't even think of + combinations of those things let you achieve undreamt of possibilities. Adding new methods to a built-in String class coz you feel like it, passing around unnamed blocks of code for others to execute, mixins... Conventional folks are not used to objects changing too far from the class template. Its a whole new world out there for sure..

    As for the C# guys not being OO enough... dont take it to heart.. Just take it as the stuff you speak when you are flabbergasted for words. Ruby does that to most people.
    If I had to recommend one language for people to learn in the current decade.. it would be Ruby. I'm glad I did.. Although some people may claim Python. But its like my opinion.. man! :D

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题