Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Windows Bug Operating Systems Upgrades

Possible Reason Behind Version Hop to Windows 10: Compatibility 349

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.
This discussion has been archived. No new comments can be posted.

Possible Reason Behind Version Hop to Windows 10: Compatibility

Comments Filter:
  • 11 (Score:5, Funny)

    by Jamu ( 852752 ) on Friday October 03, 2014 @06:25PM (#48059795)
    It would have been better if they'd gone with Windows 11. One better.
  • by ArcadeMan ( 2766669 ) on Friday October 03, 2014 @06:27PM (#48059809)

    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.

    • by CaptainDork ( 3678879 ) on Friday October 03, 2014 @06:34PM (#48059865)

      Ah ... grasshopper ...

      You will learn as, you progress in your journey, that convenience is a forever code.

      I give you, Y2K [wikipedia.org].

      • by PPH ( 736903 ) on Friday October 03, 2014 @07:53PM (#48060343)

        Leave it to the software industry to call the Year 2000 problem 'Y2K'. That's how they got into trouble in the first place.

        • I don't know about that. Though I lived through it, I don't know who first coined the phrase, "Y2K."

          It could have been the software industry or it could have been the hardware industry, or it could have been IT or a blogger.

      • by dbIII ( 701233 ) on Saturday October 04, 2014 @12:42AM (#48061269)
        I had a Y2K bug introduced in 2008 in Macrovison's piece of shit "protection" software, flexlm, which stopped me running the software I had paid for because a perpetual licence was dated "00" and so was the year 2000.
        The phone support guy had never heard of the Y2K bug!
        It took a week and a half to sort out and meanwhile three people in the office had to work around it instead of using the software that was "protected". And people wonder why I prefer open source software.
        • I forgot about this but ...

          I read about people hardening systems against Y2K and then testing by changing system clocks forward to "see what would happen."

          What would happen sometimes is that their license would expire and they would have to explain what they did and ask to be forgiven.

    • by thegarbz ( 1787294 ) on Friday October 03, 2014 @06:36PM (#48059881)

      Major fallacy right there. This has nothing to do with windows applications, and nothing to do with giving programmers ways of checking things.

      This has everything to do with bad programming, and no Mac and Linux are most definitely not immune from this either. Windows has an API to determine the version number, just like Linux has a way of determining it too. The problem is when programmers don't know or understand the API that things break. It's not even a case of giving programmers different ways of checking things. Different APIs are there for different reasons, the problem is idiot programmers who use the response of one API to infer information they should otherwise have gotten from another.

      • by Anonymous Coward on Friday October 03, 2014 @06:58PM (#48060025)

        The search in the article shows mainly Java applications.

        But the coding problem isn't specific to Windows. Opera suffers from this problem and so does every web browser that had a "version 10" that browser strings looked only for "1" or version 20 that looked for a "2" like Firefox.

        Opera still by default says its Opera 9.8

        But ultimately, garbage code needs to be thrown away and programmers need to stop doing stupid things like this.

      • by steelfood ( 895457 ) on Friday October 03, 2014 @07:11PM (#48060099)

        It's also rather short-sighted, not to mention lazy, to look for "Windows 9.*". I mean, Windows began with version numbers (Windows 1.0, Windows 2.0, Windows 3.0). There's no reason to think that Microsoft wouldn't go back to version numbers.

        At the very least, look for the string "Windows 95" and "Windows 98", since there are really only two versions of Windows relevant to the "Windows 9.*" search string. I know hindsight is 20/20, but this one really was avoidable by the simple principle of not being lazy (even if ignorant).

        • There was a Windows 97 as well (service pack + enhancements really), but it set the example of MS using year numbers to indicate versions.

          That fell apart with Windows ME and XP, but not Win2k. (I had uniformed people swear to me that they were on Win2K because they were running WinME)

          And back in 1999, who would have thought that Microsoft would return to major release numbers instead of using the year? If they stuck with the year nomenclature it wouldn't have been a problem for another 90 years.

          No.... this

          • by armanox ( 826486 )

            They ran into another problem with version numbers when Windows Vista came out. Because Windows XP lived so long (Windows 5.1, .2, .3, and .4) quite a few programers just checked the minor version, and saw Vista's minor as .0 and assumed it was Windows 2000, and said you must install XP to run this program.... It boils down to Microsoft having to cater to lazy developers whose programs make them look bad.

          • by AK Marc ( 707885 )
            Nope, there was never a Windows 97. There was a Windows 95 pirated version with an edited splash screen, and there was a Windows 98 version released in 97 (Win98 alpha), but Microsoft never released or badged anything as Windows 97, and no version ever identified as that internally.
      • by pz ( 113803 )

        I agree, but replace the words "bad programming" with "lazy programmers".

        It is really no different than instances of "you have 1 message(s) waiting". Back in the day, when bytes and cycles really counted, saving the execution of a statement, and the program code space associated with checking for 1 or more-than-1 was understandable, maybe even desirable, but now? The only reason is a lazy programmer.

        The disturbing part of this is that you see status text like this all the time, even in decidedly new code;

        • Maybe, but that kind of thing only ever needed to be done in a tight loop. If you're looking for the OS version by string and you're deciding between "Windows 9" or "Windows 95" there's not much difference between a nine character string and a ten character string. Plus, who is checking the windows version by string in a tight loop? Surely you would branch before or set a flag before the loop.

          Also, doesn't windows provide more reliable version numbers via api?
          --quick google search--
          Apparently, it used t

          • by armanox ( 826486 )

            Yes and no. It's been broken, as a result of lazy programmers, since Windows 7 came out. With the release of Vista (NT 6.0) Microsoft took a lot of complaints from users due to programs only really checking the minor number (if $MAJOR is >=5 AND $MINOR > 0 since 5.0 was Windows 2000) and installers as a result declared people to not have a recent enough Windows version to run $APPLICATION.

        • Even in the Windows 95 days this was both unacceptable and probably less performant than using the API that was already built in.

          I would say that this is not just lazy programming, it really is bad programming. Laziness can be bad and it can be good. This laziness is bad.

    • by K. S. Kyosuke ( 729550 ) on Friday October 03, 2014 @06:37PM (#48059885)
      Microsoft has a history of treating broken apps very gracefully; this explanation seems perfectly plausible and very much in line with what Raymond Chen writes about on his Old New Thing blog.
    • To be fair, one link cited this:
      String os = System.getProperty("os.name");
      if (os.startsWith("Windows 9") || os.equals("Windows Me")) {
      throw new RuntimeException(

      For my money, anytime Windows Me is detected you should throw an exception, a flag, and maybe a fit...
  • And looking at the code examples like 90% of the cases where in the Java sources.
    • by thegarbz ( 1787294 ) on Friday October 03, 2014 @06:38PM (#48059893)

      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.

      • I noticed the abundance of java files too, searchcode.com seems to match a whole load of Python files which don't even match the search string - go figure. However I wouldn't really call it observational bias - you run a search for a piece of text and you see a correlation in the results. The code fragment being searched for is "fairly" language neutral - it would match most CLR languages in addition to java, javascript, python etc. What's more interesting is why the OS detection is being done in the first

      • by julesh ( 229690 )

        Because only Java attracts bad programmers?

        Because only Java was designed to discourage operating-system-version-dependent code and therefore intentionally lacks a way of checking the operating system version except through a string; most other languages provide an API that gives you major & minor version numbers in integers, which is much more convenient.

    • or C# which looks almost identical to java in most cases.

    • by rudy_wayne ( 414635 ) on Friday October 03, 2014 @07:13PM (#48060113)

      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")

    • Comment removed based on user account deletion
  • Isn't there a more specific property that doesn't rely on location specific strings?

    I mean the whole friggen world isn't English.

    • by ihtoit ( 3393327 )

      programming languages are lexicon agnostic. What uses human readable commands in Business English (ie pick a 4GL, any 4GL) in America uses the exact same commands in the same programming language using the same character set in China. Apart from that, as "Microsoft Windows" is a collective trademark http://www.microsoft.com/en-us... [microsoft.com] refer to recent and not-so-recent decisions across the planet in which Microsoft lost cases claiming sole TM rights on the generic term "Windows" as it describes a plurality of

    • Re:Doh! (Score:5, Funny)

      by jellomizer ( 103300 ) on Friday October 03, 2014 @07:07PM (#48060073)

      I figured it had to do with Roman numerals.
      They skipped Windows 4 (IV) and they are skipping version 9 (IX)
      I figured there is a bug in the roman numeral check for the numbers the need to subtract before the value.

    • Yes. Microsoft provided an API for version detection.

      Developers were too lazy (or uniformed) to use it.

  • 18 years as a developer, I've never used such a shitty test..

  • I call hogwash (Score:5, Informative)

    by Excelcia ( 906188 ) <slashdot@excelcia.ca> on Friday October 03, 2014 @06:46PM (#48059951) Homepage Journal

    I call this hogwash. When you ask Windows what version it is in software, it doesn't return its marketing name (Windows 95, Windows 2000), it returns it's platform ID (1 for DOS based, 2 for NT based), and its version numbers in major, minor format. Windows 95 returned 4.0 (platform 1), Windows 98 returned 4.1 (platform 1). Windows 2000 returned 5.0 (platform 2).

    • Re:I call hogwash (Score:4, Insightful)

      by shutdown -p now ( 807394 ) on Saturday October 04, 2014 @02:54AM (#48061585) Journal

      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.

  • by reg ( 5428 ) <reg@freebsd.org> on Friday October 03, 2014 @06:49PM (#48059969) Homepage

    Windows! Nein!

    Regards,
    -Jeremy

  • navigator.userAgent (Score:4, Informative)

    by RyoShin ( 610051 ) <tukaro@[ ]il.com ['gma' in gap]> on Friday October 03, 2014 @06:52PM (#48059995) Homepage Journal

    I'm reminded of checking for browser version in Javascript when you need to hack around a limitation or non-standard here or there (especially back in the IE6 days). Anyone worth their salt said "You don't ask the browser what it is, you ask what it can do" because the easy ways to check were also easy to spoof. So it was better to see if it threw an error when you did X, or if you could access property.Y, etc., then use those results to figure out which browser you were running in. I don't think it's done as often these days, partly because of engines catching up and partly because of frameworks doing it for you.

    Anyway, I don't know how trivial it would be to spoof the system information, but relying on the system to report its proper version doesn't seem like a good idea to me. Speaking of version, code like the last link is looking at the marketing name when looking at the actual version (i.e. Windows 6.1) would be better. Maybe Microsoft should just go with the internal version number: it will cause as much marketing confusion as Windows 10, avoid the "Windows 9" checks, and make the internal/marketing names more consistent.

    • Maybe Microsoft should just go with the internal version number: it will cause as much marketing confusion as Windows 10, avoid the "Windows 9" checks, and make the internal/marketing names more consistent.

      This is not any fault of Microsoft's. The first result is from a fork of OpenJDK 6, which was released just 3 years ago, when "Windows 7" was a thing, and other results indicate this bad code has been in OpenJDK since at least version 1.7, which would be around '06-'07. God only knows how much other software out there does it this poorly.

      These aren't legacy Microsoft apps that are having issues, these are modern, popular third party apps that have been coded very poorly, and Microsoft gets to deal with it.

  • So you're telling me that Microsoft decided/had to skip a version number because of existing Java code? Rly? Srsly?
    • Seeing as the examples are for java, it's braindead before birth. Written by someone who doesn't even know that the System class [oracle.com] has ways to get the os.name, os.arch, and os.version. Funny if they think that if the test fails, it defaults to Window 7, and they try to run it on a non-windows-hosted java runtime.

  • by JoeyRox ( 2711699 ) on Friday October 03, 2014 @07:04PM (#48060061)
    Old function: GetVersion() and GetVersionEx() [for Windows 8 and older]
    New function: GetVersionEx2() [for Windows 9 and newer]

    Seems a less intrusive solution that jumping a whole major Windows revision.
    • by NoNonAlphaCharsHere ( 2201864 ) on Friday October 03, 2014 @07:16PM (#48060141)
      Fuckin' PHP programmers! You guys need to die off. How about a GetReallyFor ReallyHonestThisTimeIMeanItVersionNumber()? Or are we going to be using a GetVersionEx47() at some point?
      • by Nemyst ( 1383049 )
        PHP? You do realize APIs like DirectX have stuff like CreateDXGIFactory, CreateDXGIFactory1 and CreateDXGIFactory2, all to support new variants of the API? It wouldn't be unheard of to add another new variant, though unlike in those cases it wouldn't be to add new functionality that wasn't integrated into the old interfaces.
    • by Dahan ( 130247 )

      MS already basically did that... In Windows 8.1 and later, GetVersionEx() lies about the version number (it returns Windows NT 6.2, aka. Windows 8.0) unless the developer has specifically marked the EXE as compatible with Win8.1: Operating system version changes in Windows 8.1 and Windows Server 2012 R2 [microsoft.com].

      But this probably won't help with broken Java code though, since I'm sure Oracle will mark java.exe as compatible with Windows 9/10, and had MS not decided to jump to Win10, it would've returned "Windows 9"

    • What do you intend to pass as the result to the old functions? If you claim to still be Windows 8, then you can never deprecate any features that were in Windows 8. In that case you don't actually need to tell any calling program anything since the Windows 8 API will be present forever.

  • by ihtoit ( 3393327 ) on Friday October 03, 2014 @07:23PM (#48060185)

    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.

    • The problem isn't making sure code that worked on Windows 95 still works. It's code that wouldn't run in the DOS code tree, but will still run in the NT tree, and has code that prevents trying to run it on older systems...and, instead of checking for Windows_NT and proceeding, checked for Windows_9* and stopped.

      And, for the record, on a Windows 7 box, the OS environment variable is still "Windows_NT". Somebody out there must have a 95 (or 98) box still running that could check if it shows "Windows_95". ("ec

      • OpenJDK does it exactly like this. Instead of looking for os.name "Windows" and os.version 5.0 and throwing an error for everything else, it actually explicitly looks for "Windows 9" or "Windows ME" and throws an error if it finds them.

        So OpenJDK (and plenty of other apps like it) doesn't think it can run on Windows 9 because OpenJDK developers suck at coding, and Microsoft has to deal with it.

  • Why not just go with "Windows Nine".
  • Bullcrap (Score:2, Informative)

    by Dan East ( 318230 )

    That's a load of BS. Is there even an API that returns the "marketing" version of the OS name? I know of no way to programmatically get the text "Windows 95" or "Windows 98", etc, in the Windows API, unless I build that string myself. The APIs that return the OS version use a completely different versioning convention (one that actually makes sense and is consistent). Maybe there is some way to dig through the registry and find that, but any app doing that deserves to be broken anyway.

    Further, the exampl

    • Re:Bullcrap (Score:5, Informative)

      by Your.Master ( 1088569 ) on Friday October 03, 2014 @08:40PM (#48060545)

      Type this into powershell:

      (Get-WmiObject Win32_OperatingSystem).Caption

      There's your marketing name.

      Took about 60 seconds of Googling to not only find this, but to find it in code that was making the same sort of error we're talking about (not literally the number 9). See this: http://ss64.com/ps/get-wmiobje... [ss64.com] -- that's using the -match operator which is a regex comparison, and thus inferring whether it's a server build by a mismatch between the marketing name and the build name..

      Granted, I don't think powershell existed on Windows 95. I expect it's just wrapping an API that did exist. If it comes right down to it, the registry itself has the versioning information available to anybody who can use ctrl+f in regedit to find the key, and people do indeed do that.

      Trust me, MS doesn't give the slightest concern about any broken Java apps.

      No, I don't trust that statement in the slightest. Why would you think that? It's very contrary to Microsoft's behaviour in the past.

      I have no idea why they chose to name Windows "Windows 10", and I'm not convinced of this, but this is not so implausible as you seem to think.

    • Apparently the JVM takes the OS reported info and constructs marketing-friendly variables.

      So, blame Oracle as well! Between them and Microsoft, I'm sure there isn't anything they couldn't screw up.

    • Exec command.com or cmd.exe, using a pipe to read the output, parse it.

      Or you use some shitty language/library that doesn't give you access to the standard API calls.
      A perfect example would be someone using code which depending on other code like this:

      http://stackoverflow.com/quest... [stackoverflow.com]

      Rather than properly handling the response directly and correctly, some apps provide wrappers like this to scripting languages rather than exposing the proper version information.

      Bad code is what it comes down to in every case,

    • Re:Bullcrap (Score:4, Interesting)

      by Dahan ( 130247 ) <khym@azeotrope.org> on Saturday October 04, 2014 @12:48AM (#48061291)

      That is only via some Java API, which does exactly what I said above, which is turn the actual internal version into some higher-level OS name.

      So what do you think that Java API would return on Windows 9? Don't you think Oracle would have it return the string "Windows 9"?

      Trust me, MS doesn't give the slightest concern about any broken Java apps.

      Perhaps you should read some of the stories on The Old New Thing [msdn.com] about the hoops MS jumps through to maintain compatibility. Here's one [msdn.com] (of many). In that one, we find that MS changed the internal implementation of critical sections in Vista, but found that some programs were looking directly at the internals instead of using the API. So in order to not break those programs, MS made sure the value in the internal struct people were peeking at had the value those programs were expecting. Keep looking back through the archives and you'll find dozens of examples of MS doing crazy stuff just to keep programs working in newer versions of the OS. And with many Java apps being big and enterprisey, you can be sure that MS is going to do whatever it can to keep them from breaking on Windows 9^H10.

  • Considering windows 95 and 98 would return an version number of 9, there is no reason that Windows 9 couldn't have returned a totally different number, say 10.

    I bet it they went with 10 only as a symbolic leap from 8/8.1.
  • Premature optimization is the root of all evil.

Put your Nose to the Grindstone! -- Amalgamated Plastic Surgeons and Toolmakers, Ltd.

Working...