Classes
Sorry but, i'm new here and i was reading the documentation about classes and i really don't understood nothing, can some one explain me it?
Sorry but, i'm new here and i was reading the documentation about classes and i really don't understood nothing, can some one explain me it?
A class is a logical organizational unit that contains:
The idea of a class is that only the code from the methods performs operations on the fields of the class, and not external code.
It is good if the class is independent and does not operate on any other code/class directly setting the value of variables (fields).
The second important idea of classes is that you usually create them in a dynamic way by using the word "new". This allocates memory for the fields and calls the class constructor.
The third important feature of classes is inheritance.
If you plan the code well, you will not have to write the same code several times (or almost identical) for different classes.
Classes in MicroScript work the same way as in most other languages - e.g. javascript.