-
Notifications
You must be signed in to change notification settings - Fork 81
Using scopes explicitly in code
gfranz edited this page Apr 15, 2014
·
7 revisions
Railo has delivered very many presentations about performance and code readability. Here is what they recommend to any of their customers and programmers:
- Scope everything BUT the closest scope
- In Functions this is the local scope
- In templates it is the variables scopt
- The above two do not scope
This is a simple rule to follow and therefore it is easy to understand. In order to support this pattern in Railo, just turn off scope cascading and that will help you scope accordingly.
In general unscoped variables are slower. In Railo the difference between using vaiables.var in comparison to just var is not too bad so it really doesn't matter, but as a general rule of thumb:
Scope everything, except the closest scope.
- Getting to know Railo Server
- Railo Server features & specifications
- Getting started with Railo Server
- Installation & configuration
- Railo Server Versions
- Developing with Railo Server
- Deploying Railo Server apps
- Managing Railo Server apps
- Railo Server Extensions
- Useful resources & further reading
- Developing & debugging Railo Server
- FAQs