8 years and counting, and no one ever reacted to this with a “What the heck?!?”?

I ran into an interesting and silly issue today. First, I invite you to form your own opinion about the following block of code.

source: https://github.com/microsoft/TypeScript/blob/main/lib/lib.es5.d.ts, line 53
 * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).
 * @param number A numeric value.
declare function isNaN(number: number): Boolean;

Go ahead — stare at it for a bit. Think about what this function is supposed to do. Read the commented description again. Then stare at it some more. At this point, I’m scratching my head and second guessing myself, with a “What the heck?” thrown in for good measure.

If you haven’t figured out my point yet, consider this: A rock doesn’t need proof that it’s a rock. It simply is. So… if logic serves… why would I need to test a number to see if it’s a number? Kind of defeats the whole purpose, don’t you think?

For you JavaScript purists out there, I get it: There are a thousand ways to write a number in JS. HOWEVER, with Typescript’s “strong typing”, the function ONLY accepts a number. So then what is the point of this function? Exactly — the purpose has been negated. In its current state, this function can only EVER return true. So, pointless.

I figure when I get some time I’ll create a pull request to fix this interface and function, because this is just silly. Please, feel free to beat me to it. Because this is not a good reason to use @ts-ignore.

8 years and counting, and no one ever reacted to this with a “What the heck?!?”?

Sarasota/Bradenton UG Presentation Materials

I had the pleasure of speaking to a GREAT group this evening (8/18) about Cortana. As promised, here are the materials that we covered, as well as some source code.

The actual (shortened) link: http://1drv.ms/1TSOcsD

* IMPORTANT NOTE: You’ll need Visual Studio 2015 to run the code. (Don’t worry, it’s free!)

Happy Coding! 😀

Sarasota/Bradenton UG Presentation Materials