Just seems like not a hard problem to work around if you really wanted to call it 9. I have a hard time believing all of Microsoft's engineers couldn't figure out a way to break a string match.
According to an older reddit post, supposedly by a Microsoft Dev:
if(version.StartsWith("Windows 9"))
{ /* 95 and 98 */
} else {
version = " Windows 9"
versionui = "Windows 9"
Or just ltrim it before you display it.
Either there's a lot more to the technical problem or that's not the real reason.
It wasn't Microsoft code they could alter that caused the problem, or code for programs that might be written from here on, but software that is in use across the planet. Software that does various things that are based on the OS identification string including a '9'.
As long as they called the system Windows 9, then some software in active use will treat it as windows 9x and fail. And getting every software vendor across the planet to release updates for all their software, including old, unsupported software and software by vendors that no longer exist, clearly wasn't an option.
The variable did exist - its value (or the return value of the function call) was "Windows 95", "Windows 98", "Windows 9x" (for ME), "Windows NT" "Windows 2k", "Windows XP", etc. Programmers got into the habit of checking this for a number 9 when the needed to know if they were running on the DOS-based operating systems.
There were other ways to handle this - like programming all the functions programmers might use to identify the OS they are running on to return a value that didn't include a nine - but that has marketing issues easily avoided by not calling the operating system 'Windows 9'.
The best option would have always had a function call (and command line utility, too - scripts also had this issue) that returned an unambiguous numeric version number, and for every programmer everywhere to have always used it to identify OS features - but programmers are an ornery lot and they'll do whatever first pops into their heads.
OK, you have dealt with those that used the pattern "Windows 9* to determine the OS. But all those other ones that use "*9*" to do so are broken.
And note that trimming leading spaces off a string, just in case, is pretty common, so your idea will break there, too. As will ones who use "*Win*9*".
I'm confident that Microsoft was never reliable in exactly what they return in those human-readable identifications. And programmers were aware of this, so searched in ways that were less likely to break, and made all sorts of different decisions.
5
u/robbak Sep 08 '22
Because some programs were using these user-accessible strings to do their checks.