Q: Do you use the Lucee syntax to get things done ...
# lucee
p
Q: Do you use the Lucee syntax to get things done or do you play it safe?
s
'lucee syntax'?
❓ 1
you mean vs. engine-neutral syntax?
p
like looping over a query in cfscript syntax.
s
pretty sure you've been able to do that in acf for a while now
r
I'm guessing you're referring to the Lucee language syntax that was introduced but I think has been deprecated.
s
yeah there used to be things like
object[method]()
that you could only do on Lucee but I think ACF has most of them now
vs.
invoke()
p
Does acf use
Copy code
loop query=q {}
s
don't think I've ever seen anybody use that. we would just do:
Copy code
for ( var row in query ) {}
or use QB and just treat it like an array
r
queryEach(), queryFilter(), queryMap(), etc.
p
And I've never used those 3 functions. Yikes.
s
I haven't either, but only because I prefer treating queries as arrays of structs rather than the CF 'query object'
r
You can use the equivalent version of those for arrays.
Or use the member functions and it doesn't change whether you're using a query or array.
It's just query.each() or array.each() and you can chain them in Lucee.
a
Ugh. Come on. Stop trying to be clever and demonstrate you know things that might've been incompats in Lucee at some point, but aren't now. Well done: you've clever. There are still things in Lucee that are not compatible with ColdFusion, and that's what @phillipsenn is talking about. It was a simple question. To give a useful answer (maybe): we use whatever syntax is most expedient in Lucee, and don't care if it works in CF. We are, however, in a situation where we 100% know that this software will never need to be run on CF: it is being decommissioned (albeit slowly), and will be shifted off CFML altogether before it would ever shift to CF (no slight on CF... just that it's on Lucee now, and on Lucee it will stay). For my own code... I would not actively use functionality that is Lucee-specific, no. I think it was a mistake on Lucee's part to ever develop features that are not part of CF.
s
There are still things in Lucee that are not compatible with ColdFusion,
like such as? perhaps you have a list that isn't deprecated? I don't, I'm not clever
specifically syntax?
r
[1,2,3].each() but that's more a bug in ACF I would say.
s
while it may be obvious to (some people, e.g. Adam), it's not obvious to me what 'lucee syntax' meant, so while it may be a simple question, it isn't an unambiguous question, and in my experience many of the old incompatibilities are no longer incompatible this in no way rules out the existence of current incompatibilities, but it sounds like the question was about a specific type of expression, and so it seems relevant whether the question relates to "functionality intentionally specific to Lucee" (which I agree was generally a bad idea) versus "functionality Lucee happened to get to first which ACF added later" aside from that, it's in no way appropriate to go picking a fight over an otherwise banal question, so perhaps Adam will consider exchanging what might charitably be interpreted as a 'shut up, other people' for his customary direct answers that we all know and love
Granted, not all syntax differences.
Another avenue might be to check cfdocs and if there's a uniform way of searching on "shit that's in Lucee that ain't in CF".
It occurs to me to add to my answer that I would try to not leverage any behaviour differences in Lucee's CFML if I was in less of a certain space (ie: that we def will never need this code to run on CF). I'd take CF's behaviour as a baseline, and consider any Lucee differences to be a bug (either an inadvertent one, or a poor design decision to vary from CF's behaviour).
a
There are also some behaviours in lucee which are different to defaults in ACF eg arrays pass by reference but I know you can set a config setting in acf to do that. In terms of BIFs you might find some new ones. I personally don’t see it as an issue that lucee deviates and or adds new features as really only framework developers are bouncing between engines.
👍 2
g
echo()?
👍 1
I think it is a matter of "where is this going to be used?" Am I doing work on an internal system - that will never, ever leave the premisis? Am I writing something that will be deployed "elsewhere" on a server OS / CFML engine that I have no control over? I don't mind if Lucee adds functionality "XX" because it is an awesome idea - and I would like to use it.