iRules Style Guide
Updated Jan 11, 2023
Version 3.0Was this article helpful?
Hi Jason,
you may review your topic 10.), since it provides slightest false information. I assume you accidentially just mixed up || vs. && with eq vs == in on scentence?
"eq" or "ne" is different from "==" or "!=".
"==" or "!=" should only be used for numeric comparsions only
"eq" or "ne" should be used for string comparions.
Examples of the math behind == comparsions:
1 == 1.0 is true
1 == 0001 is true
1 == "0x0000001" is true
1 == "\n\n\n\t\t\t1.e0\n\n\n" is also true
1 == 1.000000000000000031337 is also true
10 == 012 is also true
Beside of this using "eq" to compare "strings" is faster than comparing them with "==" (since no shimmering is involved).
The difference of || / && vs. "or" / "and" are not that huge. I consider the differences as personal preferecens... 😉
Cheers, Kai