Is C # 100% Object Oriented Programming Language?

C # Supports 4 main objects of object-oriented languages:

  • Abstraction
  • Sealing
  • Polymorphism
  • Inheritance

Can you say that C # is a fully object-oriented programming language? Why?

+6
c # oop
source share
5 answers

It depends on your definition of "Object-Oriented Programming Language".
Using its definition, yes C # meets 100% of the requirements:

  • Abstraction
  • Sealing
  • Polymorphism
  • Inheritance

However, C # contains functions that are not strictly object oriented, like

  • Transfers
  • Value types
  • Static methods
  • Static classes

So, I would say that regardless of the definition you want to use, C # is not a pure object-oriented programming language.

+20
source share

No one knows what 100% Object Oriented means. C # is probably not because not all of this is an object.

Some things that are not objects:

  • Blocks of code. True, you may have an object such as Func, which is a block of code. But in some languages, all code is actually objects.
  • primitives (int, float, double, short, etc.)
  • Functions
+3
source share

A lot of features make C # not fully object oriented. However, I don’t believe that any language is 100% “object oriented” and (almost?) All languages ​​are at least a little multi-paradigm. For example, delegates. A very biased source indicates that delegates, the C # construct that I love, are not “first class citizens” among objects. Java does not support multiple inheritance, but I believe that most object-oriented languages ​​are. C ++ does, but obviously not 100% object oriented, since a 100% functional C ++ program can be easily written (just compile almost any C program). It depends more on the use of the language than on the language itself. It is oriented towards objects, but not exclusively consisting of objects, like other languages. Does the answer to this question help someone write much better code? I personally don’t think so - Richard Feynman said: "I very early understood the difference between knowing the name of something and knowing something." It doesn’t matter whether it can be called "object-oriented", like anything from Perl to Python to CIL, Ada has object-oriented functions, and C # has functions that are not object-oriented.

+2
source share

Some purists will insist that C # is not fully object oriented because it lacks multiple inheritance.

0
source share

Yes, you can say that C # is a fully object-oriented language. Think of it this way, it not only supports the four OOP criteria, but also requires that essentially all of your constructs be encapsulated in objects (enumerations or value types that are not pure OOP would not affect me as a particularly important exception), That is, C # does not allow you to develop outside the OOP methodology in any meaningful way. Where people sometimes say that the language is not really OOP, where object orientation is optional - for example, C ++, where you can develop in pure C if you want.

One note: Stephen indicates that he does not support multiple inheritance. However, this does not disqualify him: OOP does not depend on the inclusion of this function (and experience has taught us that this is, at best, a mixed blessing). It would be like a car is not a “car” if it does not have a backup camera, as some cars have them.

0
source share

All Articles