Discussion of article "The Basics of Object-Oriented Programming" - page 2

 
Urain:

By the way, I am surprised that such fundamental paradigms are not covered in the description of OOP in the help.

This is not OOP, but a consequence of its application in your perception of models.
 
Urain:

1 Nah, it's not, it's the use of inheritance.

2 is warmer, it's Composition, which is one of the three binding options, along with Association and Aggregation.

By the way, I'm surprised that such fundamental paradigms are not covered in the description of OOP in the help.

These are programming tricks rather than direct OOP features.

Regarding aggregation:

In object-oriented programming, aggregation (also called composition or inclusion) refers to the technique of creating a new class from existing classes by nesting. Aggregation is also often spoken of as a "membership relation" along the lines of "a car has a body, wheels, and engine".

The nested objects of a new class are usually declared private, making them inaccessible to application programmers working with the class. On the other hand, the class creator can modify these objects without disturbing existing client code. In addition, replacing nested objects at runtime allows you to dynamically change the behaviour of the program. The inheritance mechanism does not have such flexibility, because restrictions are set for derived classes, which are checked at the compilation stage.

On the basis of aggregation the method of delegation is implemented, when a task assigned to an external object is delegated to an internal object specialised in solving tasks of this kind.

http://ru.wikipedia.org/wiki/Агрегирование_( programming)

So this is the spirit of OOP that permeates all OOP.
 
sergeev:

Open the help on structures. and also read type conversion, about structures.

The members of methods were available from the very beginning. Why do you want to remove them?

IMHO, you have me confused with someone else.
 
Urain:

Association and other ways of linking classes.

Well, what is it for ) . Here are patterns is yes, but it is not the level of beginners.
Integer:

One point:

m_size.

The prefix m_ in common naming conventions is prefixed to class data-members. It is intended mostly for explicitly distinguishing local variables from class data in methods.

Документация по MQL5: Основы языка / Переменные / Локальные переменные
Документация по MQL5: Основы языка / Переменные / Локальные переменные
  • www.mql5.com
Основы языка / Переменные / Локальные переменные - Документация по MQL5
 
Integer:
Is it possible to write functions in a structure? Probably pointers to a class - I've seen it, tried it, it's better not to know about it.
Try it - you can write and call them. And you should.
[Deleted]  
Urain:

Why are the codes not run through the styler?

It will be difficult for a newcomer to read, he sees one style in ME and another in the article.

ZY The article doesn't reveal the issues of class connection.

In general, of course, OOP is a complex topic, it is not easy to describe it in simple language, but you have to start somewhere.


source style corrected
 
good article...make me easy to understanding about OOP, thank you..
 
TheXpert:
Well, what is it for? Patterns are yes, but this is not the level of beginners.

One moment:

m_size.

The prefix m_ in common naming conventions is attached to class data-members. It is intended mostly for explicitly distinguishing local variables from class data in methods.


The m_ prefix was used when programming under MFC, applied to private and protected variables, there are no other "generally accepted" conventions. After MFC left the scene, everyone forgot about all these stupid m_, thank God )). If you don't believe - download the examples and see for yourself (there is a section on MFC too) http://archive.msdn.microsoft.com/vcsamples.

Visual C++ Samples and Related Documentation for Visual Studio 2010 - Home
  • archive.msdn.microsoft.com
French, German, Italian, Japanese, Korean, Russian, Simplified Chinese, Spanish, Traditional Chinese The Microsoft Visual C++ 2010 Sample Library provides code examples for applications and tools showing the capabilities of Visual C++ and the libraries and technologies it supports. Visual Studio 2010 Samples are now live! Click on the links...
 
VDev:

The prefix m_ was used when programming under MFC, applied to private and protected variables, there are no other "generally accepted" conventions. After MFC left the scene, all these stupid m_ have been forgotten, thank God )) Those who don't believe - download the examples and see for yourself (there is a section on MFC too) http://archive.msdn.microsoft.com/vcsamples.

No. При чем тут MFC? https://ru.wikipedia.org/wiki/%D0%92%D0%B5%D0%BD%D0%B3%D0%B5%D1%80%D1%81%D0%BA%D0%B0%D1%8F_%D0%BD%D0%BE%D1%82%D0%B0%D1%86%D0%B8%D1%8F

is convenience and nothing more. Every programming company may have its own rules.

Венгерская нотация — Википедия
  • ru.wikipedia.org
Суть венгерской нотации сводится к тому, что имена идентификаторов предваряются заранее оговорёнными префиксами, состоящими из одного или нескольких символов. При этом, как правило, ни само наличие префиксов, ни их написание не являются требованием языков программирования, и у каждого программиста (или коллектива программистов) они могут быть...
 

Very necessary article!

I suggest developers to create a new category for articles. Something like "Fundamentals (theory) of programming"....