Wednesday, 28 September 2016

Cyclic Programming Trends

The other day I was taking a look into React.js (shit, I think I like it even less that Angular, I will ever be a "home made MVC + jQuery" nostalgic), and I came across something that seemed somehow familiar:

var App = (
  
);

This thing of mixing javascript with markup, I'd seen it before, way before, it was some sort of Mozilla extension to JavaScript (those times when Mozilla was adding to their JavaScript version some advanced features that still have not made it into ES6, like https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Array_comprehensions. At that time (2005) XML was still all the rage, so it seemed natural to add support for XML into the language (the ES4 version). The "experiment" was called E4X, and yes refreshing a bit my memories, it was basically the same that JSX is now with html, with the difference that while that was fully integrated in the language, this is a sort of preprocessing stuff added to Babel.

I guess one reason for the abandon of E4X was that XML soon lost its relevance, but a second reason was that many people did not fill right to incorporate something so specific as XML into a general purpose language. I agree with this vision. Don't try to compare it to the support for Linq syntax in .Net languages, cause Linq applies to anything that can be queried, and that can be something as generic as a Collection. With JSX the approach of not having it as an integrated part of the language, but as a sort of preprocessing, seems reasonable.

This reminds me again how things in Programming and IT seem to come and go, and how when they return someone will brand them as a revolutionary breakthrough when it's just some varnish on top of an old (maybe good) idea that just did not get enough attention at the time. I can think of some clear cases:

  • Document Stores. Lotus Notes was a horrible technology to work with for different reasons, but it all revolved around a Document Database, something so praised in the last years.
  • HTML+JavaScript+CS applications. We've had that in Windows since a very long time ago, in the shape of HTA. One colleage in the office did a rather elaborated DataBase comparer with HTA rather than Windows Forms (that would have been the normal choice at the time) and it was a really neat tool, the UI was pretty much better looking that in most Windows Forms applications of the time.
  • Using JavaScript for your "shell scripts" via node is now a pretty good option. I've always liked its syntax more than Perl, Python or Ruby, and being prototype based since birth it's always been as powerful as a language (if not more). Using jScript in Windows seemed always a quite reasonable option to me, I could never understand why most Windows Admins would use VBScript (at least before the arrival of PowerShell)

No comments:

Post a Comment