Windows is easy to explain - they named it '10' because of bad coding (outside Microsoft). There is a common way to get the Windows version in certain coding languages (Java) which returns a string. Certain checks were straightforward [if (osName.startsWith("windows xp"))] but the problem happens with Windows 95 and 98, which are both relatively similar in how they handle things. This lead to people simplifying from two checks down to one (if (osName.startsWith("windows 9"))). This will break when there is an actual version called just "windows 9".
Microsoft cannot fix other people's codebases, and this could make the newer version of Windows a backwards compatibility nightmare. So they just skipped 9.
https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
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.
MS skipped "Windows 9" because old programs were made to detect which version of Windows was in use. They took the shortcut and did "If OS contains: "9" do {this}", so it would work with all versions of Win95 and 98 (there were many).
Now that it's been 20 years since 95, no one in their right mind would go back to patch those programs. Microsoft said fuck it, we'll just skip 9 and go to 10. It sounds cool anyway.
Read more, there's over 3500 results on Searchcode for this type of behaviour. It's not insanely large, but it was common practice.
Well, it's not their fault. It's more the cause of lazy programmers (or lack of correct methods to check OS versions). https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
This is a check if the version of the OS name starts with Windows 9. It would detect this and run code for backward compatibility on new hardware. It would break code possibly.
You'd think so... but then you have this: https://searchcode.com/?q=indexOf%28%22windows+9%22%29
Or worse, this: https://searchcode.com/?q=osName.indexOf%28%229%22%29
Once I saw the code search results, I believed the joke.
They're concern is valid. There are examples of this everywhere. I wouldn't be surprised if they built a version called Windows 9 before discovering that it's a real problem in lots of existing software.
https://searchcode.com/?q=startswith%28%22windows+9%22%29
There are lots of reasons to bash MS but skipping 9 isn't one of them. Pragmatic decision.
https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
Plenty of horribly written software checks for "Windows 9" in osName string to detect Windows 95 and Windows 98. When run, they would act as if "Windows 9" was one of those..
A cursory read through this finds serious projects like jEdit, qt-creator, etc etc etc. And this is only open source code, which is very much the minority in the Windows world. God knows what sort of old crap is running on your shiny new laptop right now.
Check this out. It isn't just an excuse.
Search for: if(version.StartsWith("Windows 9"))
Almost 9000 instances in this tiny search of public source code. Imagine the private source code and enterprise.
https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
Checking the version number rather than the OS name is the right way to do it (windows 10 is actually version 6.4 of windows), but that hacky code that looks for the OS name is out there way too often. It would have broken a lot of legacy applications to call it Windows 9.
Technically speaking, if all developers followed 'good practices', you would be correct.
[But it turns out there are idiots in software development too.](https://searchcode.com/?q=if\(version%2Cstartswith(%22windows+9%22\))
no, it's legit. the call he's using is wrong, but there are systems calling the OS Name and checking if it starts with "Windows 9".
https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
They skipped 9. They didn't say why but it may have been because many poorly coded applications would confuse Windows 9 with Windows 95 and 98.
https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
Yes. A lot of programs have this line for trying to identify the OS:
if(osName.startswith("Windows 9"))
Which was used to determine whether the OS was 95 or 98 compared to some other OS's. Windows 9 would return true for that.
Windows 95, 98 and ME were all based on the same kernel so when you wrote software for one it could be ran on any of them. After ME they ditched the 95 kernel and switched entirely to NT. That's why it's enough to check if the OS has 9 in it.
The way most devs actually worded it was [if(osName.startsWith("Windows 9"))](https://searchcode.com/?q=if\(version%2Cstartswith(%22windows+9%22) so as long as the name of the operating system starts with Windows 9 it doesn't matter what's after it.
It is at least certainly <em>in part</em> because of this
.NET exposes "Microsoft Windows NT 6.2.9200.0" (even though somewhat weirdly I'm on Windows 10 build 9879) through Environment.OSVersion. Not sure what the Win32 API returns but I suspect it's the same information.
Java, on the other hand, returns "Windows XP" for System.getProperty("os.name")
.
Developers should have been using os.version
and comparing the actual version string but as we can see, many plainly didn't (one of which is in the OpenJDK by fucking Oracle!)
It all came down to 3rd party developers. Microsoft found that a lot of 3rd party developers used the following code
if(version.StartsWith("Windows 9"))
{ /* 95 and 98 */
} else {
This accompanied by needing to support legacy software apparently caused a lot of issues when naming the OS Windows 9. It was easier to just avoid the 9 moniker and go with 10 from an internal perspective.
EDIT: Just look at how much if(version,startswith("windows 9")) statements where used.
And closed source code is generally far worse
Here's an open source search link that is certainly proof that "Windows 9" would break some old code: https://searchcode.com/?q=startsWith%28%22Windows+9%22%29
Several articles has suggested it has to do with backwards compatibility. Basically a lot of old software checks for if (windowsVersion.StartsWith("Windows 9") to check for Windows 95/98. This could potentially mean that old software could break, since it would try to run as if it was on Windows 95/98.
Examples here: https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
dea1a7ed-f111-51a9-ac1d-dec1a551f1ed 9abfe575-ab05-d1ed-5010-be571a1171e5 ecc1e51a-ba1d-ce11-a1ef-c011ec7ab1e5
Heh. A while back I wanted GUIDs with slightly meaningful names for testing. I wrote a simple app to generate them for me here https://searchcode.com/guid/
It tends to produce some interesting results, my favorite being ca55e77e-50f7-901d-d1ce-c011ec71b1e5
[https://searchcode.com/?q=if(version%2Cstartswith(%22windows+9%22)](https://searchcode.com/?q=if(version%2Cstartswith(%22windows+9%22\)) - and that's just open source.
They could have alternatively just jumped back off the numbered versioning scheme. There was also some posts about them focusing more on just calling it "Windows" and continuously updating it so aside from internals the name wouldn't matter too much.
Very good reason why Windows 10 wasn't called Windows 9. There's a tonne of software out there littered with special behaviour for 95 and 98, coded like Strings.startsWith($os_name, '9')
Edit: Here's some examples - https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
Unfortunatly, Java translates the 'good' version string to a human readable 'bad' one and many sloppy Java developers have written code like
if (System.getProperty("os.name").startsWith("Windows 9")) {
It's horrible. But it's true.
There is a ton of "bad" code out there which does a version check for "Windows 9" meaning Win95 and 98; not "The version after Windows 8.1"
Take a look Here for what I mean
It isn't Microsoft that was lazy in that case, it was developers for applications that wrote the lazy version check. Devs were coding to look for the OS release that contains "Windows 9*" to look for Windows 95 and Windows 98.
A fun way to show some of those lazy devs (at least the ones with open source code): https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
No, it's the actual reason. Here are a few hundred examples, this is all code from thousands of different programs in all areas that are for Windows; calling it 9 would have made it incompatible with almost all of them.
https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
Most "native" Windows programs used the API properly, but a commonly repeated snippet of Java code that are written in Java, there wasn't really any other way to solve the problem.
The evidence is kind of obvious. Look at how some publicly available code uses "Windows 9": https://searchcode.com/?q=if(version,startswith("windows+9"
Now extrapolate it to every single other proprietary software and enterprise code.
I don't know if it's an official reason, but it's certainly come up a lot in speculation.
Basically, there are two ways to get the windows version number. The official route will give you the same version number as ver.exe (to test this, winkey+r, cmd (return), ver (return). On a current windows 10 system you'll get Version 10.0.10586).
But, a lot of developers get lazy and check the OS Name instead of the version number. I say 'Get', instead of 'Got', because there's an eff-tonne of code out there that still does it. Presumably, most of that code would require admin privileges to run without breaking on 10 (trying to save data to its install directory), and it undermines the whole security policy if people get in the habit of just blindly telling UAC to let programs run as admin.
Edit to add : The version numbers for the windows 95/98/ME family are 4.x.xxxx. Windows 8 variants are 6.2.xxxx, 8.1 is 6.3.xxxx, and then it jumps to 10.0.xxxx for 10 and Server 2016. No idea why the jump's there, but there you go.
I thought they only did that because of lazy programmers.
same reason why it's called Windows 10 and not Windows 9 just look at all the lazy programmers here
Not all programs from the 90's actually checked the version number. Quite a few were using the "OS Name" and searching for a 9 in it. There was some one who had created a search of many opensource code to highlight this issue. It was real.
Edit:
Found the search: https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
This includes Oracle Java 1.7 : https://searchcode.com/codesearch/view/17998959/
The reason why Windows 9 doesn't exist is because of shitty Java code.
It goes something like this
String OSversion = System.getProperty("os.name"); if (OSversion.startsWith("Windows 9"){ // Windows 95 or Windows 98 related code }
What this does is check if the version name starts with "Windows 9" and then does things that only work in old versions of windows.
Microsoft could get around this buy making the version "Windows v9" but that would break code that displays the version name in a program, by making it super ugly.
MS loves backwards compatibility (you can open up word docs from the early 90's in the newest version office still, and it'll work, it'll just convert it to the new format), and this is it taken to the logical extreme.
>"Windows 9x" is not how you would match version info. "Windows 9x" is the version description, not the version #.
This isn't how you SHOULD branch on versions, but MS can't control what all the terrible developers out there do. Here it what the state of the world actually looks like:
https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
Your entire premise is flawed because the world is full of utter buffoons.
This one looks for "windows 9", because looking for just 9 doesn't appear to be too reliable.
EDIT: That link could have worked better. It does now!
> Besides, even if it were the case, it's going to be an incredibly small number of applications that do this.
Here's code from the WindowsAttachProvider in Java 7:
https://searchcode.com/codesearch/view/17993376/
here's some more for the MaxPathLength test in Java 7:
https://searchcode.com/codesearch/view/17998959/
This bit of code would cause Java to report a Windows 9 as a non-unicode OS:
https://searchcode.com/codesearch/view/17998113/
So yes, there are apps that do this, and since Java7 does it here and there in its core library, there are a lot of apps possibly affected.
Just in case anyone is actually wondering. This actually sounds plausible: http://www.reddit.com/r/technology/comments/2hwlrk/new_windows_version_will_be_called_windows_10/ckwq83x
Basically they named it to get around bad programming that recognises Windows 95/98 by searching for the string "Windows 9"
With added proof that this is actually a problem: https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
I really recommend doing this. If I have an error in my program, I search for "[Error] [Language]" and that's it, it's either it will return the results I want or no results.
I also use Searchcode to look at some references
Yes, Windows has always had internal version numbers like that.
The problem, as I said, was shitty devs that used the "Windows 95" OS name instead of the actual version number.
Look at this: https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
#2 Is not really bullshit, just look at these results. Although, I believe it is a combination of the two.
Code which starts WithWindows9
I mean there is some in openJDK source code.
I would say quite a few (I've made a few apps without doing this, but can easily see some Indian contractor doing so).
EDIT: See https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
Here's an article: http://www.pcworld.com/article/2690724/why-windows-10-isnt-named-9-windows-95-legacy-code.html
And here is a code repository search for just that very thing: https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
And this is just a single example. Windows has been plagued by issues like developers using hard-coded file-paths instead of relative file-paths or file-paths based upon system variables.
Code in older systems, while checking if you are running Windows 95/98, check for "Windows 9"
Not the only reason, but a big one.
https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
That was because of compatability reasons, IIRC. Turns out a lot of programs check for "Windows 9" to detect 95 and 98.
That said, this isn't really officially confirmed, so take it with a grain of salt. But turns out that checking for "windows 9" isn't as uncommon as you would think.
It's definitely a thing in Java, maybe they abstracted the native version info away. I'm sure that kind of code is very common in browser user-agent parsing as well. It also wouldn't be the first time MS had to do this kind of workaround, the internal major version was stuck at 6 forever because they didn't want to break all the software badly detecting Vista.
But it's true that this being the actual reason for the naming of Windows 10 is unconfirmed speculation.
> Version numbers are marketing (see Windows skipping 9)
Actually that was a moment of "Fuck legacy code has checks for Version starts with Windows 9*" which would match Windows 9.
https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
Nice story, but here's a bunch of code that would still break with "Windows 9":
https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
The first few results are parts of the Java Runtime
Skipped for sorta-technical breakage reasons. Programs checking for "Windows 9" as an OS version to detect if they're running on 9x. Java developers like it.
Admittedly, a lot of that code is horribly ancient and doing that is pretty much the only reliable way to tell the difference between Windows 95 (version 4.0) and NT 4.0 (also version 4.0).
https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
Based on this search of open source repos, it was used to determine whether the version of Windows was 95 or 98, not that it was running on some other OS.
Though Java is multi-platform and a lot of the repos that used os.startsWith are openJDK things.
Don't get why people are downvoting you. The reason is EXACTLY the one you described. I even remember reading a post by an MS developer stating that there were too many legacy systems searching for OS_Name StartsWith "windows 9"
Here is proof:
>So why would you check for Windows_Name = 9*
The point is that there are a heap of programs out there that do this anyway. Take a look at this search which was linked on one of the big subs (technology, maybe?) recently. It would make sense to go by NT version number, but when do people ever make sense?
Remember, a lot of these old codebases have been around since the XP/Vista days - Windows releases didn't even have numbers in the name, so why would anyone have expected that searching for "Windows 9*" would come back to bite them?
Why would you want to? If it’s a homework question please flair as such. That said, if you want to know how it works you can look at this:https://searchcode.com/codesearch/view/20327057/. This is the GNU Octave version of Polyval which is likely not the same but still a good look at the concept imo
Edit: forgot to link the link
I Googled "code search engine" and this came up: https://searchcode.com/
Not sure how useful.
Google used to have code search but it was shut down.
Here's a thread on SO discussing possible alternatives: https://stackoverflow.com/questions/7778034
> Well, compatibility with ancient programs is why we ended up with Windows 10 and not Windows 9.
This might be the case, but it doesn't seem likely. That entire idea revolves around the use of 'OSName.StartsWith("Windows 9")' in Java programs. So that's already a specific subset. Usually folks refer to Searchcode, and provide a query result like this as evidence of all the programs that would have broken:
https://searchcode.com/?q=if%28osName.startswith%28%22windows+9%22%29
But such results are incredibly misleading. Take a look at the first result. jEdit is a fairly common Java component, so this would seem like it would be problematic on a "Windows 9".
But it was found in an SVN tag for release version 3.0.1. From 2001. The current codebase does not have this issue.
Generally, The results are nearly exclusively personal projects, Open Source/Linux forks of other projects for which there is no reasonable expectation it would ever run on Windows again (Fedora fork of OpenJDK), or ancient commits/code revisions to the project that aren't even reflected in the current version. The "OSName.StartsWith" reason for calling it Windows 10 doesn't really hold water because there is nothing particularly substantial that relies on it.
Better yet- even if there was an issue like this with a product such that Microsoft wanted to address it, they've got the Application Compatibility Database and can just have Windows report "Windows NT" as the OS Name to java.exe and javaw.exe.
But then imagine a Java app that does the following:
if (System.getProperty("os.name").startsWith("Windows 9")) { // so we're not on NT, let's do some ancient stuff here ...
(os.name property is provided by the runtime)
It would work on Windows 9 only if the Java runtime is not updated. When you update Java, it will start misbehaving.
[And there are several open-source projects that do that](https://searchcode.com/?q=if(version%2Cstartswith\(%22windows+9%22\)) and God knows how many closed-source ones.
You want hundreds of shitty business programs to stop working? Because this is how you'd get them to stop working.
It's not. Problems generated by too loose constraints have existed since the early days of programming. A newer example would be that microsoft couldn't choose Windows 9 and had to resort to Windows 10, because a lot of old (and pre-8) programs that existed since Windows 95 only checked if the version string began with a 9.
It's unfortunately VERY common, as /u/IntenseIntentInTents says, and has nothing to do with the version check you're speaking of. They're instead getting the OS name and checking for "Windows 9"
Many examples across various code repos: https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
Naming it windows 9 would/could easily break ALL of these applications. It's not a trope, it's a real issue.
I mean, I liked Windows 7 plenty too, Windows 8 is just better. But maybe they should have kept making XP forever, since that was apparently the pinnacle of Windows development in a lot of people's minds.
If you're curious why they actually skipped 9 as a version number, it's because of this.
Windows 10 actually has a good reason, besides the marketing BS. A lot of older systems assume a user is running Windows 95, 98, or ME if the version number of Windows starts with a "9." You can see how this would be a problem with a modern OS.
Source: https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
And that's not just a theoretical issue either, the Java runtime is known to do a check just like that. Breaking Java on Windows is probably a bad idea.
Surely the check would be for the build number (5, 6, 6.1) using greater and lesser than, not for the OS name.
But... moronic developers https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
It's incredibly common.
Here's an example of such a flawed OS version check, in Oracle's Java JDK. Not some amateur kid out of highschool with a buggy half-completed video game, this is enterprise software used by millions of people every day.
There's thousands of examples of this here: https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
Marketing wasn't 100% behind the reason for the jump from Windows 8.X to Windows 10; Microsoft already had a product with 9X (95, 98) and there is a lot of bad code out there that makes assumptions. Check this out -> https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
As far as I know, no one is saying. However, there's a theory that seems at least moderately plausible to me:
There's a significant amount of third-party code out there (sample) that detects whether or not the operating system is Windows 95 or 98 by checking if its display name starts with "Windows 9". Microsoft certainly doesn't want this existing software to treat their new OS as if it were Windows 95/98.
XBMC's VGMStream source code states NPSF is Namco Production Sound File. I used the source code found here to piece together a header structure for the filetype in 010 Editor:
typedef struct { char NPSF[4]; int32 BlockSize; int32 LoopEnd; int32 Channels; int32 StartOffset; int32 LoopStart; int32 SampleRate; int32 Unknown1; int32 Unknown2; int32 Unknown3; int32 Unknown4; int32 Unknown5; int32 Unknown6; string Name; } NPSFHeader;
According to this header, the dummy file is a Stereo 44100Hz file. Apparently XBMC can read these NPSF files if their source code is to be believed, so you might want to check that out.
I would have thought the same initially.. however it seems like the adoption of modules is pretty low since there is no good tooling around it as well .. IDEs have a hard time with them and build tools as well.. assuming you can't just start a fresh new project...
https://searchcode.com/?q=requires+java.sql%3B yields roughly 500 results and
https://searchcode.com/?q=requires+mysql yields 0
so i wouldn't assume there are too many libs out there doing that - hopefully they don't - the whole jakarta extraction renaming was botched in this way...
i mean there are solutions to everything .. but that depends on your situation ^^
Yeah exactly, with time and experience you learn things like searching code snippets here https://searchcode.com/, how to read documentation properly, how do do a better job than a college student of "building your network."
It's still a very lonely and unfortunate lesson.
The stereotype I had in my mind before graduating was that helpful senior engineers were very common and available.
I think integrating a code search engine thing(something like https://searchcode.com/) could also be useful, for the couple of times where you can't find any useful answer on stack overflow.
I wasn't suggesting switching, just viewing their source code to see if you could convert the algorithm to matlab. (The pain of converting the python code to matlab code)...
Which actually just typing this, made me think why not use Octave's? https://searchcode.com/codesearch/view/64213481/
[Edit: Nevermind, I looked at the octave source. Ick.]
Not so much in Windows code itself, but all the other (non-Microsoft) programs and scripts, including web stuff parsing user-agent etc: https://searchcode.com/?q="if%28version%2Cstartswith%28"windows+9"%29"
Except here's a code search on git for those strings https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
It is true. A search of Open Source Code did reveal all the bad examples, not to speak of closed source applications written during the Win 95 era.
https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
One example
if (OSType == OS_INITIALIZE) {
//Print.logInfo("OS: " + osName);
if (osName.startsWith("windows")) {
OSType = OS_WINDOWS;
if (osName.startsWith("windows xp")) {
} else
if (osName.startsWith("windows 9") || osName.startsWith("windows m")) {
} else
if (osName.startsWith("mac")) {
See the usag of osName and not osVer?
You can do a simple search to see how much broken version-checking code is out there: https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29 and you can be there's a whole lot more in the closed-source world. Even if it wasn't Microsoft's main reason, it was a real problem to be avoided.
It’s never been officially confirmed afaik, but here’s more than 12,000 examples of one specific variant just in publicly available repositories
> But do programs really look for the string "Windows 9x" when trying to determine some sort of compatibility?
Yes.
https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
> That would of course be a totally stupid thing to program and I have never heard of any software actually doing so, but a lot of stupid people have written a lot of stupid code for Windows, so who knows
It does happen.
https://searchcode.com/?q=if(version startswith("windows+9")
Personally I think anyone who writes code like that deserves to be shot, but until I'm made dictator of the world, people really are going to write code that bad.
Hy /u/rockthescrote Thanks for replying. I stumbled upon a file located in system\library\db\MPDO.php which contain look like THIS . From the line 8 I can assume that this is mysql driver?
>extensions and look at all the type system related ones, a large portion of them cannot be implemented in OCaml.
Examples?
> mention that the singletons library within Haskell actually DOES give you dependent types, see here.
It's not dependent types, it's Peano numbers upon GADTs and parametric polymorphism, which are used in OCaml a lot ([1] [2] [3]).
>To answer your question you could absolutely implement subtyping in Haskell at least as well as you can implement higher kindled
That would be much messier since you have to differentiate invariant, covariant and contravariant types.
[1] https://gist.github.com/matthieubulte/e58dc1a6add5e114de0328f57dd3f460
It wouldn't confuse a user but it can easily confuse the os or an application that isn't updated or coded properly. While i'm sure part of the reason 10 was used was for marketing, it isn't the entire reason. https://www.extremetech.com/computing/191279-why-is-it-called-windows-10-not-windows-9 Apparently many apps simply used Windows 9 as a blanket term for Windows 95 and 98. Here's an example of such code: https://issues.jenkins-ci.org/secure/attachment/18777/PlatformDetailsTask.java And and a search in GitHub reveals lots of people's code using the same version check function: https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
>It is not hugely practical in this form, though...
But if we search for how people use the word "because" in code (i.e. in comments), we get:
// because the with statement marks the function as UNKNOWN, { // because I know Math has cos, sin, PI, LN10, tan, and E
//Because the submodule Enyim.Caching is setup to be delay signed when the private key isn't //present
All of which can be easily imagined as simple assertions!
Applications can look for whatever the programmer tells them to. Using the kernel number is the proper way, but it's not the only way. There are a lot of messy hacks out there, usually from people who didn't know any better at that point in their coding careers.
I'll admit, this isn't the officially-stated reasoning. There really isn't one that sounds like more than marketing BS. But this does have some evidence backing it up, unlike any of the other reasons floating around (at least, of the ones I've heard). And going through hoops to support legacy code is also a very Microsoft thing to do.
Check out this article, and be sure to look at the search results on searchcode. This is just covering code shared online from a handful of sites, and there are still assloads of examples where people identify the OS by name and not by kernel number.
Fun fact with the kernel number, though: Windows 10 is the first version in ages where the number in the name matches the actual kernel number underneath. It was going to be 6.4 (following the 6.3 that was used for Windows 8.1), but they bumped it up several whole numbers to 10.
I stumbled upon a PHP verison of what i'm trying to Create with this API: https://searchcode.com/codesearch/view/92506859/
Does anyone who knows PHP translate this into Python? I think this will definitely solve my "INVALID_CVENT_HEADER_VALUE" Error I keep getting.. Spending too much time on this -_-
$this->client->setLocation($this->ServerURL); $header_body = array('CventSessionValue' => $this->CventSessionHeader); $header = new SoapHeader('http://api.cvent.com/2006-11', 'CventSessionHeader', $header_body); $this->client->setSoapHeaders($header); if($this->debug) print 'CventClient:: ServerURL: '.$this->ServerURL.', CventSessionHeader: '.$this->CventSessionHeader.
I cant workout how to search for an exact term so this has a lot of false positives, but if you scroll down and eyeball the highlighted text you can see a few:
It's not the first time, either:
Google is going to do what they do because it allows them to be agile and develop for how things should be. Half of Microsoft's problem is dealing with trying not to break the legacy. It's why Internet Explorer is a bloated mess since they had to build in a ton of backward compatibility for applications designed in the IE6 era. Windows jumped a whole number presumably due to the habit of developers checking to see if the Windows version name contained "Windows 9" to check for Windows 95/98 (although Microsoft won't admit that in their marketing, there are a ton of applications that would break had they called it 9 instead of 10).
There does seem to be some truth to it.
Not that that proves why microsoft did it but some devs where defiantly using starts with 9 to identify os version
> it's suspected Microsoft skipped Windows 9 because so many applications did string searches on the OS name
I think at this point we can put this one in the "confirmed" column.
https://searchcode.com/?q=if(version%2Cstartswith(%22windows+9%22)
Yes, Windows has version numbers, but that doesn't mean programmers will use them: https://searchcode.com/?q=startswith%28%22windows+9%22%29 (and that's only java specific query)
Also:
-Windows 8.1 is WinNT 6.3, not 6.4
-Windows 10 is WinNT 10.0 (they decided to unify numbering starting with Win 10)
Well I am not sure what you want to do, but you can do something like this:
// length is an int variable char* p = malloc(sizeof(char) * length); This way you can allocate memory for multiple chars. And length can be any value (well almost, if it gets too big, your system will have problems). Just be careful, GetString does quite a few safety checks for you...
Also take a look at the source code of the cs50 library and how they implemented GetString(): https://searchcode.com/codesearch/view/42414647/
And the CS50 Study about this topic: https://study.cs50.net/malloc
Two possible reasons:
Marketers are silly and they think skipping a number will make the update seem more important.
Many programmers are lazy. In the early 2000s, they wanted to distinguish between Windows 9x (95, and 98) and newer versions of Windows, like Windows 2000 and XP. So they looked at the name of the Windows version and if it started with "Windows 9", they pretend it's Windows 95 or Windows 98. Microsoft tries really really hard not to break anything, but if you treat a new version of Windows like it's Windows 95 and not like Windows XP, it's probably going to break. Like these programs.
You'd be surprised- and this is just public source code, private internal business code probably does this all over the place.
They did give it a name, as well as a version. The issue us that they decided to go with the numbers at "Windows 7" and didn't notice how many legacy programs were using a very inefficient string match on the name rather than the version number.
https://searchcode.com/?q=if%28version%2Cstartswith%28"windows+9"%29
As Microsoft pretty much guarantees backwards compatibility, to cut down on support costs and bad publicity, they simply had to skip the os name of "Windows 9". They are then increasing the version number from 6.3 (Windows 8.1) to 10 (Windows 10), which will put the version number in lockstep with the os name going forward.
I typed it wrong. I'm fixing it. I meant osName. See this link for what I was talking about.
[edit]
I was thinking about adding a "proper" way to do version checking, decided not to and didn't notice I typed version instead of osName. Your point still stands though. Many programs do checks against the version numbers. Many programmers check for XP or newer with the below code but it will fail on vista (6.0) even though it is newer than xp.
if( windows.versionMajor >= 5 and windows.versionMinor >= 1 )
Not exactly, on page two of https://searchcode.com/?q=if%28version,startswith%28%22windows+9%22%29, the logic is:
If(string.StartsWith("Windows") and string.containsChar("9")) Then version = Windows_9x
There are examples out there of programs checking for Windows 9x by looking for the string "Windows 9". See here for examples
There are a lot of legacy programs still in use today by businesses, etc. that were written when 9x was being used, or when it was worthwhile to check for 9x.
I came accross this and thought about the recent "Windows 9" references hardcoded in applications (https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29)
There is a wonderful 10-year old post written by Joel Spolsky that describes the virtues of Microsoft in that matter. It's pretty long, but you may want to focus on the paragraph The Two Forces at Microsoft which talks about the amazing stories like the Sim City story and explains why such hard-coded references were common.
As an update I've found this site: https://searchcode.com/?q=if%28version%2Cstartswith%28%22windows+9%22%29
The first link actually shows some Oracle code by Sun from 2005:
>public WindowsAttachProvider() { String os = System.getProperty("os.name"); if (os.startsWith("Windows 9") || os.equals("Windows Me")) { throw new RuntimeException( "This provider is not supported on this version of Windows"); } String arch = System.getProperty("os.arch"); if (!arch.equals("x86") && !arch.equals("amd64")) { throw new RuntimeException( "This provider is not supported on this processor architecture"); } }