Friday, July 21, 2006

Amazon Mechanical Turk

I'm still not entirely sure what to think about Amazon's new beta service entitled Mechanical Turk, labeled as Artificial Artificial Intelligence. The concept is WAY out there. Basically they realize that humans are actually better than computers at doing certain tasks. They use the example of a human finding an object in a picture before they can even talk. The provide it as a observing with an API you submit a request and a human processes it. Its not instant, in fact it might take a long time. Why? Well because the humans in the Turk are you, me, or anyone with a connection to the internet. That's right anyone of us right now has the option to be in the Turk but seeming as how a quick google search turned up few results I am not sure how many people are in the Turk. I doubt anyone will get rich being a Human in the Turk but it can provide some fun, if worse comes to worse it might provide for a burger or 2 when you're in college, or allow a board house wife (or husband) to make a few bucks to buy some trinkets here and there. I'll definitely post more about this webservice as I play around with it more.

Saturday, July 08, 2006

FusionDebug - About to change how we Develop

My company employs about 20 coldfusion developers now, and we're still growing so if you are interested in working for a fortune 25 company in southern Ohio let me know!!! Our developers have diverse backgrounds, some were mainframers, some were Java developers, heck we even have someone that used to be a bag boy at a store, one sharp guy too by the way. For those of us with backgrounds in compiled languages we crave a debugger that lets us step through our code. This is something that has been missing from Coldfusion for, well for as long as I can remember. For those of you that attended CFUnited you may have heard some buzz about FusionDebug. All I have to say is I can't wait to play around with this little puppy the demo is exciting enough. I just want to give a big Kudos to the developer(s?) at Intergral for the work put into this; very exciting for the CF community!

Friday, July 07, 2006

One last piece on Duck Typing then I think I am about all quacked out (when will these silly puns end???).... This is in response to Dave's comments over here, as well as some clarification to the general atmosphere in regards to duck typing. First I want to make a correction, something I failed to mention in my initial post. My comment in the Duck Typing session is that I had been tinkering around with using ANT to remove type for production. Sean, I believe, misunderstood and conveyed that I was using this in production. This couldn’t be further from the truth, the bulk of our applications are legacy CF5 applications. I neglected to correct that in my original post but I wanted to make sure that is clear.

Something else I want to make perfectly clear, I 100% agree with the sentiments of Sean, Dave, and a large majority of others out there. Duck Typing is a really cool technique but it is not something to be used everywhere (read: abused), especially for performance. I'll leave it to the other 50 blog posts I've read to explain when or where it should be used. The ANT script is forcing people to put duckType="true" into their function and argument declarations for a reason; to clearly state where duck typing is being used for performance. This designation servers as documentation, for debugging. A additional intention was to force a developer to THINK before they [duck] type. What I realize is that regardless of what I have to say about not using duck typing for performance it will happen. My hope is that people are at least checking code into a source control that is not duck typed in hopes that QA, unit testing, and documentation are more accurate to the intent of the application/objects.

In direct response to Dave's comments I would like to think that unit testing would reveal something like a string passed instead of an object and that the application would be constructed to handle this appropriately. Though that was just an example and Dave's underlying point was Duck Typing for performance, no mater how you slice it, can be problematic. Dave has a perfectly valid point and I want to restate that if you insist on using duck typing for performance please please please use type restriction and return types in your development, and testing. I also want to go one record as agreeing with Dave’s other point which is database tuning can yield the highest returns in regards to performance. If you do us duck typing for performance it should be one of your last stops, not first,along the performance tuning path.

Wednesday, July 05, 2006

Open source Software is by and large awesome. If you work for a large company the barrier to adoption is sometimes overwhelming. In fact on one of our large projects, our employee schedule forecasting system was set to use the normal java open source stack, struts, hibernate, ect. There was a fear to use open source so our company ended up purchasing a framework from big blue...Our company has also adopted CVS instead of Subversion because maturity model score for subversion was too low.

Well some folks in Amsterdam took it upon themselves to make a movie using nothing but open source software. The result is something I couldn't believe. An entirely open source movie, free as in beer and free as in source code. Its slightly out there in plot but the graphics are quite simply amazing. Take that Pixar.

Friday, June 30, 2006

Duck Typing for performance... lets face it when it comes to performace people attempt to squeeze every millisecond out of thier code. Duck Typing is a tremendious technique that Coldfusion's typeless nature affords us. It just so happens that Duck Typing can lead to tremendous performance improvements in CFC heavy applications. As many have commented while this is great it destroys the documentation in CFC explorer. Personally I think Duck Typing should be primarily used as a development technique not a performance booster. That being said it cannot be denied the performance you can get is pretty amazing. If you are using duck typing solely for performance gains its important to only use this in production. Your code that is used for auto documentation, in development, as well as stored in source control should have return types, types, and required attributes. You can accomplish this by appending the below ANT task to your deploy process, I would recommend deploying your Typeless CFCs to QA and production. Please note that anything you want stripped needs to have ducktype="true"* at the end of the tag:

<property name="path_to_project" location="../test/duck" />
<target name="Duck Type">
   <replaceregexp match="(cffunction[.\w]*?)([ ]?returntype)[ ]*?=[ ]*?(.)(.*?)\3[ ]?(?=(ducktype))"
      replace="\1 "
      flags="igm">
      <fileset dir="${path_to_project}"
   includes="**/*.cfc"/>
   </replaceregexp>

   <replaceregexp match="(cfargument.*?)([ ]?required)[ ]*?=[ ]*?(.)(.*?)\3[ ]?(?=(ducktype))"
   replace="\1 "
      flags="igm">
      <fileset dir="${path_to_project}"    includes="**/*.cfc"/>
   </replaceregexp>

      <replaceregexp match="(cfargument.*?)([ ]?type)[ ]*?=[ ]*?(.)(.*?)\3[ ]?(?=(ducktype))"
      replace="\1 "
      flags="igm">
   <fileset dir="${path_to_project}" includes="**/*.cfc"/>
   </replaceregexp>
</target>



If you prefer to not require the use of ducktype="true"
just remove (?=(ducktype)) from the match pattern. Additionally if you prefer to replace returntype="*" with returntype="any" instead of deleting it you can set replace equal to \1\2=\3any\3.

*It is worth noting that the regex simply matches ducktype as an attribute. You can have ducktype='false' or ducktype="goaway" and it will still convert your functions/arguments.