从技术角度解释为什么微软没有使用Windows 9

  众所周知,微软对 Windows 的命名规则一直很诡异,从 XP,Vista,7 到 8 和 8.1 一直到最新的 Windows 10。那么从技术角度考虑,为什么微软跳过了 9 而直接使用 10 呢?据微软内部开发人员流传,是为前操作系统的版本号考虑。

实例代码如下

if ( version.StartsWith ("Windows 9") )

  { /*Windows 95, Windows 98 */

  } else{

  }

  当软件开发人员使用:“ 如果版本号开始于 xxx,就执行 yyy" 时,会出现两种情况的正确判断

  Windows 9

  Windows 9* ( Windows 95 Windows 98 )   95 和 98 也是开头包含 Windows 9 的

  综上所述,在早期测试时,微软发现很多第三方软件开发商使用了如上的方法去判断操作系统,这样会造成对当在 Windows 95 和 Windows 98 上运行使用上述代码的程序时,程序会误判为 WIndows "9"。

  所以微软开发者为了避免出现这种不稳定因素,只好命名为 Windows 10 。

  觉得怎么还会这么写代码的?甲骨文还真的在 openJDK 里这么写了。

  第 602 行

  同样的写法竟然还有大名鼎鼎的 jEdit 编辑器!‍

https://searchcode.com/codesearch/view/1393856/

  第 48 行

不允许评论