Jon Skeet - "Back to basics: the mess we've made of our fundamental data types"
Why Stack Overflow recommends it
Stack Overflow users link it when explaining why case-insensitive string comparison, floating point arithmetic, or date handling behave unexpectedly across cultures and calendars.
Recommended by 4 people across 7 different months, 2010 to 2025.
What it is
Jon Skeet's DevDay 2013 conference talk on how numbers, text and date/time handling in programming are full of pitfalls. He covers floating point surprises, Unicode and culture-dependent string behavior, and calendar oddities, with his toy pony Tony as a recurring prop.
What people said
Strong rec Andrew Morton · 2017-11 · Stack Overflow · on “VB.net Finding First and Last uppercase letter”
Using `.ToUpper()` does not always do what you expect. Jon Skeet gives a really good talk which includes the problem: Back to basics: the mess we'vw made of our fundamental data types [this video] . That link starts some way in - I recommend watching the whole thing :)
Recommends AndiDog · 2010-02 · Stack Overflow · on “What is a "tight loop"?”
There's a good example of a tight loop (~ infinite loop) in the video Jon Skeet and Tony the Pony [this video] . The example is: while(text.IndexOf(" ") != -1) text = text.Replace(" ", " "); which produces a tight loop because IndexOf ignores a Unicode zero-width character (thus finds two adjacent spaces) but Replace does not ignore them (thus not replacing any adjacent spaces). There are already good definitions in the other answers, so I don't mention them again.
Recommends Tanzeel ur Rehman · 2015-07 · Stack Overflow · on “Using operators with certain types”
It is not answer to your question, but it will clearify the sentence provided by @BenVoigt "(There's a tradeoff between accuracy and range here) ". watch the link of jon skeet prsentation title "Back to basics: the mess we've made of our fundamental data types" [this video]
Recommends Konamiman · 2015-09 · Stack Overflow · on “No February 30th, 1712 in .NET's Swedish calendar?”
At this wonderful talk about how weirdness in real life data reflects on computer data types [this video] , Jon Skeet [LINK] tells that February had 30 days in Sweden in 1712 in a weird attempt to manage leap years while adapting to the Gregorian calendar ( more on this in Wikipedia [LINK] ). Out of pure curiosity I opened LINQPad and wrote the following: var date=new DateTime(1712,2,29,CultureInfo.GetCultureInfo("sv-SE").Calendar); date.AddDays(1).Dump(); I was expecting to see an amazing February 30th but this just yields a boring March 1st. Thinking twice about it, the .NET DateTime class probably doesn't support instances with month=2 and day=30 whatsoever... but anyway, I would like to know:
Recommends Andrew Morton · 2018-07 · Stack Overflow · on “Make checking a string not case sensitive”
That idea goes wrong with some cultures, as explained in Jon Skeet - "Back to basics: the mess we've made of our fundamental data types" [this video] on YouTube. (It's best to watch it all, but the part regarding text starts at about 12:20.)
Recommends Andrew Morton · 2019-05 · Stack Overflow · on “Check if a string contains at least one of the strings stored in an array of substrings”
@Ama In some languages, ToLower() doesn't give the same character as the lowercase version of some letters: The Turkish İ Problem and Why You Should Care [LINK] . (The comments in that article are also very informative, although the link to Jon Skeet's talk on the subject (and related matters) should now link to this on YouTube [this video] .)
Recommends Andrew Morton · 2025-02 · Stack Overflow · on “How to ignore case using the Zip operator in Linq”
To account for different cultures, something with StringComparison [LINK] would be in order: Dim areEqual As Boolean = str1.Zip(str2, Function(x1, x2) String.Compare(x1, x2, StringComparison.InvariantCultureIgnoreCase) = 0). Take(100). All(Function(equal) equal) Select the appropriate StringComparison for your case. For informative and amusing interesting information on the subject, see the video by Jon Skeet Jon Skeet - "Back to basics: the mess we've made of our fundamental data types" [this video] . (It's better to watch from the start, but that's where the part about text starts.)
Cites Andrew Morton · 2021-06 · Stack Overflow · on “javascript includes() case insensitive”
Using localeCompare() [LINK] would be safer. There can be problems with plain `.toLowerCase()` - please see Jon Skeet's presentation on YouTube Back to basics: the mess we've made of our fundamental data types [this video] for more information.