posts - 33, comments - 51, trackbacks - 0, articles - 0
  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理

公告

2008年3月11日

Like many tips & tricks concerning programming languages, what I will present here will be so utterly obvious to some C# developers, but could be an eye-opener to others.

How often do you write something like this?

        if (token == "A")
tokenNumber = 1;
else if (token == "B")
tokenNumber = 4;
else if (token == "C")
tokenNumber = 5;
else if (token == "X")
tokenNumber = 10;
else
tokenNumber = 20;


How about writing it like this?

      tokenNumber = (token == "A") ? 1:
(token == "B") ? 4:
(token == "C") ? 5:
(token == "X") ? 10:
20;


It's the same thing, but it looks cleaner, and the generated IL code is almost the same (it's even a bit shorter).

http://www.blog.activa.be/2008/03/11/ifElseIfElseIfElseAnAlternative.aspx

posted @ 2008-03-11 23:28 阿布 阅读(201) 评论(0) 编辑

首先 GNU决定开发自己的支持多种操作系统的CLI,这可能吗?DotGNU项目的发言人确认了这一点。

GNU计划始于1984年,终极目标是完成一套基于自由软件的完整作业操作系统。DotGNU 计划是GNU为了提供Microsoft .NET一份free software替代品的一部份。

DotGNU目前正着力于兼容 ECMA-334和ECMA-335 的C#和CLI标准规格,并实现微软的商业CLI接口,主要目标是为了方便所有便携应用程序能够在DotGNU Portable.NET 和 Microsoft's .NET 平台上运行.

虽然DotGNU目前只支持C#,但是C#是最好的,最重要的是,这不是一个微软项目,而是一个开源项目

我觉得.NET永远不会为Linux和MacOSX发布本地支持版本,因为微软希望用户都使用windows操作系统。但是如果.NET能够跨平台运行,将给微软这个战略以沉重打击。

http://www.dotgnu.org看看

posted @ 2008-03-11 11:09 阿布 阅读(398) 评论(0) 编辑