Listening To Reason

random musings about technologies by Andy Norris

20 June 2006

Microsoft and browsers

Chris Wilson from Microsoft has an interesting post about IE7 and web standards, in which he makes a passionate defense of his, and Microsoft's, commitment to moving forward with standards-compliant browsers. It's a good piece, and it's really nice to see that the team at Micorsoft really cares about these things—they had vanished for so long that even the most concerted Microsoft defender had to wonder about them.

The one thing that still makes me wonder about Microsoft's long-term commitment to web standards is the difference between web content and web applications for them. It makes 100% sense for them to support web content producers and consumers as well as they possibly can. Web content is now one of the main reasons people buy computers, and it makes sense to make the experience as good as possible.

What I woonder about, though, is the business case for Microsoft working to support the technologies that enable web applications—AJAX (yes, I know they created AJAX; that's not the point), JavaScript, and everything else that's being used to power a new generation of client-server applications.

If I were Microsoft, I might view these things as inevitable, but I'm not sure I would view them as good for business. After all, Microsoft is built on the idea of desktop applications. Software that runs on top of their operating systems leads people to buy their operating systems. Software that will run on any standards compliant web browser can run happily on a Mac, Linux, or anything else that comes down the road. In addition, some of these web apps are going to start providing an alternative to Microsoft's apps, at least down the road. Anyone who decides that Google Spreadsheet is good enough for their needs is a likely non-customer for Excel.

That's why you see things like the .Net Vista apps in C# 3.0 that are designed to run inside a browser. It's cool that they're supposed to run in Firefox on Windows, but that's still platform lock-in. They might sort of work on Macs if you work on it, but that's hardly ringing support for Macs. And, of course, as far as I can tell, the only chance of them ever running on Linux is if Mono ever gets them working. So these things aren't perfect platform lock-in, but when everything works seamlessly on Windows and requires effort to work anywhere else, that should be good enough for Microsoft.

Now maybe Microsoft doesn't think this way, and everyone really believes in supporting standards-based web applications. Or maybe they simply see them as inevitable, and they want to make the best possible browsing platform, so people will use their software. But with a conflict of interest this obvious, it makes me want to keep a careful eye on them going forward.

Tags: , , ,

19 June 2006

Spring Cleaning

I spent a little time today starting to spruce up the format of this blog. So far, I haven't modified anything notable about the entries yet, though I'm going to. Hopefully, later this week.

What I did today was wire up search and a subject index using Technorati. Key topics are now in the subject archive, and there's a technorati search dialog. The basic Technorati embed script completely mangled the site layout, so I extracted the text it was trying to add to the site and dropped it into the sidebar, with a little cleanup.

By default, they don't build a subject index, of course. But it was easy enough to embed one, using their standard search format for searching on a specific site. To add a subject index for this site on the topic "CSS", I simply added a link to

http://www.technorati.com/search/CSS? from=http://listeningtoreason.blogspot.com

as you can see on the right of this page.

It turned out to be really easy, despite the fact that as far as I can tell, Technorati has absolutely no help on their site for embedding their tools manually. I know they don't want to confuse people when they can just use javascript to embed it themselves, but it's still bizarre that there's no information there about it (that I can find, anyway).

Note: at the moment I have it performing a general search on the text. In the future, I may just have it reference the tag, instead.

Which brings me to the rest of the spring cleaning: adding tags and semantics. There aren't a whole lot of entries here so far, which is awfully nice, since I need to edit them all. Hopefully I can get everything converted this week.

I'm going to switch from the current awful entry markup to using proper HTML semantics for the entries. That should make the blog a lot more accessible, though I'll test things when I'm done to make sure that's really the case.

I'm also going to add tags to all the entries, so they're properly indexed. This is the first entry I've tried tags with. I also need to style the tags properly, so they don't look like the rest of the text.

Finally, I'm going to convert the book reviews to the hReview microformat. I want to try it out and see how it works.

Tags: , , , ,

18 June 2006

Diagram Semantics

Something I've been wondering about recently is the separation of semantics from presentation in proper web design, and how it applies to diagrams. The Scalable Vector Graphics (SVG) specification would seem to indicate that with drawings, all the presentation is part of the semantics, because it's a specification for presentation.

The problem with this for diagrams is that diagrams have a layer of underlying object meaning apart from the meaning of how they are laid out. For example, a UML Component Object Model specifies various classes and their relationships—this is the essence of the diagram at a semantic level, and the specific locations of the shapes and lines are merely a way of presenting that information.

Of course, an XML Schema could easily be designed to represent the underlying semantics for diagrams of a certain type, then XSLT could be used to produce an actual diagram by specifying some form of transformed data; for example, an SVG drawing. This would be a perfectly viable solution. The thing I don't like about this solution is that the resulting display object, the SVG drawing, would be decoupled from the underlying semantics—the semantics would exist on the initial side of a one way transform, not as part of the resulting drawing. Of course, if we think of the drawing as merely an implementation artifact, like transforming a document to PDF for distribution, this may not be too serious a problem.

One alternative that I wonder about is the possibility of using a microformat to specify semantics of a diagram, and using CSS to handle actually displaying the elements. HTML elements with appropriate classes and attributes could be used to represent the underlying objects, while a stylesheet could place the diagram objects as needed. An interesting advantage of this solution is that it preserves the object model directly withing the diagram—use an alternate stylesheet (or no stylesheet) and the semantics are right there on display.

The main questions, then, are:

  1. What are the proper semantics of a microformat for representing a diagram?
  2. How can CSS apply styles robustly enough to display a document as a diagram?

I'll elaborate on this in the future.

Tags: , , , , ,

Book Review: Web Standards Solutions by Dan Cederholm

Summary: A terrific book for intermediate web designers

Web Standards Solutions is an essential book for anyone who designs websites with CSS or wants to learn how. It's a solid book on CSS, and perfect for someone who is familiar with the basics of how CSS styling works, but is looking to learn how to use it effectively in real-world designs. But while this is an excellent book on CSS, it is a groundbreaking book on HTML.

This is a perfect second or third book on HTML. Everyone who works with HTML ought to have a nice big reference book, such as O'Reilly's HTML & XHTML: The Definitive Guide. Many people also have some kind of "Learn HTML Fast!" book. After you've worked your way through those and understand how HTML works, "Web Standards Solutions" is the book to have. It won't teach you how to write a web page: it will teach you to write a better web page. This book goes through repeated examples of how you might want to format some piece of information -- a list, a heading, a quotation, emphasized text -- and goes through various possible ways of makring it up. Cederholm explains the advantages of using HTML tags that imply meaning like "li" or "strong" over tags that imply presentation like "span" or "b". He also has a lot of coverage of useful semantic tags you may not be familiar with, such as dictionary lists, fieldsets, table captions, and citations, as well as discussion about how to use semantic tags to make your site more accessible to alternative browsers, such as screen readers for the blind and older browsers that don't support the latest design techniques.

The whole first section of the book is focused on producing effective semantic markup, along with some good examples demonstrating how that markup can be styled in various ways. The second section then goes on to cover additional CSS topics that don't require any changes the underlying content. Separate stylesheets for printing, producing an overall page layout, elaborate text styles, and replacing text with images are all covered.

This book won't teach you a huge arsenal of advanced CSS design techniques used by cutting edge professionals, but if you work through what's presented, you'll have a solid foundation, and you shouldn't have any trouble understanding new techniques you read about. The one real weakness of this book is that while it teaches a good selection of individual elements and techniques, it doesn't focus on putting it all together into building cohesive pages and sites.

Tags: , , ,

10 June 2006

Book Review: Build Your Own .NET Language and Compiler by Nilges

Summary: Very good for what it does.

First, some clear demarcation about what this book isn't: if you want a book with a really strong theoretical background in compiler design, this isn't it. I have Programming Language Pragmatics by Scott, and I recommend it.

Second, if you want a book about compiling to IL for direct execution, this isn't that book either. Frankly, this book is poorly titled in that respect. I don't yet have Compiling for the .NET Common Language Runtime by Gough, but it supposedly focuses specifically on this topic.

So what is this book? It's a practical, highly readable book about how to build a scripting language interpreter in VB.Net. A compiler theory textbook can teach you the principles involved in scanning and parsing, but it's likely to leave you wondering how you actually put any of that to use in real code. This book fills in enough theory to have an idea of what you're doing (with a little to spare), and lets you dive right in and work with practical real-world algorithms and code for actually doing it.

If you are a working programmer and you want to add a scripting language to an application you've written, it's easy to conclude that it's way too complicated to do all that stuff. This book is a fantastic antidote for that. It goes through things like tokenization, formal grammars, and recursive descent parsing in plenty of detail, any anyone who understands the basic CS building blocks of data structures and algorithms should find the coverage easy to follow. The text sometimes meanders a little too much, but it's still far more readable than anything else on the topic that I've run across.

My main criticism of this book is that it's a lot better about how to read in a language than how to do something with the result once you've read it in. The included interpreter operates on top of its own limited stack-based virtual machine, and the parser emits opcodes for it. This isn't covered in nearly enough detail, and my sense is that it's because the author isn't really thrilled with his interpreter. My gut feel is that this is kind of a neither-fish-nor-foul solution. A powerful solution for emitting opcodes would generate legitimate IL for the CLR, which the author gives a brief overview of, but doesn't follow through enough to produce real-world code. By contrast, I think a simpler solution for purely interpreted code would produce directly evaluatable function, statement, and operator objects, and not worry about emitting a language or dropping variables on a stack. The author's solution would seem to lack either the performance advantage of the former solution, or the simplicity and conceptual clarity of the latter. The only advantage I can see is pedagogical: it teaches you how to generate opcodes from a parse tree without wading through the complexity of a real-world imtermediate form like IL, GNU RTL, or Java bytecode.

Still, as long as performance isn't paramount, this is a solution that will actually work as an interpreter for a scripting language in the real world. This book covers a lot of ground, without ever completely losing its practical approach. Even though there are some flaws, and some areas I would have loved to see covered in greater detail, this is a tremendously useful book for the right audience.

Tags: , , , ,