Myme's amazin' wonderland

...not really

Subscribe to RSS feed

Why I don't like XSLT

In response to why (what's wrong with XSLT) the My Opera team decided to switch from using XSLT to Template Toolkit. I don't really have all the arguments that were the basis of the consensus. So instead, I'll rant about MY issues with XSLT/XML:

  • The one word that quickly summarizes xslt in my mind is: OVERHEAD!
  • Overhead in the form of memory usage. Memory footprints of parsed xslt/xml documents grow proportional to the document size, and are often 3-4 times the size of the document itself. This would go for both the XML data and the stylesheet itself. I mean, c'mon, that's insane!
  • Overhead in the form of processing (1). You are required to transform perfectly good data from an _internal_ structure to xml, which will again be transformed (via xslt) to (x)html. Doesn't that already sound like overhead?
  • Overhead in the form of processing (2). XML is optimized for readability (although I don't always agree), not speed. As a data format it's way too bloated and flawed for _internal_ representation (as a data exchange format, that's a different story).
  • XSL templates are just too verbose. I wanted to shoot myself when I was creating a variable where the declaration spanned 13-14 lines (due to formatting etc) because of some conditionals. var = (other_var) ? "yay" : "nay".. anyone?
  • Don't even get me started on the syntax. Who the hell thought it was smart to create a templating language, where the syntax of the templating language itself is the same bloated crap as what is to be generated. It is really hard to distinguish template logic from actual mark-up in comparison to alternative templating languages, which leads on to the next point:
  • Generic? I think not. With template toolkit you can easily create templates for all kinds of files and output. XSLT only likes XML. Checking for document validity is great and all, but you can easily achieve that with other means.


Template Toolkit gives so much more flexibility and speed that's this is really a no-brainer. Mainenance is greatly simplified with cleaner templates. Callback-functionality to back-end code is a lot easier to achieve. Generic data-structures generated by back-end modules open for the possibility of converting data to several know formats, rather than only relying on XML (internal perl hashes, json, xml, ...).

These are only the quick points that come to mind right now. I might be able to come up with quite a few other issues, but I'm not going to bother.

My Opera now posts blog entries to Facebook!

w00t!

My Opera is able to post updates about blog posts to Facebook!

Yay!

- Martin

Opera++

Then it's time for another member in the Opera family; today at 8 am (CET) Opera 10 was released.

*big applause*

Also drool over the new Opera logo, designed for v10.



- Martin

MyOpera++

Then it's time for yet another release of MyOpera.


Me, Myself and Opera

Hi!

My name is Martin and this is my first blog entry on MyOpera. I have just started out as a Summer Intern at Opera Software. I will be working full-time throughout August, which is a great opportunity for me to try out some relevant work while still being a student. This blog entry is basically just a quick test of the thing.

More to come!

- Martin