
if (osName.startsWith("windows 9")) - bpierre
https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
======
AsakiIssa
Now it makes sense why they are calling it Windows 10! To avoid OS String
detection edge cases against "Windows 95/98"

~~~
jrochkind1
Plus they had to catch up with OSX.

I imagine future versions will be Windows 10 II, Windows 10 III, Windows 10
IV, Windows 10 V, etc.

~~~
Mindless2112
Windows 10 is supposedly going to be the "last major version" of Windows. [1]

[1] [http://www.zdnet.com/microsoft-christens-the-next-version-
of...](http://www.zdnet.com/microsoft-christens-the-next-version-of-windows-
as-windows-10-7000034196/)

~~~
wolfgke
Also DirectX 11 was originally supposed to be the last major DirectX version
with only some minor updates planned, since Microsoft saw no additional parts
of the graphics pipeline that could additionally accelerated by hardware
(Source: some AMD talk a few years ago).

A few months ago DirectX 12 was announced (and it's quite probable that AMD's
Mantle was the reason for this roadmap change).

------
mdisraeli
Readers of Raymon Chen's blog The Old New Thing may be familiar with exactly
this sort of thing, which forced windows 95 to have the version number 3.95,
instead of 4.0
[[http://blogs.msdn.com/b/oldnewthing/archive/2004/02/13/72476...](http://blogs.msdn.com/b/oldnewthing/archive/2004/02/13/72476.aspx)].

Making the libraries cope with bad programming is not good practice, but it is
what keeps businesses using your software for decades. The Old New Thing
really should be standard reading, because this sort of thing is barely the
tip of the iceberg.

Other similar API avoidances that Microsoft have found programmers using to
check things include obscure undocumented registry keys, API implementation
bugs (seriously!), the padding data in tangentially related structures
returned by API calls, and more

~~~
deciplex
Ugh. I would hate to have that job.

At some point you just have to let some idiot's poorly thought-out idea blow
up in his face.

~~~
derefr
It doesn't blow up in _his_ face; he may not even be in business any more.
He's the guy who wrote the driver for the crap scanner your customers use. The
only person to blame when an update makes their scanner stop working is you,
the company who shipped the update.

~~~
deciplex
You're right in the sense that the only person _the customer_ will blame is
oftentimes you, and there is some merit in that, and some merit in the idea
that you should add dodgy hacks to your code to provide for some backward
compatibility.

However, the more accommodating you are with this stuff, and the more you
clutter up your code base, and the less easily-maintainable your stuff gets as
a result, the less you are able to deliver later on. And while, contrary to
your argument here, you actually stand a fair chance of the end user realizing
it's the printer drivers that suck and not your OS, the cries of "Windows
sucks now" are the fault of nobody but Microsoft.

------
anonymfus
Broader search:

[https://searchcode.com/?q=startsWith%28%22windows+9%22%29](https://searchcode.com/?q=startsWith%28%22windows+9%22%29)

~~~
AsakiIssa
I have come to realize that 99.9% of these string comparisons examples are in
Java. Does Sun/Oracle not trust developers to check `os.version` as well?

~~~
comex
Because startsWith is a Java function, and most other Windows applications
would be in C or C++, which has a few more variants is a bit harder to search
for (especially with the lack of any public regex code search engines).

~~~
boyter
searchcode.com actually did have regex support for a while. Nobody used it.
Probably down to how I implemented it more than anything else.

I am looking to add it back in sometime in the future once I roll out SPDX
support and a few advanced filtering options (number of lines of code, multi
languages etc...)

~~~
comex
Back when it was searchco.de? I think I might have used it during that time...
don't remember. Just know that it would make me extremely happy if you added
it back, since I can't find such functionality anywhere on the Internet
anymore.

~~~
boyter
That's the one.

The moment its live ill let you know via twitter.

------
ahmetkun
same thing happened with Opera 10. you were notified that your browser is 'too
old'

~~~
lmkg
Yup.

I'm using Opera 12.16. The User Agent starts with Opera 9.80 (the last version
before 10 was 9.6x). Apparently, too many sites would use a regex to parse the
first digit after "Opera" and check if it was higher than 6 or 7. Opera was
thus forced to identify itself inaccurately.

------
harryh
There are many ways that could have dealt with this problem that wouldn't have
involved changing the name of the product as it appears in on the box. It's
silly to think that this is the reason for skipping version 9. They did that
for marketing reasons.

~~~
kmontrose
Such as?

App compat's out (ie. "Run this program in compatibility mode for"), too many
libraries. They'd never get an accurate enough list of affected programs.

They can't change the reported OS name, too many apps display it; and it'd be
crazy weird (a bug for all practical purposes) to have programs claim they're
on "Windows 10" while the box says "Windows 9".

Probably can't change the format of the name either, ie. "Windows(tm) 9" or
"Microsoft Windows 9" or whatever; I bet tons of apps just check for "Windows
" as well.

It's an unfortunate choice, but I don't really see an alternative if they
wanted a numeric version number.

~~~
eurleif
How about "Windows Nine"?

~~~
kmontrose
Localization probably kills that, since this is displayed to users a not-
insignificant amount of the time.

"9" is pretty well universal (I know, not strictly, but for software Arabic
numerals are kind of assumed knowledge); "Nine" on the other hand isn't
something you know without being able to read English.

(Having been through a pretty big localization project recently... this stuff
sucks. So much. All your assumptions start breaking.)

------
colinbartlett
Can someone explain this? Does this _really_ have anything to do with why they
are calling it Windows 10? Is there really any known rationale for skipping?

~~~
castiel
Notice the "startsWith" function. It has nothing to do with "Windows 9" and
everything to do with Windows 95 and 98

~~~
Sanddancer
Yes, and "Windows 9" starts with "Windows 9". So the function will see that,
"yep, the string's there" and throw it down the path of handling antique
versions of windows.

------
Smudge
So, by this versioning logic, Microsoft would also have to skip Windows 70-89,
and many versions after 99, since 10-69 and 90-99 would be used by that time.
They'd also have to skip 95 and 98, of course.

Am I missing any other versions, or can we expect 11, 12, 13, etc (all the way
until 69)?

~~~
Eyas
The point is that checking of the OS name starts with "Windows 9" is a common
thing that apps did.

Its not about Microsoft logic, its about breaking existing apps.

They are badly written, but the only person who will pay is the user, not the
dev.

~~~
Smudge
No, I get it. I was just extrapolating, since presumably devs are still
checking if the name starts with "Windows 7", "Windows 8", etc. But maybe
they're not. Either way, if it's the user's problem, it's Microsoft's problem.

~~~
personjerry
People only checked for the 9 because 98 and 95 both start with 9 and it was
easy to support both at the same time. Other versions can be more explicitly
checked.

------
e40
Windows 10 makes more sense now!

------
JosephHatfield
"Windows 9" would have started causing confusion by the time Microsoft
released patch version "Windows 9.5"

------
mey
And that's just the open source stuff...

------
mkagenius
Wouldn't it break even if the control goes to the else part?

I mean, how does the programmer know that Windows 9 will not break in the else
part? (and only break when clubbed with Windows 95 or Windows 98)

------
lalmachado
and this one to:
[https://searchcode.com/?q=indexOf%28%22windows+9%22%29](https://searchcode.com/?q=indexOf%28%22windows+9%22%29)

------
mandeepj
So MS fixed Windows 9x (remember y2k? :-) ) problem by renaming its new OS as
Windows 10? Jokes apart, Imagine if they had to release a patch for that or
for god sake, a new OS :-)

------
shawnbaden
Not unprecedented. They skipped Office 13.

------
consultutah
That is very scary...

