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

前端 未结 14 1893
有刺的猬
有刺的猬 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 12:52

    I'll take a stab at this.

    Python and Ruby are duck-typed. To generate any maintainable code in these languages, you pretty much have to use test driven development. As such, it is very important for a developer to easily inject dependencies into their code without having to create a giant supporting framework.

    Successful dependency-injection depends upon on having a pretty good object model. The two are sort of two sides of the same coin. If you really understand how to use OOP, then you should by default create designs where dependencies can be easily injected.

    Because dependency injection is easier in dynamically typed languages, the Ruby/Python developers feel like their language understands the lessons of OO much better than other statically typed counterparts.

提交回复
热议问题