April 16, 2018
On the new CF2018 “named parameters” feature
Comments
(2)
April 16, 2018
On the new CF2018 “named parameters” feature
ColdFusion troubleshooter
Wizard 146 posts
Followers: 115 people
(2)

As with each release of CF, there are the things that will get lots of attention or promotion, and then there are the little things that may be just the thing to make a developer’s life easier. That’s the case with a little hidden gem in ColdFusion 2018 called “named parameters”.

What the point of this new feature? It’s that as of CF2018 you can now call CFML functions using named arguments, rather than the old positional ones that we’ve always had to use (which are of course still supported).

So let’s see an example:
….

Easy to miss, from the new CF2018 docs

You might easily miss the feature (and even miss its purpose), if you judged it only from the one sentence in the (current) beta release notes:

Named parameters

In the 2018 release of ColdFusion, we have introduced named parameters for the functions, that are  listed here.

Doesn’t exactly make you get all tingly inside, does it? You may also not be tempted to follow the link, but if you did, it would open to a 12-page PDF with no title or discussion, just a very long of functions, which may seem familiar.

The PDF is a list of list the functions and their newly available named parameters (or arguments, as some–and some CF docs–have long referred to them).

As for that odd PDF above. I suspect at some point it will be folded into being just a new section of the CFML Reference, listing them–unless instead someone does the painstaking work of putting each function’s new named parameters into the CFML Reference page for that function. Maybe that’s the plan, and why they have not listed this “doc” along with others on the main beta page.

2 Comments
2018-05-10 18:00:22
2018-05-10 18:00:22

The other thing that is not so good with the documentation is that they list functions that do not have any parameters as accepting parameters. Functions like

isuserloggedin()
now()
pi()

Like
2018-05-10 17:42:05
2018-05-10 17:42:05

The documentation should also cover all the member functions that can do the same

Like
Add Comment