I have a lot of code to maintain from a prior empl...
# cfml-beginners
f
I have a lot of code to maintain from a prior employee and of course like an expert programmer, he left no comments, because good code always comments itself right? But seriously, practically every page has <cfsilent> tags, and from what I see, they is no need to use them. I asked him why he used them in an email to him, but he only said "read the docs!". Was there a cfsilent fad awhile back that I was unaware of? It's standard html, do I need to post some of the code for you guys to discern? Is it sort of a comment tag?
b
I had no idea that tag even existed. Seems kinda silly.
f
Me neither. But he seemed like he had some esoteric knowledge above us mere mortals
s
I knew it was there, but if I was worried about whitespace in an app, I usually just used cfsetting enablecfoutputonly="yes"
or cfcontent reset=true
b
I guess you could use it as a sort of output=false that you might use in a component/function but within regular cfml tag code. Using it seems to me like a sign that the code needs to be refactored, haha.
s
might have been more useful way back when people used custom tags
especially for recursive tags and stuff like that
f
makes sense in that way
s
all the blogs posts I see about it on google are from like 2005
so yeah
f
one of the old devs who used to work there said it was probably held over from fw1 dev ways
he himself never used them, but the other guy did
s
I would probably be embarrassed to look at any code I wrote more than 10 years ago.... or last week
b
haha, ain’t that the truth
f
yes, it was certainly a popular way to suppress whitespace at one time, I haven’t found the need for it in many years because you can now use output=false on components or use script based components which don’t generate whitespace
s
I was just reading your blog from 2006 about it 😉
f
darn, so it is my fault! 😆
s
no... it's definitely @Mark Takata (Adobe)’s fault
apparently it's the fault of the year 2006
f
it was a very good year for cfsilent
r
The only time I ever had to use it was when xhtml strict was a thing.
f
yeah, xhtml was popular around then
s
there used to be a cf blog on cfsilence.com, but it looks like they went into seo since then
a
It predates CFCs existing. Back when all code was in .cfm files, it was the most expedient way of making sure a block of tag-based code didn't emit its indentation to the resulting response document. I'm not sure whether
<cfsetting enablecfoutputonly="true">
actually helped with this.
m
Modern Adobe CFML engines have a built-in setting for suppressing whitespace (which can be turned off) in the administrator
I believe this has the same functionality as wrapping a block of text in <cfsilent>. It used to be that CF would pass through a ton of nasty tabs, spaces, line returns and the like. But it has been a very, very long time I think since that was the case.
a
That setting used to break some stuff that it shouldn't mess with. Like
<pre>
tags and... there's some dodgy CFML UI tags that do a similar thing., I think. Wasn't usable, globally. As for "modern" CF versions... I can't remember when that wasn't a feature? I think? When did it get added? Pretty sure it was already there in CF9, which is the last CF version I used in production.
f
We run cf11, so it's pretty archaic
m
Remember though, code could have been written in an older server server version and moved to newer servers
And not all devs keep up with the changes that occur. In fact, few do.
there's some dodgy CFML UI tags that do a similar thing
Sir, all the CFML UI tags are dodgy lol
Maybe not for long, but currently, I do not recommend using any of the CFDiv stuff, for example. They'll suck the paint off your house and give your entire family a permanent orange afro. (points for getting that reference btw).
Scott wins a prize! See me at Summit for your special prize Scott. 😉
s
Man I haven't watched that movie in forever but loved it back when I had a vhs player and rented movies at blockbuster
f
I met my wife at a blockbuster from a news paper ad lol
m
I'm not sure why every slack thread me, scott and adam are in derail into hilarity but I'm 100% here for it
s
Lol... I think I just didn't have a lot going on today.
I'm not sure if I will be able to go to summit but if I do, I'll definitely come ask for my prize
e
CFSILENT was and always will be a miracle of code as the previous code (not sure which engine, I know it was Macromedia owned) I had templates all written in includes that were marked up ascii CHR values to build an "EDI" compatible file as extra characters would break the export and import.
a
Just for the record... I was an cfsilent user when running on cf4.5. That engine was heavily generating whitespaces from any available code everywhere... even of code outside cfoutput body. The output stream generated big blocks of empty lines... aweful. Just remembering that at that times you didn't have any browser dev tool too that would magically beautify the source. You had to look the source directly on Netscape or IE5 🤔 (urgh... Just remebered quirks mode). I think I was developing on hotdog back then.. or homesite?
a
FWIW - one scenario where silent could be important would be if you are maintaining an older code based of cfm and includes and the code is generating a lot of XML. Whitespace, XML and especially external DTDs are not always friends.