3 ms·
The bigger problem I had with that snippet is the exposed string. I haven't seen the original video this is from, but I can't wonder but removing this hardcoded
by engtech 14y ago
The bigger problem I had with that snippet is the exposed string. I haven't seen the original video this is from, but I can't wonder but removing this hardcoded string was the bigger reason.
Encoded strings like this are a maintenance problem lying in wait.
How do you grep/search for it? These are all equivalent:
if (page.hasAttribute("Test")) {…
if (page.hasAttribute('Test')) {…
string test = "Test";
if (page.hasAttribute(test)) {…
string cheese = "Test";
if (page.hasAttribute(cheese)) {…