The leaning toothpick syndrome arises if one has to escape
forward slashes. No forward slashes need to be escaped.
Pray tell us, why are comma's or hashes easier to read than
forward slashes, especially considering that forward slashes
are most commenly used as delimiters, while commas and hashes
usually play another role?
Abigail | [reply] |
As you know, "LTS" or "Leaning Toothpick Syndrome" does not always have to involve the use of the '\' character to escape the presence of another '/' character. Seeing '/\/\/\' is also an example of LTS.
Using another delimiter makes the code more readable, and is recommended by many top perl programmers (and is also covered in perlfaq, perlretut and in japhy's book). They are easier to read, because I don't have to visually and mentally separate what the content between the substitution means before I can decipher what the substituion does.
Are we not here to teach others, and share that knowledge we've learned with others who may not yet have the experience?
TMTOWTDI
| [reply] [d/l] [select] |
Are we not here to teach others, and share that knowledge we've learned with others who may not yet have the experience?
Which is exactly why I objected to the reasoning that lead
to suggesting another delimiter. It's a good thing to be
consistent, and use standards, be them mandatory, de facto,
or evolved. It's also good to deviate from the standard if
there are good reasons for it. It's not good to pretend that
subjective reasons are authoritive. I don't care if someone
prefers using hashes or commas over forward slashes when
delimiting regexes that don't use forward slashes themselves.
But I do object by suggesting the use of a de facto standard
obfuscates.
Abigail
| [reply] |
| [reply] |