← Назад к статьям
Object-Oriented Programming In The Thoughts And Experiences Of Ice-Hockey Player
There are several significant paradigms in programming — approaches that determine how programmers structure and organize their code.
For example, procedural programming is the most straightforward approach. Programs are organized as chains of commands or procedures that are executed sequentially. For example, a culinary recipe is similar to a program written in the procedural programming paradigm. A recipe is a set of instructions that must be executed strictly to get the finished dish.
There is functional programming. This approach is based on the concept of mathematical functions that take input data and return a result. Suppose you have written a letter and want to translate it into another language, check it for grammar and spelling, and then print it out. In functional programming, each step can be a function, and each function always returns the same result given the same input data.
One of the most popular approaches is object-oriented programming, OOP, where code is organized around objects and classes. Many programming uses the object-oriented approach, and beginners should understand in detail what the scary words “polymorphism,” “encapsulation,” and other terms used in this paradigm mean in practice.
In this article, I will talk about the key concepts related to OOP. In the example of Python code, I will analyze how the same task can be successfully solved using procedural and object approaches. But let’s start, traditionally, with the basics, and the fictional hockey player Ivan will help me with this.
For example, procedural programming is the most straightforward approach. Programs are organized as chains of commands or procedures that are executed sequentially. For example, a culinary recipe is similar to a program written in the procedural programming paradigm. A recipe is a set of instructions that must be executed strictly to get the finished dish.
There is functional programming. This approach is based on the concept of mathematical functions that take input data and return a result. Suppose you have written a letter and want to translate it into another language, check it for grammar and spelling, and then print it out. In functional programming, each step can be a function, and each function always returns the same result given the same input data.
One of the most popular approaches is object-oriented programming, OOP, where code is organized around objects and classes. Many programming uses the object-oriented approach, and beginners should understand in detail what the scary words “polymorphism,” “encapsulation,” and other terms used in this paradigm mean in practice.
In this article, I will talk about the key concepts related to OOP. In the example of Python code, I will analyze how the same task can be successfully solved using procedural and object approaches. But let’s start, traditionally, with the basics, and the fictional hockey player Ivan will help me with this.
Читать полностью на medium →
08.09.2023