My approach. The core is the engine.

 

In this thread, I want to talk about my approach to programming. Be warned in advance - there will be no discussion of GUI here. If I ever talk about it, it will be only as an example of how my solutions work.

In the beginning, OOP was clear to me, and even close. I knew what "Object", "Structure", "Class" were in a philosophical context. Deepening programming into philosophy really appealed to me and ignited my interest. And I almost took up serious study... But, in the process, I felt a growing resistance. A rejection of other people's philosophy. And that rejection was growing.

I've been used to thinking philosophically since I was a kid. And I found philosophy in programming. At one point, I liked it. But, my thought invariably sought to break someone else's concept. To defeat it. To do what? - To defeat and establish my own order.

For centuries, philosophical concepts have been at war with each other. And for me, as a born philosopher, the PLO concept has become a personal challenge.


But, that's just a prehistory.

And so, it all started almost 4 years ago.

Back then, in simple procedural style, I was creating panels. And I got the idea, to combine the properties of graphical objects in one array. I thought it would be convenient. To do what?

  1. To loop through the objects and change their properties.
  2. To bind objects together.
  3. To get the values of the object properties by simple access to the array.

This is how the idea of the "kernel" was born.

In OOP, there is no concept of "kernel". OOP offers to build an ensemble of classes and structures, but doesn't give the actual centre of the program. Only a conditional one. Objects in OOP are in fact references. Means of description and access keys. The bundle of classes resembles a complex non-centralized network. OOP is grounded in building the architecture of a program. THAT IS, BUILDING THE CORRECT PROGRAM ARCHITECTURE IS THE MAIN GOAL OF OOP.

My approach, also has notions of Object. However, the "Object" in my approach, is much more real. It is an assembly of properties. In doing so, my approach ignores the importance of the specific Architecture of the program. The architecture is put together according to the requirements of program efficiency, not programmer convenience. This simplifies the syntax and reduces the number of rules.

In Nature, the concept of the kernel is present everywhere. Every cell of an organism has a nucleus. The celestial bodies have a nucleus. The Earth, the Sun. There is a nucleus in the fruit of plants which gives birth to new plants. And NEVER in Nature, Archecture is placed above Efficiency. Therefore, Nature does not create straight lines and living beings are not made of blocks. But, Man is weaker than Nature and needs memorable schemes, arrangement, classification. Man perceives the world in fragments and reproduces it also in fragments.

The concept of OOP reflects human nature very well.

But, back to my approach:

  • And so, an OBJECT is an assembly of properties.
  • The kernel is the memory space in which Objects exist.

In practice, - The kernel is a matrix. An Object is a vector.

A matrix can contain many vectors. And this is the boundary of the basic rules of my approach. Next, I will show examples of what can be done with it.







 
Immediately a question: where is the open source code?
 
Vladimir Karputov:
Immediately a question: where is the open source code?

I'll post the code and examples. This is a preface.

 
Реter Konow:

I'll post the code and examples. This is a preface.

Open source code?

 

There ! Come on Peter, I'm interested in your approach too, even without any codes (Vladimir, don't disturb the man, let's hear it first).

 
More water in a pail
 

I have a feeling of déjà vu.

But since there's not much to read at the moment, another topic from Peter will do just fine.

 

Zhenya, Vasya, you are impatient... Let the man have his say !

 
Georgiy Merts:

Zhenya, Vasya, you are impatient... Let the man have his say!

Well, why the impatience. I tell you - it's quite a topic, although this conversation Peter is probably trying to lead every polemic where he participates.

 

An example of a declaration of a graphic element represented in the Kernel:

_OBJECTS_SET,BUTTON,
//------------T------X----Y----W-----H----B_TYPE-- MOB---PXL-----------G------------C----SG--SC--OBJSCR--NEUTRAL----GRADIENT--A1--B1--C1-----------A2----B2--C2----------A3----B3--C3--------A4--B4--C4-------OBH--OBI--C5--D5--E5--------------------------------------------------------------------------------------------------------------ACT-STATUS--CURRENT-----CURRENT---LAST--------------------------------------------
//Основание кнопки--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
_NEW_OBJECT,  5,     0,   0,   100,  25,  _STRIP, _CNVS, 1,  _aw1,BUTTON,   0,_MOB,    0,    _aw1, C'245,245,245',  FR_32,  _C2C,_CNVS, 0,  FR_33,  _C2C,_CNVS, 0,   FR_32, 0,    0,   0,   A4, 0, 0,  0,    A5,0,  0,  0,  0,  0,   A6,  0,    A7, 0,       0,        0,        0,        0,       FR_32,        FR_33,       0,      0,       0,       0,         0,         0,       0,       0,   A8,  0,  0,  0,  

             A9, CLICKED_RELEASED, C'230,230,230',  0,  _C_PIXEL,  _C_PIXEL,    _C_PIXEL,    _C_PIXEL,    C'245,245,245',   _PL_END,
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//Лейбл кнопки--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
_NEW_OBJECT,  5,     0,    0,   0,  0, _LABEL, _CNVS,  0,  _aw3,BUTTON,  _EL,   0,   0,    _aw1, _NS_gr1,   A1, _X2X, _aw1,   7,   A2,  _C2C,  _aw1,  0,  A3,  0,    0,   0,   A4,  0, 0,  0,      A5,0,0, _aw1,  0,  0,   A6,  0,    A7,0,    0,        0,        0,        0,        0,        0,    0,      0,       0,       0,         0,         0,       0,       0,   A8,  0,  0,  0,  

             A9, 0, 0,   0, 0,   0,  0,    0,    0,  0,  0,  0,  0,  0,  0,     _PL_END,
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//Текст наименования кнопки --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
_NEW_OBJECT,  5,     0,   0,    0,  0,  _TEXT_, _CNVS,  0,  _aw2,BUTTON,_OCN,   0,    0,    _aw1, 0,     A1,  _C2C,_aw1,  0,   A2, _C2C,_aw1, 0,     A3,  0,    0,   0,   A4,  0, 0,  0,    A5,0,  0,  0,  0,  0,  A6,  0,  A7, 0,       0,        0,        0,        0,        0,        0,        0,      0,       0,       0,         0,         0,       0,       0,   A8,  Microsoft_JhengHei_Light, FW_NORMAL,  8,   

             A9, 0, 0,  0, C'100,100,100',   C'100,100,100',  0,    0,    0,  0,  0,  0,  0,  0,  0,   2,1,1,   1,0,  _PL_END,
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
_END_,

  1. Element declaration - _OBJECTS_SET,BUTTON,


2. declaration of an Object within an Item:_NEW_OBJECT

Next, after declaring Object there are property values. Dimensions, colours for different states, object binding to each other...


All that together is a prototype of one element - Button.

This prototype is written into the Kernel at construction stage. Then, the file of constructor is read and over these values, user values are written.

The main thing is the form of Element and Object representation in my approach. It is tabular. This allows us to compress the Object data and fit a lot of properties into a small space. If this is written according to OOP rules, it would turn into a huge mess.




 
Реter Konow:

In OOP, there is no concept of "kernel". OOP suggests building an ensemble of classes and structures, but does not give the actual centre of the program...

OOP is a very flexible methodology, so it lacks any a priori ideas like the concept of "kernel". However, with OOP you can very well build the kernel model in question here. Therefore, the statement is not entirely correct.

Reason: