Is everything an object in .NET and C#?

In .NET and C# all is object.

Simply said.

Even a value type, a struct, an interface and an enum.

One can not approve, but the point is that everything is object, except pointers/references, and literals from binary files, even CPU optimized primitive types, since it is the OOP Theory as well as the. NET specifications and therefore the facts.

Continue reading »

What are classes and interfaces in C#?

Interfaces are to make an abstraction, an archetype, of the abstraction, the classes, of the reality, the objects.

Interfaces are to specify contract terms without providing implementation provided by classes.

Continue reading »

What is polymorphism in OOP?

Polymorphism in OOP Theory is the ability to:

  • Invoke an operation on an instance of a specialized type by only knowing its generalized type while calling the method of the specialized type and not that of the generalized type: this is dynamic polymorphism.
  • Define several methods having the save name but having differents parameters: this is static polymorphism.

The first if the historical definition and the most important.

Continue reading »

What is encapsulation in OOP?

Encapsulation in OOP Theory is the process to mask some properties and operations in the class that will become inaccessible from the exterior: these are only internal things and behaviours like a digestive system.

It's a compartmentalization.

Continue reading »

What is abstraction in OOP?

Abstraction in OOP Theory consists in retaining only the relevant aspects of a real world object for a specific problem.

Thus we talk about abstraction of the reality.

It's a reduction.

Continue reading »

How to improve your knowledge of C#

Study the code of software you like that you can found for example on CodeProject, GitHub, GitLab, SourceForge, etc.

Try to make similar software and adapt them, without plagiarizing outside of personal learning, like a notepad, a calculator, a file explorer, a bank manager... or a game.

Write code, don't stop to write.

And above all, read and re-read books.

Personally, I like Wrox (Wiley) books, they are very good: do not hesitate to read even old books if newer version not available.

Online course are great too, but they don't replace books and source code or professional training.

To be able to understand advanced and in depth subjects related to programming and the nature of computers, we must go to Assembly, not only IL, but native Assembly and machine code.

Continue reading »