If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
CF-Talk has had a discussion started by my buddy Andy about the whole javax scripting that is in Java 6 and thus available for use in CF8. What it allows is basically the ability to use different languages (.NET, Ruby, PHP, Python) inside of your CFML. Now at first glance someone would say “why they heck would you do this?” but I see the endless possibilities here.
2 cases I can think of that I have come across in the last 2 years.
1. Integration
I worked on a project where I needed to encrypt a string and send it to a web-service. Now I was given C# code and told “here is how we encrypt it”. Of course the best way would have been to just SSL it which we were doing anyways, and encrypt it on the other end. But Alas this guy gave me his whole private encryption key and wanted me to do it on my end (yes this was a major credit card processor and yes the text strings were credit cards)
I couldn’t for the life of me get CF to work using the encryption method that he was claiming was needed. I ended up creating a page in ASP.NET and posting to it and having it give me back the encryption. yeah MAJOR hack.
It would have been WAY easier to just drop his encryption code in from .NET and BAM be done with it.
2. Sometimes CF just doesn’t cut it
Yes sometimes CF just doesn’t do what you need to do. Case in point I had an XML “database” from a partner that I needed to parse. Any CF’er that gets the old “Just FTP it down and parse it”… yeah it was 80 freak’n meg!
CF would puke just about every time.
Along comes Python and the ability to parse an XML doc one line at a time instead of moving it all into memory THEN parsing it. If I was able to drop a few lines of Python in it would have made my life and 3 weeks a LOT easier… heck I could have taken 2.5 weeks off.
So yes if you can harness the power of other languages then do it. I don’t recommend writing it all in PHP wrapped in CF but at least it is a starting point.