Archive for the ‘programming’ Category

Flex & Silverlight

Sunday, April 22nd, 2007

I’ve been experimenting with Flex 2, Adobe’s Rich Internet Application library built on Flash 9 over the last few months and am impressed. For a very long time Flash was developer unfriendly. That has changed. Flex Builder is a respectable IDE, and Actionscript 3 is based on JavaScript 2 which feels very similar to developing in Java/C#. It’s even nicer in some ways. You can use dynamic typing for prototyping and then switch to static typing when you want compile-time checking. Adobe has also released the Flex SDK, so you can also develop Flex applications for free.

For me, the big technical downside to Flash based applications is that like a Java Applet your application is wrapped in a binary object that is embedded into the web page. That means that search engines can’t easily index it, and as a user you run into weird issues where keys that normally work in web pages don’t work when you’re using a Flex application. The whole experience is somewhat like viewing a PDF on a web page—it works okay but feels slightly off.

Silverlight, Microsoft’s competitor to Flash, is more web browser friendly. It uses XAML, an XML-based format, for describing the user interface and leverages the browser’s JavaScript engine for programming. Instead of binary embedding, it’s all text, which means you can write Silverlight applications in any text editor or even generate them dynamically, and have the resulting page indexed more easily by search engines. From a technical standpoint Silverlight is currently inferior to Flex, especially after dropping CLR support for 1.0, but overall I really like the vision of Silverlight.

Rich Internet Applications are the future, and the battle is on for the platform they will be built with. If the history of cooperation between web browser vendors is any indication, Ajax is unlikely to evolve quickly enough to stay competitive with Silverlight and Flex. Unfortunately for Microsoft, the use of Flash by sites like Youtube and MySpace means that 84.3% of browsers already have a runtime installed that supports Flex 2. If I had to make a bet right now, my money would definitely go on Flex.

Ashish Shetty, a Program Manager at Microsoft recently asked for candid impressions of Silverlight. What I’d like more than anything else from Silverlight is for it to become a non-proprietary alternative to Flash. Microsoft has a real opportunity here:

  • Release the Silverlight specification as a open patent-free standard
  • Release a Silverlight implementation (minus the multimedia codecs) under the Microsoft Permissive License.

This would be a radical departure for the company and I don’t see it happening. But opening Silverlight would likely fulfill Bill Gates’ vision of seeing Silverlight technology ‘absolutely everywhere’.

Dijkstra’s Three Golden Rules

Wednesday, April 27th, 2005

Edsger Dijkstra’s Three Golden Rules for Successful Scientific Research [via RGrig’s blog]

  • Raise your quality standards as high as you can live with, avoid wasting your time on routine problems, and always try to work as closely as possible at the boundary of your abilities. Do this, because it is the only way of discovering how that boundary should be moved forward.
  • We all like our work to be socially relevant and scientifically sound. If we can find a topic satisfying both desires, we are lucky; if the two targets are in conflict with each other, let the requirement of scientific soundness prevail.
  • Never tackle a problem of which you can be pretty sure that (now or in the near future) it will be tackled by others who are, in relation to that problem, at least as competent and well-equipped as you.

Saturday Reading

Saturday, April 23rd, 2005
  • Continuing along the computational aspect of nature meme, the sample chapter from Rucker’s upcoming The Lifebox, the Seashell, and the Soul is quite intriguing. His CAPOW continuous-valued cellular automata software looks interesting as well.

Fonts and Coding

Wednesday, March 30th, 2005

André Pang is surprised that programmers use the default monospace fonts (like Courier) on their OS to edit their code, and as an alternative listed several alternative monospace fonts for programmers .

I have an even more radical suggestion: ditch monospace fonts for coding entirely and edit in a variable-width font like Verdana or Helvetica. I’ve been coding this way for about 5 years now and won’t use an editor that doesn’t support variable-width fonts, as I almost immediately notice the eyestrain. There’s support for variable-width fonts in moderns IDE’s—Visual Studio.NET has supported it for years(“Fonts and Colors” under the “Environment” option), as has Emacs since version 21 (see the “set-default-font” function).

Pretty much every programmer that has seen me editing in a variable-width font has initially recoiled in horror. “But how do you line things up in your code?”, they ask. Other than code indentation, I rarely need to do that, and for indentation tabs work fine.

Try it for a week or two. Your eyes will thank me.

Life

Wednesday, October 6th, 2004

Since becoming interested in Artificial Life & computer based simulation several months ago I’ve spent a great deal of time researching Artificial Life & simulation, and a great deal of time programming. But I realized recently that most of that programming has been building foundations to do work with, but very little coding on the actual topic that got me started! So yesterday I put together a simple implementation of Conway’s Game of Life . If you’ve never played around with the Game of Life, I highly recommend giving it a try. My implementation (along with full OCaml source) can be downloaded here. There’s an included binary for Windows, but it should be compilable on any system that OCaml/LablGL works on.

I had a lot of fun programming my Life implementation and it’s neat to see the complex patterns that can be generated from such simple rules. The pattern that’s loaded up when the program runs is one that I found while playing around that surprised me just how interesting the result was (the pattern is just 8 cells in a jagged line, but runs for many generations).

For a much more feature rich version of Life (for Windows) check out Life32. It’s an impressive piece of work.