ColdFusion 9 brings a great set of new features and language enhancements but personally none greater then full cfscript support. I am not sure but there has been a large number of people who have spoken out against this enhancement so I wanted to take some time today and go over the new enhancements on cfscript and some personal thoughts on the feature.

First off I wanted to touch on the fact that a lot of people have come out against this feature which I really don't understand. I personally don't use cfscript a lot because of the fact that I had to switch between script and cfml when I had to use tags like cfmail and cfquery. That problem has been eliminated and the ColdFusion team has brought to us full cfscript support.

I am a huge fan of this for 2 reasons. I think that the script support just looks better but more for productivity. The one problem I have always had with writing components is the very verbose nature of components. This is going to drastically cut down some development time and since the bulk of my time is spent writing component I am going to be pretty happy. People have expressed that they really don't like this feature and to them I would say to you, that's fine. You can continue to write your components in CFML and there will be no change for you. Another great idea would be to a ColdFusion Builder extension that would be able to convert cfcs from cfml to cfscript and vice versa.

Now that we have gone over some information about the feature let's dive into some actual code. First we have an example of user component that has been written in complete script. One of the cool features I think is the ability to keep our code clean by using JavaDoc style notation for documentation and meta data.

Then if we wanted to invoke this component we could work with the new keyword "new".

We can also take this one step further and I will talk about this more in another blog post but there have been some enhancements to cfcs that allow us to generate getters and setters by declaring properties. We can take the code from above all the way down to this. You will notice that we don't have any getters or setters defined but because we declared the property for each, those methods are in fact available for use. We run the setters in our constructor and use the getters in our get properties method.

Finally another really great thing that I wanted to point out was that ColdFusion Builder has full support for the script syntax! I just wanted to take a second to fill people in on this enhancement and as you can tell I am pretty excited about it. Please chime and let me know what your thoughts are.