Possible Reason Behind Version Hop to Windows 10: Compatibility
First time accepted submitter ndykman (659315) writes The Independent reports that a MS developer has suggested a real reason behind the Windows 10 name: old code. More specifically, code that looks for "Windows 9" to determine the Windows version. Fine for Windows 95 or Windows 98, but not so great for a new operating system. The article includes a link that shows that yes, this would be a problem.
If something as stupid as the name of the operating system can trip up some applications, what about the rest of the code?
Instead of giving programmers dozens of ways of checking and doing things, they should be forced into doing it one way. Easier to prevent mistakes, check for errors, etc.
Get free satoshi (Bitcoin) and Dogecoins
Because only Java attracts bad programmers? Or is it simply observation bias? Certainly Java is not the only language which can give you the OS name.
they should have just changed the whole name from "windows" to "Balmers gone, and its safe to us windows again, please come back".
Some drink at the fountain of knowledge. Others just gargle.
Shame there's not some method for inserting plain text into code that will explain what you're doing, but has no effect on the actual compiled application. Maybe we could call them comments or something.
Or maybe there's some way of referencing a number, but with a name which describes what the number is so that it can be reused. It's be great if you could guarantee that the number couldn't be changed. Hmm, what could we call that?
And looking at the code examples like 90% of the cases where in the Java sources.
Exactly.
The problem isn't Windows, the problem is incompetent programmers. Instead of calling the proper API to get the version number, morons are doing things like
if (os.startsWith("Windows 9")
Considering the industry move to 64-bit (how long ago now?), how easy is it to get a 16-bit DOS or a 32-bit Windows app to run in a 64-bit *NT* environment?
Between 16 and 32 bit, you had (for 9x) the fact that the kernel was actually 16-bit but could address a 32-bit address space, for 32-bit NT systems you have WOWExec (a DOS VM with a shared memory space) but for running 16-bit apps on 64-bit platforms you have to go one step further than a compatibility subsystem (ie WOWExec) and run the app in a third party sandbox - or virtual machine, if you will - such as VirtualBox running a dedicated DOS or 9x session in a segregated memory space. Other esoteric limitations particularly in 64-bit Windows versions prompted Microsoft to issue an update which included zero-length root files (AUTOEXEC.BAT and CONFIG.SYS among others) in August 2010.
Long story short, if you're running into problems with "Windows 9" it's nothing to do with pulling a version number, you're trying to make a 64-bit system do a 16-bit thing which it was clearly not meant to do and will fail spectacularly anyway.
Political debates have me rolling my eyes so much I think I got optical whiplash. I should sue. - Foamy The Squirrel
You're assuming that people always ask Windows what version it is by using the appropriate API (i.e. GetVersion[Ex]). In practice, they do all kinds of creative things, especially when they realize that GetVersion can lie to them when run in compatibility mode or (starting with Win8.1) based on what they declared in their manifest, but they think that they really, really must know the actual version number (they never actually do need to know, and it inevitably leads to breakage in some future version, but people keep trying). And then you have people doing things like system("ver"), or trying to look up system DLLs and get their version info, or read resource strings from them etc.
If you'd actually look at the example provided, this is generally modern applications looking for Windows 9x versions in order to throw an error, and they did it in a time when "Windows 7" and "Windows 8" are actual things that really exist, not a nebulous time where MS was changing its naming format every couple releases.
The very first example is a fork of OpenJDK 6, and it appears to be code carried over from the original, not new code. Another result was from OpenJDK 1.7, so this is more than likely poorly written code that has simply never been a problem before.
People would probably blame Microsoft if all Java apps broke on Windows 9, even though it was Java's shitty programmers that did the deed, and really lots of programmers do stupid stuff like this and would blame MS for it. Unlike most bugs, MS doesn't really have any option but to change its name to fix this for software developers. It's not like a dev relying on the buggy behavior of an API that MS can work around for them. This is wide scale, pervasive shitty programming in third party programs that spans more than a decade, and Microsoft gets to deal with it.
Security is mostly a superstition... Avoiding danger is no safer in the long run than outright exposure. - Helen Keller