Why was IsDefined() deprecated? (and less performant alternatives not?)

Ha well you piqued my curiosity as well, and turns out I have IsDefined() in 68 files.

Some of those are from cflib.org, another reminder of how it’s not deprecated in Adobe CF.

And now I’m thinking about how I’ve been using IsDefined() for a couple decades, including the half decade after I switched to Lucee, and yet apparently I’ve had no reliability issues with it.

@Zackster, what are the specific conditions that make it unreliable?

Sounds like knowing what to avoid could be useful to many, and if you can let us know, I’ll try to allocate some time towards updating the Lucee doc page for it (mostly for learning how to do that), if that’s okay with everyone?

1 Like

I ran a regex search for

\W(list|of|deprecated|functions)\(

2/3 appear to be “easy” replacement patterns.

It got me to thinking, has anyone attempted to put together a few basic re find/replace snippets (that they care to share with the community as examples for common replacements)?

More docs / examples would be nice either way.

Deprecated - doesn’t necessarily mean that it will “ever” be removed, rather;

  • It MAY never get any updates.
  • It MAY get removed entirely.

So, I always read “depcreated” as;

  • look for alternative methods / procedures to get what you want.
  • use those new alternatives, moving forward
  • when you have some spare time, backport those solutions to existing code.

Gavin

2 Likes