The JADE 2022 release meets tomorrow’s business demands.
To alleviate some of the issues for which we'd like method overloading, it'd be useful if we had the ability to specify default method parameter values.
Like other languages, this would apply to trailing method parameters only.
This will help us in scenarios where we need to update a common method to support/use a new method parameter, for which we'd currently need to change all method references simultaneously to supply a value for the new parameter. If we had the ability to set default method parameter values, new parameters could be introduced with a default value matching the original behaviour, after which we'd be able to gradually update method references to use the new options if applicable.
I just came onto JEDI to raise a similar idea. I am in the process of updating 57 methods and it would be great if I could just put a default parameter value in and then go and change the couple of methods where this differs from the default. This is one of the reasons I try to avoid adding parameters to methods with a lot of references because it is so mundane and time consuming, I think of every alternative before I bite the bullet and realise that adding a parameter is the only way. Maybe a simple way this could work is you right click on a method and select 'Add parameter with default value on references', you specify the parameter name and type then put in what you want the default to be. Might be a null, false, 0 etc.
Attachments Open full size