Summary 

In this chapter, we learned about object-oriented programming, which is the main essence of any high-level programming language, including C#. We learned about the four pillars of OOP, that is, encapsulation, abstraction, polymorphism, and inheritance, and understood how they help us write applications that are easy to maintain, are scalable, and have a good amount of reuse. 

We learned how encapsulation helps us in keeping our code structured by grouping together all the related properties and methods in one class. Then, we learned how abstraction helps us reduce the complexity of a module that is exposed to the entire application. Using abstraction, we can make sure that all the complexities of a class are not exposed to outside classes, which also helps us maintain the application better. We also learned how we can use both runtime and static polymorphism to implement similar functionalities that can be reused across different inputs, thus helping us reuse our code throughout the application. Finally, we learned how inheritance helps us have more control over the application's implementation. Using inheritance, we can make sure that similar classes implement a set of properties and methods that are common across them.

While writing any program in C#, it's highly important that we keep these principles in mind. The biggest mistake that some C# programmers make these days is they don't utilize these core principles of OOP programming and, instead, the program that's written resembles more of a procedural language program. From a maintenance perspective, it helps us a lot as, to some extent, it ensures that the bug fixes in one module do not impact the complete application. 

In the next chapter, we will look at the different operators that are used across C# programming. We will look at how we can manage program flow using operators and different conditional selection statements. We will also look at different iteration statements such as for and while loop, which help us control the program's flow.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.183.153