This recent blog post details a new "Feature" of the Roku OS 11 Brightscript and so called "Tagging of unused variables".
Codebases I work in and libraries I use make extensive use of `_variableName` style variables to indicate that this variable shouldn't be used externally. It quickly highlights the variables to a developer which are implementation details specific to the task at hand and aren't typically exposed and relied upon outside of the component in which they are defined. It's a common convention that happens across a number of programming languages.
What is the runtime impact of using such variables? Is it only a way to tag a variable as unused and therefore any unused warnings aren't generated? Or does the VM see a variable beginning with an underscore and decide it's safe to ignore such variables even if they are used extensively.
The example in your blog post seems to relate to an unused function parameter. Does this convention only affect variables as function parameters or does it affect all variables?
You've posted to a forum for Roku users, where few, if any, will be able to help. The Developers forums are a couple of doors down the hall: https://community.roku.com/t5/Developers/ct-p/channel-developers
Thanks for the heads up! I think I've found out the answer elsewhere. But will tag that forum as the place to go in the future.
Hi,
I have the same question. What did you find out?
Thanks! Claire