Archive for the 'languages' Category

Wednesday, August 8th, 2007

New W3C Validator

Go check it out. It even has a Tidy option to clean up the markup. But they missed an important feature: it should include an option to run Tidy on the markup first then validate. This is becoming the defacto bar for web page validity anyway… -m

Monday, July 16th, 2007

Beautiful Code

If it’s been quiet on this front it’s because I’ve been engrossed in my continuing education. Andy Oram sent me a copy of Beautiful Code, a thoroughly enjoyable work from O’Reilly. If you like stretching your brain by reading code-intense essays from top-tier coders, I recommend this volume. In particular, I’m been digging into Douglas Crockford’s Top Down Operator Precedence chapter.

Other than that, some interesting BJCP classes, but I’m keeping that non-tech stuff over on meadblog. -m

Wednesday, January 24th, 2007

Histogram of top 10 words used in the 2007 State of the Union address:

I’ve always had a thing for text analysis.

  • the 352
  • and 250
  • to 225
  • of 188
  • in 118
  • a 108
  • we 100
  • is 76
  • our 75
  • that 72

Source. -m

Tuesday, January 23rd, 2007

On language design…

A semi-random thought that occurred to me.

One marker of a well-designed markup language is that it looks to the future. This doesn’t mean it’s an amorphous blob of abstract indirections mapped to tags. It can (and arguably should) be concrete and solid, but designed in such a way that keeps bigger things in mind.

HTML and XHTML are, I suppose, canonical examples of this, giving birth to microformats and many other uses outside of a browser. -m

Wednesday, November 8th, 2006

Somebody correct me if I’m wrong…

but there has never been a successful Java implementation of a commercial-grade web browser. (right?)

There exist lots of huge applications including IDEs, and editors of all sorts, but nobody’s been able to nail the whole XHTML+CSS+JavaScript thing in Java. (right?)

Take it a step further–no need to pick on Java–nobody has done this in any VM-based language (right)?

Coincidence or sign of greater forces in the universe? Feel free to post counter-examples in the comments.-m

Thursday, October 5th, 2006

How PHP can be annoying

On a PHP 4 project, I need to use XSLT, but the interfaces seem far more complicated than they should be. Check out this declaration for the function to run an XSLT:

mixed xslt_process ( resource xh, string xmlcontainer, string xslcontainer [, string resultcontainer [, array arguments [, array parameters]]] )

Wow, it returns a “mixed”, that’s some helpful documentation worth looking up. And all I have to do is pass in an “xmlcontainer” and “xslcontainer”. In practice, you end up with hard-to-read code like this:

$arguments = array('/_xml' => $xml, '/_xsl' => $xsl);
$xslproc = $xslt_create();
$result = xslt_process($xslproc, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments);

Too bad I have already-parsed objects. And then there’s this:

Warning: As of PHP 4.0.6, this function no longer takes XML strings in xmlcontainer or xslcontainer. Passing a string containing XML to either of these parameters will result in a segmentation fault in Sablotron versions up to and including version 0.95.

Whatever. In fairness, this falls mainly to the XSLT engine and not the language and the PHP 5 interfaces are much different and much improved. But still.. -m