r/programming • • Aug 20 '20

Announcing TypeScript 4.0

https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/
1.3k Upvotes

236 comments sorted by

View all comments

Show parent comments

127

u/Poltras Aug 20 '20

Microsoft has a weird history with version numbers... Windows 9 would have broken a LOT of backward compatibility because people did version[0] == '9' to check if you were running Windows 95/98... So they skipped it for Windows 10.

76

u/[deleted] Aug 20 '20

[removed] — view removed comment

60

u/delorean225 Aug 20 '20

Frankly, Windows 10 deciding to jump everything to the same round number at once seems good to me. Sort of a reset.

20

u/DHermit Aug 21 '20

Yeah, skipping numbers is no big deal. At least the numbers increase strictly monotonically.

→ More replies (1)

5

u/jbergens Aug 21 '20

They are doing it again with DotNet which will be version 5 soon but that is actually DotNet Core which had the previous version 3.1. Since DotNet Framework was at 4.8 they jumped to 5 (and replaces both versions).

→ More replies (1)

138

u/[deleted] Aug 20 '20 edited Aug 20 '20

That's an anecdote, ironically originated from another reddit comment.

Windows 95 and 98 reported itself as 3.95 and 3.98 to remain backwards compatible with windows 3 apps. So that prefix check never would have worked.

98

u/kevincox_ca Aug 20 '20

version[2] == '9'

Checkmate.

26

u/everythingiscausal Aug 20 '20

But now you’ve got an index out of range bug on Windows 10!

31

u/kevincox_ca Aug 20 '20

I believe you mean Windows 3.10 🤓👈

(Also assuming a c-string you would get the null byte so perfectly safe anyways)

4

u/SemiNormal Aug 21 '20

Can't wait until Windows 3.11 is out! 😉

→ More replies (2)

56

u/sparr Aug 20 '20

Here's some code from the Jenkins CI project (one of their official plugins, to be precise) that would have thrown an assertion for "windows 9" (which wouldn't have had a version starting with "4.1"), and when assertions were disabled would have identified it as windows 98.

https://issues.jenkins-ci.org/secure/attachment/18777/PlatformDetailsTask.java

        if (name.startsWith("windows")) {
            name = "windows";
            if (name.startsWith("windows 9")) {
                if (version.startsWith("4.0")) {
                    version = "95";
                } else if (version.startsWith("4.9")) {
                    version = "me";
                } else {
                    assert version.startsWith("4.1");
                    version = "98";
                }

0

u/[deleted] Aug 20 '20

[deleted]

47

u/funguyshroom Aug 20 '20

Congrats, you found a bug in an 11-16 year old piece of code

6

u/InertiaOfGravity Aug 21 '20

That's an accomplishment

18

u/sparr Aug 20 '20

Good catch. I had not noticed that. I agree, it looks like that bug overrides the one I was pointing out :)

14

u/AboutHelpTools3 Aug 21 '20

When a bug saves you from another bug.

→ More replies (1)

6

u/PaintItPurple Aug 20 '20

Nah, that's a bug. Though it doesn't really invalidate the comment's point, since main source of the bug is just reusing the name variable, so the "windows 9" bug would still exist even if that one were fixed.

24

u/herpington Aug 20 '20

That is one ugly OS version detection.

→ More replies (1)

13

u/chylex Aug 20 '20

The original anecdote was startsWith("Windows 9"), and if you search for that you will find real code that uses this to check for Windows 9x.

5

u/thenextguy Aug 20 '20

That assumes the programmer that is checking the version has a clue how to do it right.

→ More replies (16)

19

u/ProgramTheWorld Aug 20 '20 edited Aug 20 '20

I’ve seen this explanation floating around the Internet a lot. Is that the official rationale from Microsoft or is that just speculation? The version number of Windows 95 is 4.0 and Windows 10 is 10.0, so it doesn’t seem right to me.

9

u/[deleted] Aug 20 '20

Windows 8.1 has version number 6.3.

4

u/uh_no_ Aug 20 '20

xbox->xbox360->xbox 1 ???

5

u/zephyy Aug 21 '20

xbox -> xbox 360 -> xbox one -> xbox series x

i'm not joking. the new one is literally called "xbox series x".

→ More replies (2)

14

u/AttackOfTheThumbs Aug 20 '20

MS is the fucking worst for version numbers. Everything has multiple version numbers.

Report Builder 3 is also v 12 and 2014 (or something stupid like that). It has to do with being tied to SQL Server, but honestly, that's a poor fucking excuse. Then they also often have marketing names on top of that, like fall release 2020. Great, now what fucking version is that you cunts?

I work with MS daily, so trust me when I say, fuck their nonsensical versioning.

→ More replies (2)
→ More replies (14)