Polymorphism is supported through duck typing. You can see many examples, the last one in B4XDialog templates.But I think, will perform more with full OOP features or at least the mos used (inheritance, overriding, polymorphism, ...)
Yes and I thank you for those unique features.There are very useful features in B4X, that look "trivial" but are actually complicated and unique, such as the resumable subs, smart strings, internal wrappers, Array, CreateMap and others.
Not true. The very new Go programming language doesn't support inheritance. I haven't checked all other languages.But all high level language existing now implementing them didn't do write choices?
It doesn't work like this.Is too risky to let also developpers to choose or emit their advice through a poll for example?
You think that other reasons are not valid. I think differentlyNo other reason is really valid,
"all the features listed"? I "thought" they was "one", OOP features (I'll read it again).If I were to add all the features listed in the first post, it will be the end of B4X as a RAD programming language.
You are confusing method overloading with polymorphism. Polymorphism means that you can treat different types with the same interface. In the case of B4X it is done with CallSub and SubExist which allow you to ignore the class type.It does not support polyformism
For Each o As Object In Array(Cat, Dog, Snake)
CallSub(o, "MakeSound")
Next
public double area(double base, double altezza) {
return base * altezza * 0.5;
}
public double area(double x1, double y1,
double x2, double y2,
double x3, double y3) {
return 0.5 * (x1*y2 + y1*x3 + x2*y3 - x3*y2 - y3*x1 - x2*y1);
}
function Add(x, y : Integer) : Integer;
begin
Add := x + y
end;
function Add(s, t : String) : String;
begin
Add := Concat(s, t)
end;
begin
Writeln(Add(1, 2)); (* Prints "3" *)
Writeln(Add('Hello, ', 'Mammals!')); (* Prints "Hello, Mammals!" *)
end.
This is certain for several reasons, not only of greater simplicity of language and speed of development. But AS's IDe environment is too slow and heavy. But we didn't talk about environment but about language.However, to anyone who reads these posts and hasn't tried using Android Studio and B4A: B4A is a hundred times better than Android Studio
And this right why I don't think that adding "the missing part of OOP"But we didn't talk about environment but about language.
I also am looking forward if this feature is implemented in B4X.To avoid confusion. Polpoliformism also means the possibility that a method has an indefinite number of parameters or types. This is not possible in B4X.
This is the real problem, I thinkbut do not insist as I do not know the development complexity involved for it.
Still not foundI didn't find those posts anymore
There are ways to do that, anyway (workarounds but it is realizable).a method has an indefinite number of parameters or types.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?