I’ve used Open Source Software for a long time. As part of my position at work, I get to advocate and select solutions, and I’ve been moving us away from the IIS/ColdFusion proprietary licenses to Apache/PHP. It’s more cost saving all around, and for our application, we are actually stabler on Apache. (IIS required weekly reboots f the CF server, but it runs a bit more nicely under PHP). I’d like to get rid of the Windows license altogether, but that may not be an option in the long term. There are just too much .Net software out there I might have to support.
My client side is completely OSS, with Dojo Toolkit forming the basis of my web applications. Most of my stuff is driven by my PHP templating library, but I found that I wanted people to work with the data at their end, and produce the reports without needing to pass data back and forth. That means some sort of Javascript reporting library, which, unfortunately, wasn’t built into Dojo.
I found one called EJS, or Embedded JavaScript. I spent some time with it, it’s templates are pretty basic, and it doesn’t require a huge framework (after all, I’ve already got one of those). It’s technically part of JavaScriptMVC, which I’m not using so much (since my MVC mostly lives on the server itself). I got it mostly working, but then started having some odd problems with it.
JavaScript is a funny language, with functions as basic data types, and the ability to write and modify (and evaluate) it’s own code as part of the language. EJS does this for it’s templates, basically converting them into a function which it later calls — that means you can use JavaScript within the templates itself. I seized on this to make recursive templates (which works for recursive multiple group-by reports like I was creating). My recursive templates came out really weird, with part of it right, and part of it just … missing.
What sort of amazes me was how quickly I was able to find the problem (and my correct identification of it as a scoping problem). It’s hard to explain to non-programmers, but JavaScript is fundamentally different than most languages, and learning it has been kind of mind-expanding for me. My first brush with it was sort of distasteful, it was a poorly named bastard stepchild of a language.
Today, it runs the web. Google Apps, Flash (via ActionScript), any sort of web interactivity,really, is done with JavaScript, so it’s a good language to learn. Both practical, and mind expanding;) (Now I just need to learn LISP.)
Anyway, I fixed the problem, and got my reports working, and kept meaning to let the EJS folks know about it, and subscribed to the list to hear more about it as I worked. A day or two later, someone had the same problem, so I posted my patch. It was four characters long, just “var ” at the right place in the code, but it fixed the problem.
They wrote me earlier this week, as they merged my “patch” into the primary JavaScriptMVC code, and they wanted to give me credit. That’s pretty awesome, and not why I did it, but there I am, a padawan and everything.