News for hackers. Stuff that matters.
Re:Web Development as Tag Soup by midnightmonster on Monday July 21, 2008 @04:09PM (#252632)
Another option: get a language where markup itself is first-class syntax. JavaScript with E4X has XML built-in, which of course means XHTML if you like, which itself can be trivially translated to HTML if you prefer (as I do).

So just like regular expressions have first-class syntax, i.e., in JavaScript you can write either of:

  myRx = /somePattern/g;
  myRx = new RegExp('somePattern','g');
So with E4X you can write either of:

  greeting = <b>Hello, {user.name}!</b>;
  greeting = new XML("<b>Hello, "+user.name+"!</b>");
Though those really aren't equivalent since the second might be a XSS vulnerability, whereas the first is automatically escaped.

E4X only works in Mozilla-based browsers, but it also works just fine in Rhino, so you can use it in Helma (http://helma.org/) or any of the other Rhino-based frameworks or in Jaxer (http://aptana.com/jaxer).

There are no comments on this comment yet.