Allow overloaded actions and functions

By Isaac Blaise on 22 Mar
A developer should be able to overload actions just as he can do in c#, where a 2nd action with the same name in the same espace would have a different signature of inputs and outputs.

The visual result would be similar to that in Visual studio, where a developer can scroll through the overloaded actions as options, and see all the input / output parameters as well as other metadata for each.
J.23 Mar
Why turn outsystems into visual studio?

and it's already possible, it automaticly adds a 2 in the consumer-espace anyways, you just have to rename it to an unique name.
Isaac Blaise23 Mar
It's not my intention to turn OS into Visual Studio, only to adopt something Visual Studio got right. This...

Overloads are very easy to work with.

Is a lot easier to deal with for developers than this:

Plus, it's a very common practice
Common or not, it is typically difficult to get your head wrapped around (especially for novice programmers), and it would bite with the autoamatic type conversion the platform offers: since e.g. a Date variable gets converted to a Text input when calling an action, if you first create an Action with text input and assign a date to the input variable, then create an action with the same name with a Date input, the call to that action is suddenly replaced by a call to the other action! That would be really bad.
Isaac Blaise30 Mar
There is the risk of calling the incorrect method, but since everything is strongly typed, I don't feel this is a high risk. Also, you are right that this will most likely appeal more to experienced developers who have enjoyed that feature in the past, not necessarily beginners or even citizen developers. 

However, knowing how much I've used this feature in the past, as well as feedback from experienced developers, I feel like having the capability and being able to discuss it and train those who are less experienced will ultimately provide greater value and 'wow' factor for the platform for developers as well as users of the apps.
For one, the Platform is not strongly typed, in fact it's pretty weakly typed. For example, you can pass almost any base type in a parameter that's of type Text, and assign almost anything to a Text variable. This makes overloading very tricky (as I've described above).

Secondly, overloading is imho only useful when you can work with generics or base types. If you already know that you've got an Integer, what's wrong with calling DoSomethingToInteger, vs. DoSomethingToText when you've got a Text variable? It would be different if you have an "object", that can be an Integer or Text, and call DoSomethingToObject, and based on the run-time type of the "object" the Platform calls either DoSomething with an Integer as input, or DoSomething with a Text as input. But that's not how the Platform works...

Anyway, I can appreciate that you think you need it, I just don't think you actually do :).
This is good feedback. Here is my opinion:

By your standards regarding what is strongly typed, then nothing is strongly typed simply because it's easy enough to convert any base type to a string in any language. Strongly typing by my standards is more useful for complex types anyway, the types of which are easily validated with the platform. However, with base types, you can still write multiple functions and experienced developers will be able to take advantage of differing functionality based on the suggested types in the interface.

The second paragraph is more a matter of opinion, so I'll just venture mine: DoSomethingToInteger() or DoSomethingToText() is actually more of a pain than DoSomething(Integer) or DoSomething(Text).  Again, this is more of my opinion based on my own experience, but I think a lot of c# developers would agree.


You say "nothing  is strongly typed simply because it's easy enough to convert any base type to a string in any language". However, I'm not talking about whether it's easy to convert something, I'm talking about whether it's automatically converted. If it is, imho a language is not very strongly typed. If "myTextVar = myDateVar" is a valid statement, and "myAction(myDateVar)" is valid when myAction's parameter is of type Text, then what should the platform do when you add a myAction that has a parameter of type Date? It wouldn't know which overload to pick! And if it defaults to the "right" type, valid code could be broken once you add that action (since "myAction(myDateVar)" will now call a different function!). And let's not get into the problem of overloaded return values...

As for your second paragraph, I agree that this is a matter of opinion. Since most of the time you'll be dragging/dropping actions instead of typing, I think the longer names aren't that much of a pain, but I can appreciate your point. However, again, the platform is not aimed particularly at C# developers, so I don't think this is much of a problem. But, since this is already going on too long for Idea comments, let's just agree to disagree :).