Java's Expensive String Comparison
Some folks have some rather strange superstitions when it comes to programming. Take for example Maik Schreiber's colleague. He believes that directly comparing a string variable (xmlTagName) to a string literal (“sub_name“) will make your program run as slow as cold molasses. So, to avoid this, he built a data structure with all of the possible names and, for every xml tag in the document, searched through this data structure to find the tag name, and did the appropriate action ...
[expand full text]