June 2006

8 posts

« May 2006 | Main | July 2006 »

Combinators

Eric Lippert writes about a limitation of generic delegates in that they cannot be used to build combinators — a function that takes a function and returns a function. With nongeneric delegate one can define a combinator as follows: delegate D D(D d); Eric then demonstrates some combinators from combinatory logic. I thought that there were better examples from lambda calculus. Here are definitions of some Church numerals in which we express any number n as a higher-order function that applies another function f n times. D N0 = f => x => x; D N1 = f => x...

Direct UI

Direct UI is the notion of treating a document window as more than just a WYSIWYG display. This includes treating the window as a control surface, inserting various markup, treating document elements as controls, and applying transforms/animations that allow the elements to momentarily transcend their document layout. It’s about making the document come alive. It’s something that I thought heavily about in building my next document-based application. It’s also one of the reasons why I opted out of using any of Microsoft’s text-editing solutions, because of poor layout extensibility. Avalon text may support render transforms and animations of text, but...

Queries Refactored

Earlier, I pointed to Erik Meijers paper on XLinq: XML Programming Refactored; it was an article that I have been wanting to blog about. Erik distinguishes between relational operations (projection, filtering, grouping, sorting and aggregation) and domain-specific operations. SQL doesn’t have many domain-specific operations; however, XQuery contains quite a number, such as structure axes and attributes. In distinguishing these two types of operations on queries, Erik was able to generalize relational queries across all data types. He gets at the essence of LINQ and how it can become possible to perform queries on different data types. SQL is not just...

XLinq StreamingElement

The functional style of XLinq is a huge improvement in ease of use over the existing DOM and SAX-based approaches to reading and writing XML in .NET. This document XLinq XML Programming Refactored by Erik Meijer illustrates the tremendous benefits in simplicity one gains when using XLinq over DOM with numerous examples. (I don’t really need to demonstrate advantages over SAX.) Below is one of his examples: Here is DOM: Dim PO As New XmlDocument Dim purchaseOrder As XmlElement = _ PO.CreateElement("purchaseOrder") PO.AppendChild(purchaseOrder) Dim orderDate XmlAttribute = PO.CreateAttribute("orderDate") orderDate.Value = "1999-10-20" purchaseOrder.Attributes.Append(orderDate) Dim shipTo As XmlElement = PO.CreateElement("shipTo") purchaseOrder.AppendChild(shipTo) Dim...

Software Reliability

Based on a manifesto by Kirk Glerum, Office started thinking about reliability around 2000. As a result, a new improved Dr. Watson identified application crashes and hangs and relayed errors back to Microsoft, so developers could fix the most common errors. One statistic has that 50% of crashes were caused by 1% of the bugs. Office also added document recovery, in which documents are periodically auto-saved. Documents may actually be saved in the midst of a crash, risking potentially corruption. More recently with the open XML formats, these new file formats were designed to ease recoverability and limit corruption. Additional...

Text Mess in .NET

A major weakness in GDI+ is text handling. The GDI+ “undocumentation” in MSDN has been the primary source of my grievances. About the only good features in GDI+’s text support are device independence and floating-point coordinates. Vanilla GDI includes more API calls, performs much faster and enables complex scripts. GDI use different, incompatible layout algorithms from GDI+, so that text drawn in GDI also looks different from it GDI+ counterpart. .NET 2.0 includes a new class System.Windows.Forms.TextRenderer for rendering consistent-looking text in system controls. The text drawing functions in GDI+ are limited in number and require a string copy for...

MSDN Wiki Post

I have complained about MSDN documentation before. It seems as an answer to my prayers have been released. MSDN Wiki Beta was launch… I posted my first wiki content on Graphics.Save/BeginContainer in the MSDN documentation site, a problem I noted in an earlier blog post. The documentation does not differentiate between calls to BeginContainer/EndContainer and calls to Graphics.Save and GraphicsRestore. In addition, there are a few errors in the documentation. [e.g., GraphicsState is incorrectly asserted to be used by BeginContainer] In my use, BeginContainer/EndContainer appears to save and restore the current transform. It does not actually save the clipping region...

.NET Naming

Soma recently announced that WinFX has now been rechristened “.NET 3.0,” which by the way includes .NET 2.0. I really liked the name WinFX, but the .NET name is well-recognized. Early on in its history, .NET brand caused much confusion. Dennis Forbes recalls the .NET naming fiasco in his post “As If .NET Wasn’t Confusing Enough” about how each Microsoft product included a meaningless .NET suffix: Office.NET, Windows Server.NET, Exchange.NET. He refers to Joel, who wrote “Microsoft Goes Bonkers” about meaningless but ubiquitous use of the .NET moniker. The .NET suffix was eventually purged from every product except the framework....

© 2015 - Wesner P. Moise, LLC. All rights reserved.

free web stats