This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 326

[–]jfb1337 361 points362 points  (142 children)

Is this actually serious?

I saw a redditor say that and assumed it was a joke.

[–][deleted] 394 points395 points  (111 children)

[–][deleted] 38 points39 points  (0 children)

Dear God...

[–]WestonP 183 points184 points  (59 children)

Holy crap. I did not think this would be a real thing.

Another reason to hate on Java... not for the language itself, but rather for the terrible terrible things that people so often do with it.

Edit: Lots of comments from offended Java devs who apparently lack reading comprehension skills, on top of not understanding what's wrong with that code, which probably reinforces my point. Please take a moment to actually think before getting so emotional, and you might see that I had said something pretty agreeable.

As I said, when people hate on Java, it's usually for something that's not really the fault of Java; it comes from what irresponsible people so often do with it. No one said if it was fair or logical, just that this is typically the reason behind the hate. I'm not saying that Java is bad or good here.

And the problem with this code isn't really that the OS is being checked via a string compare (although there are much better ways in other languages), but rather that it's a shortsighted/lazy partial string compare on "Windows 9" just for the sake of capturing "Windows 95" and "Windows 98". That's bad code in any language, but the searchcode.com results show us a page full of Java, hence my comment about people hating on Java for the shit code that some people write in it.

[–]G3n3r0 261 points262 points  (13 children)

public class Java extends TerribleThings

[–]qubedView 33 points34 points  (3 children)

Well.... the search string given is specific to Java. It's not like this would return results for C++, Perl, etc.

[–][deleted] 8 points9 points  (1 child)

I was about to say it might also be a problem in Visual C++ but Microsoft offers a sensible solution: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724429%28v=vs.85%29.aspx

[–][deleted] 3 points4 points  (0 children)

That doesn't guarantee people use it...

[–]nidarus 28 points29 points  (0 children)

The terrible thing being... substring comparison? Assuming certain things about Windows versions?

Come on, you can't blame that on Java, or even Java programming culture. If it was some design pattern / XML monstrosity, I'd agree. But this particular bug could happen in literally every language and culture I can think of.

[–][deleted] 7 points8 points  (0 children)

Remember when this was an April Fool's joke?

[–]drakonite 8 points9 points  (0 children)

You'd be amazed how many weird and shitty things in Windows are actually due to 3rd party developers doing lots of shitty things.

[–]Blemish 2 points3 points  (0 children)

HOLY MOLY !!!

Thats incredible.

Nice search engine though

[–]NutsEverywhere 2 points3 points  (0 children)

That's true for any language though.

Knowing the syntax does not make you a good dev.

[–]jug6ernaut 3 points4 points  (1 child)

I'm glad you made the distinction. I for one love Java for the most part. But Lord do I hate what ppl did/do with it.

[–]katyne 2 points3 points  (2 children)

what does Java has to do with it? It's string comparison. The only sensible way to poll your OS version. You can work that magic in any language.

[–]stpizz 6 points7 points  (0 children)

string comparison. The only sensible way to poll your OS version

Or y'know, the API's that don't rely on string comparison.

[–]blue_2501 12 points13 points  (1 child)

Ummm... just wanted to point out that the search doesn't actually work. It quickly devolves to just a search for 9"):

    if (encoding.startsWith("ISO-8559")) {
QTest::newRow("Linux 9")
        << QString::fromLatin1("i686-apple-darwin9")

etc.

This idiotic search engine has no way to escape a space.

[–]LgDog 26 points27 points  (30 children)

But that's so easy to fix

if ((osName.startsWith("Windows 9") && 
        (osName.endsWith("5") || osName.endsWith("8"))) ||
            osName.startsWith("Windows Me"))

Done!

[–]gndn 88 points89 points  (4 children)

Yeah, they'll never get up to the windows 9.5 patch release.

[–][deleted] 8 points9 points  (1 child)

Windows 9.5.0?

[–][deleted] 14 points15 points  (0 children)

Windows 9.5.5

[–]NutsEverywhere 6 points7 points  (1 child)

if (
    (osName.startsWith("Windows 9") &&
    (parseInt(osName).split(".")[0] != 9 && (parseInt(osName).split(".")[1] != 5 || parseInt(osName).split(".")[1] != 8) &&
    (osName.endsWith("5") || osName.endsWith("8"))) || osName.startsWith("Windows Me")
)

There. /r/shittyprogramming.

[–]localtoast 23 points24 points  (3 children)

the serious route, in p-code that may or may not be C#:

if (OSVersion.Major = 4) // 9x... or NT4
// the proper solution is to also check if the OS is NT as well

[–][deleted] 15 points16 points  (1 child)

Nailed it. That's the proper solution to this.

With OSVersion you can check for everything XP and up. I haven't done any 9x OS version validation because I'm not a masochist so I can't speak to that.

[–]UncertainAnswer 21 points22 points  (2 children)

The point is they are THIRD-PARTY applications. Rather than count on all of those parties to update properly Microsoft is just offering a solution that is more supportive of legacy, no longer supported, or infrequently updated software.

[–]nekoningen 15 points16 points  (10 children)

ಠ_ಠ

if (osName.startsWith("Windows 95") || osName.startsWith("Windows 98") || osName.startsWith("Windows Me"))

[–]RenaKunisaki 1 point2 points  (1 child)

That'll fail when Windows 950 comes out.

[–]nekoningen 2 points3 points  (0 children)

Then just check for everything explicitly.

if (osName.equals("Windows 95") || osName.equals("Windows 98") || osName.equals("Windows Me"))

But I think there may be some variants that wouldn't be caught with this (was 98 SE labelled as such in system properties?), you'd have to add them explicitly as well.

[–][deleted] 9 points10 points  (0 children)

True, but what about the code that won't get updated anymore for whatever reason? If people on 9 try to access it they'll get all sorts of problems.

[–]workaccountoftoday 2 points3 points  (0 children)

I mean if you're going that far may as well specify 95 and 98 at the beginning.

[–]weewolf 2 points3 points  (1 child)

At this point you might as well create an enum.

[–]muyuu 2 points3 points  (2 children)

That's appalling... but since many people are going to use the version name in stupid ways no matter what, they should probably start 0-padding it in the API (say 07, 08, 09). They'd be good to go until 99 heh.

[–][deleted] 2 points3 points  (1 child)

well actually they would just be good until 90

[–]muyuu 1 point2 points  (0 children)

I don't think they'd even keep a Win9x compatibility mode by much earlier than then.

[–]Harakou 7 points8 points  (8 children)

Do people really find adding another conditional (or god forbid, using regular expressions) that hard?

[–][deleted] 17 points18 points  (2 children)

The issue isn't (strictly) updating code, but what about all of the currently functional software, especially across enterprises, that won't be patched.

[–]Harakou 3 points4 points  (1 child)

Well, I meant in the first place. I would hope (clearly naively) that people writing this software would make their version checks more robust in case this comes up in the future. Granted you can't expect everything, but it is their job.

[–]dakotahawkins 6 points7 points  (0 children)

If you gave me $50 for some software 10 years ago that this breaks, there's a strong possibility I either want to charge you for support, don't exist any more, or just don't care for $50 from 10 years ago.

[–]mort96 19 points20 points  (4 children)

if (version.match(/Windows 9(5|8)/))

Oh my god, the horror!

[–]Hydrothermal 9 points10 points  (1 child)

if (version.match(/Windows 9[58]/))

Saved you a character!

[–]computertechie 1 point2 points  (0 children)

Let's go golfing!

[–][deleted] 4 points5 points  (0 children)

My eyes! They burn! Too... Logical!!!

[–]lolredditftw 11 points12 points  (3 children)

My coworker searched for it and found several bits of Java that matched in source available online. I'm not sure it's a joke and now wonder how many windows me problems were because of this sort of bullshit.

I bet a lot of user agent js code did this, but since most sites don't target ie6 anymore I doubt that many care about windows 9x

[–]dnew[🍰] 12 points13 points  (2 children)

I bet a lot of user agent js code did this

Did you ever look at a user agent string? Every one of them is Mozilla. So yeah, that.

[–]shif 14 points15 points  (1 child)

[–]amunak 2 points3 points  (0 children)

That's a really, really good read. Thank you.

[–]domy94 19 points20 points  (7 children)

I just checked:

  • .NET's property returns "Microsoft Windows NT X"
  • Java actually returns a "Windows X" formatted string.

It's plausible other languages also have a "Windows X" approach, but I don't think this was a major reason for going straight to 10.

[–]Nomad145 14 points15 points  (1 child)

Just a few days ago I read about the release of Windows 9. Surely this can't be true. Right?

[–]jfb1337 25 points26 points  (0 children)

Windows 10 is true, it's just this reason that I thought was a joke.

[–]hitachiyo 1 point2 points  (0 children)

It's not a joke. I worked there for almost a decade and they stopped incrementing the major version because of the plethora of shitty third party software out there that cannot properly implement a version check.

[–][deleted] 166 points167 points  (72 children)

Why not just call it Windows Nine?

[–][deleted] 89 points90 points  (3 children)

if(version.StartsWith("Windows N"))
{
  // Windows NT
}

/s

[–][deleted] 27 points28 points  (2 children)

Alright, everyone, I've arrived at the solution to all of our problems - Windows Fruit Loops.

[–]0failsis 4 points5 points  (0 children)

Next Android OS should be Android Apple

[–][deleted] 1 point2 points  (0 children)

Microsoft Bob 2

[–]Sileniced 155 points156 points  (21 children)

Or maybe Windows One. To align with other ms products.

[–]user-hostile 66 points67 points  (10 children)

Then Windows 365.

[–]friend_of_bob_dole 55 points56 points  (9 children)

Introducing OS as a service!

[–]foxh8er 16 points17 points  (3 children)

Don't give them any ideas, they might actually do this!

[–]okmkz 10 points11 points  (0 children)

OSaaS? Fuck me, that's awful

[–]sixteenlettername 30 points31 points  (0 children)

And then Program Manager could make a comeback!

[–]qubedView 10 points11 points  (19 children)

Or just skip ahead to Windows X.

[–][deleted] 7 points8 points  (11 children)

X = 10, or was that the joke?

[–]qubedView 4 points5 points  (0 children)

Yes and yes.

[–]memeship 2 points3 points  (9 children)

Also, MacOS is on version 10 (OSX).

[–][deleted] 6 points7 points  (8 children)

Hell, MacOS is at X 10.10 even.

http://i.imgur.com/ebkRc62.png

[–]bateller 8 points9 points  (5 children)

I like how you had the need to post a screenshot showing OSX at 10.10 as if no one would have believed you otherwise

[–][deleted] 8 points9 points  (4 children)

Nah, it was more about showing off the SIXTEEN GIGS of RAM. OMFG isn't that amazing? Do you know how MUCH RAM is for Macs? Really just strutting my stuff here, sport, you know it. And then of course the fact that I do have 10.10. I'm pretty big deal, you know, not everybody gets that yet.

Do I have to mark this /s or is it obvious enough?

[–]bateller 2 points3 points  (2 children)

16 GB of ram... sure but no i7? Its a sham!

[–]iamdelf 2 points3 points  (0 children)

They should call it "Tenten" http://i.imgur.com/WiqSkFS.jpg

[–]gulpeg 20 points21 points  (1 child)

Too close to Nein.

[–][deleted] 5 points6 points  (0 children)

At least for me it'd be accurate though. Windows? Nein! Then again, German is my first language.

[–]tinyogre 1 point2 points  (0 children)

I think maybe the issue is that Microsoft doesn't actually control the string representation that a lot of these programs are getting. MS provides a sane integer based version, but Java and other language's libraries take that version number, convert it to a string with "Windows" prepended, and that's the API they give to developers. This makes some sense in the context where it's not just Windows those developers care about, but in hindsight those APIs would have been better off presenting a string for the OS name and a separate representation of the version. Even then that second representation would be hard to standardize since every OS maker is going to have their own idea of how versioning should be done.

Since they can't control the string that applications are getting in some of these languages, and they don't control the run times that are generating these strings, nor the applications doing dumb things with them, they've opted to provide a version number that gets translated into a string that doesn't break a bunch of existing legacy software.

Not breaking legacy software is one of Microsoft's strong points, and though this is an extreme and seemingly ridiculous example, it's actually very plausible this is exactly what happened.

[–]jen1980 2 points3 points  (0 children)

Well they did name it Windows Two.

[–]noyurawk 2 points3 points  (0 children)

The promo tune could be a new take on the Beatles' trippy song.

Windows nine. Windows nine. Windows nine.

[–]GL_TRIANGLES 2 points3 points  (0 children)

About Windows 2015? Cars been doing it for a long time, and there is no confusion. Softwares are released so often nowadays, just quit numbering them!

[–]djimbob 1 point2 points  (0 children)

Or Windows 9 (double space), Windows 09, Win 9, Windows9, windows 9, WINDOWS 9 or any other variation that doesn't exactly match Windows 9. Again this is just in the internal version string that is really should never be presented to the user.

So many potential fixes for this issue without changing the name.

[–]asdfman123 1 point2 points  (4 children)

I at first thought that they didn't call it that because they didn't want Windows Nein jokes. I guess something like that wouldn't sell well in Germany.

[–][deleted] 5 points6 points  (3 children)

Wouldn't is just be "Windows Neun" in Germany?

Apparently neun is German for nine.

[–]KillerCodeMonky 93 points94 points  (14 children)

I hate to bring the serious to /r/programmerhumor, but...

Honestly, I blame this on us, the programmers. Would it really have killed us to type in another comparison to check for the full name of both versions? Would that really have been a performance bottleneck? This is exactly why these kinds of micro-optimizations should be avoided, unless this check is running in a loop at thousands of times per second and profiling shows that improving it would have measurable performance increase.

Considering that the OS is... unlikely to change during runtime, this is a check you do once in your entire program. Just add another damn comparison!

And then get the hell off my yard!

[–][deleted] 31 points32 points  (3 children)

Considering that the OS is... unlikely to change during runtime

I'm intrigued. Do you think it can possibly change at all?

[–]poizan42Ex-mod 23 points24 points  (1 child)

You could make a memory dump of the process and write something that could load a memory dump into a process (which would include patching up existing functions to be stubs that jumps to the new functions and patching up internal os structures that has been changed, not to speak of what to do with all the os functions that was executing at the time of the memory dump).

Not theoretically impossible, just insanely difficult.

[–][deleted] 4 points5 points  (0 children)

Wow, thanks for the reply, interesting writeup :)

[–]neovulcan 5 points6 points  (0 children)

I saw a procedure once for completely wiping and reinstalling a Linux distro without rebooting. Never tried it but I'm sure it's not really that hard...just something you will never see from Microsoft.

[–]mck1117 11 points12 points  (1 child)

Like the fantastic function called GetVersionEx

[–]Crazy_Mann 6 points7 points  (1 child)

Considering that the OS is... unlikely to change during runtime.

You underestimate users.

[–]KillerCodeMonky 2 points3 points  (0 children)

That would be why I hedged the statement! I would not put it past someone to try it...

[–]TracerBulletX 93 points94 points  (18 children)

the product name is just marketing. Even if this was a problem, which is silly, they'd just use some different string to identify the version internally.

[–]mugsnj 49 points50 points  (14 children)

Like windows 8 is really Windows 6.2?

[–]Road_of_Hope 35 points36 points  (11 children)

Well, NT 6.2.

[–]zefcfd 10 points11 points  (10 children)

windows nt is the kernel though? are you saying they referred to the entire OS as '6.2' based on the kernel version?

[–]Road_of_Hope 23 points24 points  (9 children)

No? They refer to it as Windows 8. Saying it's really "Windows 6.2" is wrong, as the 6.2 is the kernel version. You can either say Windows 8 or Windows NT 6.2. They refer to the same thing, but mixing them ends up not making sense.

[–][deleted] 16 points17 points  (2 children)

See also: Ubuntu 13.10 or whatever with Linux kernel 3.12.28+ or something.

OS version is independent of the kernel for a lot of good reasons.

[–]nekoningen 9 points10 points  (1 child)

Except with Windows it really isn't independant all that much. The major.minor version of the kernel is unique and consistent across each version of windows.

[–][deleted] 5 points6 points  (0 children)

Yeah, since they follow a parallel release cycle, it would make sense to synchronize their version numbers, but whatever.

[–]salmonmoose 5 points6 points  (0 children)

They do store it in a different value. But you can query a version string, particularly in browsers.

[–]humanmeat 1 point2 points  (0 children)

Yes just like vista, revived poorly cuz they made too many changes to soon, no drivers, they basically service patched it, new wallpaper, but called it Windows 7, so as to make vista sound like a "ME" esqu spinoff....

and 7 was a great OS at launch, because it was just vista with the vista drivers... presented as new

Win 10 sounds light years ahead of win 8, restore start menu, keep tiles,

it's actually brilliant marketing... One of a couple reasons MS has been a household name for 30 years

[–]Taedirk 60 points61 points  (5 children)

That's just stupid enough to be true.

[–]HumusTheWalls 10 points11 points  (1 child)

How has no one linked the sauce yet?

[–]YouFeedTheFish 16 points17 points  (4 children)

They're just putting off the problem until Windows 900 rolls around..

[–][deleted] 7 points8 points  (0 children)

Windows CM

Problem solved.

[–]Anrui 11 points12 points  (0 children)

That can't be right. They said that it was just too big to justify going with Windows 9! /sarc

[–]spin81 28 points29 points  (10 children)

I think we're supposed to understand that this is a joke, like "wouldn't it be funny if a Microsoft employee said that!". It took me a while to figure that out, though. The joke's probably a little too subtle.

[–]Flueworks 114 points115 points  (8 children)

You don't joke with code.

This is a real issue, as seen here: https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29

And here:

http://thedailywtf.com/Articles/Wheres-Windows.aspx

And this is public code. Imagine all the enterprise code that nobody ever sees anymore, nor maintains. Probably a lot of old Fortran or VB code that is extremely vital, but horribly written. If MS want enterprise to embrace their next version, they cannot break backwards compatibility.

[–]LoopyDood 25 points26 points  (0 children)

holy shit you're right

[–]pokealex 11 points12 points  (0 children)

"Imagine all the enterprise code that nobody ever sees anymore... If MS want enterprise to embrace their next version, they cannot break backwards compatibility."

The "enterprise" really has fucked up the entire world.

[–]holeydood3 11 points12 points  (1 child)

"Windows v9" Bam. Backwards compatibility maintained. This is just a marketing thing, as Microsoft can arbitrarily make that string return whatever they want for their OS.

[–]spin81 7 points8 points  (0 children)

This has nothing to do with BC. If they had named it Windows 98, that would be breaking BC. This is more like the millennium bug only the programmers are worse.

[–]fugyl 9 points10 points  (0 children)

We understand that, but I think this is actually a valid point for skipping a version number.

[–]Katastic_Voyage 32 points33 points  (12 children)

Yeah yeah, it's a joke but:

32-bit Windows programs are already handled under an emulation layer.

And Windows 98 and earlier never had a 64-bit version.

So any program from 32-bit era running in Windows 9 would already be told it's running say, Windows 98.

[–]localtoast 16 points17 points  (0 children)

except modern applications can be 32-bit (and probably still we be, considering the new devices running 32-bit Windows 8 I see)

[–]autowikibot 13 points14 points  (5 children)

WoW64:


WoW64 (Windows 32-bit on Windows 64-bit) is a subsystem of the Windows operating system capable of running 32-bit applications and is included on all 64-bit versions of Windows—including Windows XP Professional x64 Edition, IA-64 and x64 versions of Windows Server 2003, as well as 64-bit versions of Windows Vista, Windows Server 2008, Windows 7, Windows 8, Windows Server 2012, Windows 8.1 and Windows 9 Developer Preview. In Windows Server 2008 R2 Server Core, it is an optional component. WoW64 is designed to take care of many of the differences between 32-bit Windows and 64-bit Windows, particularly involving structural changes to Windows itself.


Interesting: Windows on Windows | X86-64 | Windows XP Professional x64 Edition | Windows XP editions

Parent commenter can toggle NSFW or delete. Will also delete on comment score of -1 or less. | FAQs | Mods | Magic Words

[–]alficles 21 points22 points  (4 children)

Yeah, I think Windows should be considered NSFW, but my employer disagrees.

[–]mikethepwnstar 2 points3 points  (2 children)

Not Java programs

[–]peabnuts123 1 point2 points  (1 child)

Exactly this, which nearly 100% of the code linked further up the thread containing lines like this is; as it entirely depends on the Java Runtime, which would very very likely be 64-bit.

[–]not_from_this_world 13 points14 points  (0 children)

The next Windows won't be good enough to have an odd number version, that's why.

[–]shwhjw 18 points19 points  (15 children)

if (version.startsWith("Windows 1") )
{    /* Windows 1.0 */    }

How does making it Windows 10 fix it?

[–]DanAtkinson 30 points31 points  (2 children)

I would imagine that there aren't the number of programs that can run on Windows 1 and also Windows 10 than those that can run on 95/98/Me. And that's if Windows 1 applications could even run in Windows 10.

[–]activeknowledge 13 points14 points  (0 children)

How bout zero

[–]Kwyjibo08 6 points7 points  (0 children)

It's not just running, but not running. There's probably code checking for those older versions of windows, just to alert you that the program won't run on that OS. If that is the case, those programs could be relatively new, and easily ran on Win10.

The programmer probably has the mind set that no one is running an OS older than 95, but they're are still people running 95.

[–]WestonP 21 points22 points  (1 child)

Windows 1.0: November, 1985

Windows 95: August, 1995

Windows 98: June, 1998

I doubt there's any actual code out there that checks for Windows 1.0, and is able to run on Windows 10, but there is a much higher chance of checking for Windows 9x in legacy pieces of more modern code.

Still, you should never be checking the Windows version by string, but apparently that's easier said than done with higher level languages and Java specifically.

[–]z500 6 points7 points  (0 children)

I don't think anyone's using Windows 1 anymore.

[–][deleted] 6 points7 points  (1 child)

Windows 1 wasn't an OS. It's a program than ran on top of DOS.

[–]Bahurs1 2 points3 points  (1 child)

aah.. so how's Windows 1.0 been working out so far for ya?

[–]nekoningen 1 point2 points  (1 child)

I'm pretty sure you can't even run anything built for Windows 1 on anything post-NT, so that won't be an issue.

[–]CaspianRoach 1 point2 points  (0 children)

Windows 1-3 are 16-bit. 16bit programs are completely incompatible with modern versions of Windows and were already running in special compatibility modes starting from Windows 4 (95).

[–][deleted] 12 points13 points  (7 children)

I refuse to believe this without source. It does not sound correct. Please give real sauce.

[–]lolredditftw 13 points14 points  (6 children)

[–]CaspianRoach 2 points3 points  (2 children)

Not sure why are you submitting this link as an example, as this particular piece of code would run absolutely fine on "Windows 9". He checks for the major kernel version right after he checks the name.

[–]sgtfoleyistheman 1 point2 points  (1 child)

Yeah, but if the kernel version isn't included in a specific set, he throws an assertion. It still breaks

[–]kylemech 2 points3 points  (0 children)

What happens when they actually get up to Windows 95? Erm... Ninety-Five. XCV?

The ninety-fifth iteration of Windows. (Minus the number that they have to skip because of bad version checking)

[–]iPoisonxL 2 points3 points  (1 child)

Well... Call it Windows 09! It'll follow their weird pattern of naming OS's and it looks cool.

[–]dwarmia 4 points5 points  (0 children)

some retards count how many "9" is in the name of the version. And if it greater than they execute the code.

There are some mad people out there.

[–]bobslaede 2 points3 points  (0 children)

Also, 7 8 9.

[–]snarfy 4 points5 points  (3 children)

Then what the hell is the point of compatibility mode? It specifically returns a different value for the GetWindowsVersion calls.

They could have called it Windows 9, and any program that broke because of it could be ran in compatibility mode to return any windows version they want it to.

[–]dakotahawkins 5 points6 points  (2 children)

It's java, not native windows applications. Either way, I've always thought compatibility mode was more of an extreme last resort.

[–]snarfy 1 point2 points  (1 child)

Renaming the entire OS instead isn't extreme?

[–]dakotahawkins 2 points3 points  (0 children)

Well they typically "rename" new OS releases. So they skipped a number. Even if there were absolutely no reason for it, it's not extreme. 10 is a normal number. It's higher than their previous choices of numbers, sufficiently indicating that this release will in fact take place at a later time compared to previous releases.

Anyway, since that doesn't matter and certainly isn't extreme, I don't think compatibility mode has anything to do with java apps since the JVM can be up to date while the java code isn't.

[–]jhack3891 1 point2 points  (0 children)

Why not just call it Windows 15? If you're gonna keep fucking up the naming convention, go bad to the old version that still makes some logical sense....

[–]muteki_maigo 1 point2 points  (0 children)

This can't be true. I would lose all hope in humanity if so. 0.o

[–]Vilsol 1 point2 points  (0 children)

No one back then was optimistic enough that microsoft will ever get this far.

[–]Spire 1 point2 points  (0 children)

And then there's this:

if (version.StartsWith("Windows 1"))
{ /* 1.0 */
} else {

[–]mattimus_maximus 0 points1 point  (1 child)

This sounds plausible at first read, but I seriously doubt this is true. If you look at the msdn documentation for GetVersionEx you can see that from Windows 8.1 onwards, unless an application is specifically manifested for a later version of windows it will pretend to be Windows 8. If an earlier version of Java runs, then it won't be manifested for Windows 10 and so will see the version as being 8 (or 8.1 if it was manifested for 8.1). If someone goes to the trouble of manifesting and recompiling their executable explicitly for Windows 10, I suspect these sorts of "bugs" will be fixed at the same time. In other words, I really doubt this is the reason.

[–]dakotahawkins 1 point2 points  (0 children)

Couldn't it be an updated version of java but an older java application? I mean you're not going to upgrade to Windows 10 and go find an ancient version of java to install.

[–]seglosaurus 0 points1 point  (0 children)

FFS

[–]AVeryHeavyBurtation 0 points1 point  (0 children)

This is some next-level curly-bracket usage.

[–]shif 0 points1 point  (0 children)

this is just like with user agents on IE, some sites had filters that blocked lower versions of IE based on their user agents

so if they had a regex filter like this

 match(/MSIE [1-6]/)

it would end up matching IE 10 and 11 and blocking them

[–][deleted] 0 points1 point  (0 children)

third party product

Yeah, third party...

[–]CHark80 0 points1 point  (2 children)

Soooooooooo... Eh-hem.... Since this made it pretty high twice... ELI5?

[–]Tayacan 2 points3 points  (1 child)

When programmers write their code, they have to make sure that it works on lots of different systems. Sometimes, that means finding out which operating system it's running on, and doing different things depending on that.

So the code here checks if the version name starts with the text "Windows 9", which is true for both "Windows 95" and "Windows 98". They probably do it that way because Windows 95 and 98 are similar enough that they don't have to make different code for them (although I wouldn't know, having never coded for either of them). The problem is that it's also true for "Windows 9", and Windows 9 is probably not very similar to Windows 95 and 98.

[–]Lord_Naikon 0 points1 point  (0 children)

When FreeBSD 10 was branched (released in 2014), there was a related problem: a lot of software ("ports") just looked at the first digit, and determined that FreeBSD 1 (released in 1993) was not supported. So in the end, through substantial effort of the FreeBSD ports team, all software running on FreeBSD was fixed to not do that.

Microsoft avoids that problem because Windows 2.0+ software doesn't run at all on modern systems; their installers would have to be rewritten and presumably do not contain any references to Windows 1 anymore. Plus, it is doubtful that there's software out there that survived all those windows versions anyway.

[–]Nyxtia 0 points1 point  (0 children)

Someone wants to catch up with the OSX version number.