Hidden Gems in CF2018, Part 5 – Language Changes

April 8, 2019
ColdFusion troubleshooter
Legend 48 posts
Followers: 48 people
0

Hidden Gems in CF2018, Part 5 – Language Changes

ColdFusion troubleshooter
Legend 48 posts
Followers: 48 people
April 8, 2019

Continuing with part 5 of the series on Hidden Gems in CF2018, next up is a discussion of changed language features, of many kinds and categories. And as these are discussed in more detail in other blog posts or docs, I will in this one just point to those, where you can learn more. I offer them in the following categories:

  • New language features
  • New OO language features
  • New CFML functions
  • New member functions
  • Changed language features

New language features

First up, there are several language enhancements (new tags, statements, or language elements), that many or most developers could leverage in day-to-day coding. You’ll definitely want to read up to learn more about each of these:

OO language enhancements

If you’re doing (or considering) object-oriented development in CFML, the following are new language features related to that:

You can find still more about the first three of these in a two-part series of Adobe blog posts, Part 1, and Part 2, and more about default functions in yet Adobe blog post on that.

New CFML functions

With most new releases of CF, there are new functions made available, to solve various problems. CF2018 is no different, adding the following:

  • ArrayFirst, ArrayLast
  • QueryDeleteColumn, QueryDeleteRow
  • CacheGetEngineProperties
  • RunAsync
  • StructIsOrdered

You can find more about these in the docs as well as an Adobe blog post.

New member functions

If you may not be familiar with them, member functions are a relatively new way (in recent CF releases) to execute functions against CF variables, by appending the function name to the end of the variable reference (rather than how traditional functions work, where you might execute a CFML function by passing it a variable or other argument).

There are different kinds of member functions depending on the TYPE of variable. Indeed, there are too many new ones to list, so instead I will just note that they are in the following categories:

  • query functions
  • array functions
  • xml functions
  • async functions
  • numeric functions
  • date functions
  • As well as changes to some existing member functions

And you can find more about them in the CF docs.

Changed language features

That’s it for the new language features. Let’s wrap up with some changes to language features. You can now:

  • chain member functions (docs)
  • slice (extract) array elements (docs)
  • disable CF returning the generated primary key for insert statements you may execute, an option previously controlled only at the datasource level. See new disableAutoGenKeys attribute for cfquery (docs), or the queryexecute function’s optional queryOptions struct (docs)
  • control height and width in responsive CFCHARTs ( docs)

There are also a few array and string enhancements, allowing you now to have:

  • Typed arrays
  • Array negative indexes
  • Array slices
  • Member functions now supported for string literals

You can find more on these in the Adobe blog post on them.

As a reminder, developers can also leverage the new caching options discussed previously in part 2 of my series here, on Admin gems.

So that’s it for new and changed features. In the next post, I will focus on compatibility issues, whether you are (or are considering) moving to CF2018 from CF2016, or from CF11, or even earlier.

Comments (0)
Add your comment