CFML may not support “final” but Lucee does
Sure not for variables
But there are good reasons Java only support this for final variables, in a static language like java you you only have to link the variables that are used within the anonymous class and in order to link them you have to make surethey are final.
In Lucee you have to link all the scopes, this add a lot of overhead and even worse it completely breaks encapsulation, because you implicit links everything, not explicitly a couple of variables.
In short the concept from java cannot be adapted to Lucee.
In Lucee we have 2 places where we produce an overhead i really really hate, but we cannot avoid.
- the function queryExecute always set the attribute “result” with the underlaying query tag, what always creates additional metadata, that is the main reason, i myself NEVER EVER use that function.
- closures and lambda function always link their birthplace, even i do not need it, i HATE that.
linking the birthplace in inline components would add #3 to my list