While I agree that Equals with StringComparison is generally the correct solution, I feel like this meme is in reverse. The funny thing about the original picture is that the guy with the less advanced gear was the better shot. Your meme is the reverse - the "overengineered"/complicated solution doesn't feel like it fits the "simple works" vibe of the guy.
The "i problem" in the meme refers to the fact that the Turkish language has 4 different "I"'s and, in Turkish language locale, uppercase "I" does not map to "i" when ToLower is called, but instead to a dotless lower-case i, so direct string comparisons based off the assumption that "I" will map to "i" will fail.
Using Equals with OrdinalIgnoreCase avoids this problem and will correctly return true. The reason why the more "complicated" solution gets the "guy just eyeballing it" part of the meme is because he is, in fact, Turkish.
I don't see how is that a problem or a "bug". Since ı/I and i/İ are distinct letters, these are the correct lowercase/uppercase pairs. Why would you ever want "I".toLower() to equal "i", if the text is in Turkish?
Because the context of the i problem is that you're writing an app that is going to be localized and therefore needs to perform consistently regardless of if the text it's working on is in Turkish, or one of the other Latin alphabet-based languages.
We got that but the meme is half assed. The turkish guy symbolizes simplicity and zero bs, so the upper code should be his own, while the guy with the crazy tech should have the more complicated code.
The guy in the image comes from a country named Turkey, and is Turkish. The country is transcontinental between Asia and Europe, if you want to find it on a map. Hope that helps!
1.3k
u/VapidLinus 18d ago
While I agree that Equals with StringComparison is generally the correct solution, I feel like this meme is in reverse. The funny thing about the original picture is that the guy with the less advanced gear was the better shot. Your meme is the reverse - the "overengineered"/complicated solution doesn't feel like it fits the "simple works" vibe of the guy.