3 ms·
This is a great explanation and quick tutorial on XPath, but, like regex, don't think I'd ever use it in production code unless I absolutely had to. I'm sure I
by goflyapig 13y ago
This is a great explanation and quick tutorial on XPath, but, like regex, don't think I'd ever use it in production code unless I absolutely had to.
I'm sure I'd have fun coming up with an XPath solution, but for me, the ultimate goal is maintainability. If I wasn't 90% sure that the next person to look at that code already knew XPath, then I'd go with the Ruby solution.
Dealing with 11 lines of code in a language you know is better than dealing with 1 line of code in a language you don't (which ends up forcing you to read 1000 lines of documentation and examples to understand it).