iRules Style Guide
This article (formatted here in collaboration with and from the notes of F5er Jim_Deucker) features an opinionated way to write iRules, which is an extension to the Tcl language. Tcl has its own st...
Updated May 20, 2024
Version 4.0JRahm
Admin
Joined January 20, 2005
Jim_Deucker
Employee
Joined September 02, 2019
JRahm
Admin
Joined January 20, 2005
Juergen_Mang
Dec 23, 2022MVP
Great article. Most things are cosmetical, but some realy important things are mentioned also. I will highlight:
- K15650046: Tcl code injection security exposure
- Always wrap expressions in curly brackets to avoid double expansion
- iRule priorities
- the static:: behavior
I see in in the wild often scripts that violates against these best practices.
What also could be mentioned is: switch cases do not need any "return" or "break" statements, too not fall through. I saw "return" many times errorneous used in this context.