Wednesday, 2 October 2013

Hang on... what did Rakshith say?

I was writing the previous blog article about improving thread syntax, and suddenly went... hang on... what? What did you say, Rakshith? And I dug back into his blog article from yesterday "ColdFusion: News and Updates from Adobe"...

This was buried half way down the article:

There are quite a few language improvements such as [...] member functions that are already a part of the upcoming version
What?! Member functions? COOL.

I wrote a blog article about this a while back:  "Improving ColdFusion CFML's OO-ness", basically pointing out that CFML has allowed us developers to write OO code using components since CFMX 6.1, but during this time CFML itself has steadfastly remained procedural, having stand-along functions which take data as arguments, as opposed to the data having methods which act on it.

EG, procedural:

numbers = ["tahi", "rua", "toru", "wha"];
arrayAppend(numbers, "rima");


numbers = ["tahi", "rua", "toru", "wha"];

This means that suddenly our code and CFML's code starts fitting in better with each other, making for a more uniform coding experience.

I raised an E/R for this: 3559652, and at the time Rupesh commented that it would be a good E/R, but not for ColdFusion 11, perhaps 12. However that comment has been removed, and the ticket is now marked as "fixed".

Fantastic is all I can say. And it's this sort of feature that makes me go "COOL!"... much more so than <cfclient> and that sort of thing.

I wonder if one will be able to do this:

["tahi", "rua", "toru", "wha"].append("rima");


IE: literals are also objects too? It's not the sort of thing one would do all the time, but I think the idea that "everything is an object, even literals" is a good thing to aim for in a language.

In closing: yes, I know Railo already has a partial implementation of this stuff... that's not to say we can't also be pleased that ColdFusion is doing it too. I hope the implementations are cross-compatible!

Brilliant stuff, Adobe.