Why does CF use tags?

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default Why does CF use tags?

    In a recent post I asked the question, is CFML valid XML. More precise, I
    stated it wasn't. It can be, but CFML allows constructs that are invalid when
    you look at the code as XML. But today this raised another question. Why did
    Macromedia develop CFML at all? What use are 'tags' in this day and age where
    everyone is moving towards standards, if you don't make sure the 'tags'
    actually conform to a industry wide standard (XML being the de-facto 'tag'
    standard).

    Why did MS choose to make ASP.NET valid XML (all tags have a strict <name
    attribute="value"/> form, and all ASP tags live in their own namespace. Cocoon
    is another fine example of a Framework built around XML, and so is Flex, anothe
    Macromedia product. And to take another example, PHP's Smarty Template engine
    also works in XML

    So why is CFML not XML?

    Disclaimer: I'm new to CF, and I don't intend to flame, I just want some views
    on this (I might even be wrong about this).

    Michiel1978 Guest

  2. Similar Questions and Discussions

    1. How to treat template tags as comment tags?
      Hi all, I am using DW MX to edit templates for a FreeMarker application. The template tag fromat is like so: <ul> <#list birds as bird>...
    2. ASP.NET tags
      hi A further addition . . . My designer is using an Apple Mac to design his pages (as good designers do) - he seems to think that the .NET tags...
    3. My Own Tags
      I am currently working on a modular system where I need to implement SNIPPETS. I need to be able to write on my php pages something like ], so that...
    4. Alt tags
      You want the alt attribute to be the same color as the background color of the cell? I'm not sure what you are asking for. The alt attribute is...
    5. Using ParseChildren attribute to load child tags - VS removes tags
      I am building a poll control, nested in the tag I have child tags to setup the poll options. Everything works fine, but when I edit a property in...
  3. #2

    Default Re: Why does CF use tags?

    Macromedia didn't develop CFML... Allaire did, a decade ago. Well-formed markup wasn't a big priority in the mid-90s.

    Essentially, your question is akin to asking why HTML isn't XHTML.
    rogben Guest

  4. #3

    Default Re: Why does CF use tags?

    CF was developed by Allaire 10 years ago, before ASP and most other current
    server-side scripting languages. HTML was new to the masses and providing an
    HTML-like style of programming allowed many to get into the game. Macromedia
    purchased CF from Allaire, what, 4-5 years ago?

    Once CFML showed up, Microsoft found that yet again, they'd missed another bus
    to the Internet and brewed up ASP. Later on Java shows up and uses tag
    libraries (similar to CFML tags) via JSPs in order to speed up development and
    provide code-reuse.

    You can write most CFML without the tags using <cfscript> blocks.

    And fwiw, most, if not all, CF tags *can* be written <cfset foo = "some
    string" />. It's preferred from 6.0 on, just not enforced as there's a lot of
    legacy code out there.

    cf_menace Guest

  5. #4

    Default Re: Why does CF use tags?

    Originally posted by: rogben
    Essentially, your question is akin to asking why HTML isn't XHTML.

    Well, XHTML is XHTML, since a few years actually, they made the step because
    there are significant gains to using XML. Just like ASP has made the step to
    ASP.NET some years ago. And any new framework is either a new language (like
    Ruby) or XML-based (like Cocoon). And I knew Allaire was originally behind CF,
    but it was my understanding that CF was completely rewritten by Macromedia to
    run on top of Java. This was not 10 years ago, yet they did not decide to make
    it XML compatible.

    So this leaves my question a bit unanswered. Why use tags, and by 'use tags' I
    mean a statement/expression that starts <tagname> and ends </tagname>, if it's
    not gonna be XML?? (THE standard when it comes to any tag-based language, and
    the X is for extensible).

    I have a big fat book on Coldfusion, and I'm in chapter 12, page 300, and all
    I've seen is tags. But it looks fugly (I'm sorry) compared to C-like language
    constructions, and it's not XML at all!. At least move the CF tags into their
    own namespace, you know? So I understand there's a CF Script, but Ben Forta's
    book is using tagsoup all the way, so they seem to stand behind their use of
    tags, it's not simply to be backwards compatible, otherwise they would promote
    the use of CF script

    Michiel1978 Guest

  6. #5

    Default Re: Why does CF use tags?

    I'm asking this without sarcasm or derision:

    Who cares if is not XML-compliant? What would be the point of rewriting it so
    it was?

    CFML in either of its two flavors (the original tag-based code or the
    ecmascript-based cfscript) is strictly a server-side language. There is no
    need to enforce an artificial standard such as forcing all of the code to fit
    into an xml-style model. XML is about translating data to different platforms
    seamlessly, and this has nothing to do with CF's server-side scripting, which
    is meant entirely for its own internal consumption. It has tools to manipulate
    incoming and format outgoing XML strings for systems that require such things.

    CF was indeed rewritten to run on top of Java, although that effort was begun
    when the product was still at Allaire and finished by MM. The idea was NOT to
    rewrite the tag-based language but rather to change the underlying architecture
    for a variety of reasons, mostly related to performance, scaleability, ubiquity
    etc. etc.

    To make such a change would have been a reinvention of a well-rolling wheel,
    for starters. Further I don't see what such a change would accomplish, other
    than aesthetic for those who like to see and think in terms of XML script. For
    others the change would be undesirable. I vastly prefer cfscript myself, due
    to its more spare nature and cleaner look, which I find more readable and thus
    maintainable.

    I talk to other developers who read cfscript'd code and grumble "whats that...
    I can't read cfscript" which I find amazingly dull-witted, so I suppose others
    can have similar opinions when looking at cfml in either of its two current
    forms.

    CF is about swift development, and providing a platform with great power and a
    shallow learning curve. Tag- and script-based coding is a proven performer in
    this regard.

    --Matt--
    MSB Web Systems... [url]http://mysecretbase.com[/url]
    It's always easy to see both sides of an issue we are not particularly
    concerned about.


    MattRobertson Guest

  7. #6

    Default Re: Why does CF use tags?

    Originally posted by: MattRobertson
    Who cares if is not XML-compliant? What would be the point of rewriting it so
    it was?

    Well, I 'care' (just wondering that is), that's why I asked. And it seems many
    people care about XML, no need to argue about that. And the basic point remains
    the same, if you start with a '<' and end with a '>' and then optionally have
    one duplicate which starts with a '</' and ends with a '>' we're talking tags.
    Why NOT make it XML? If CFML started with {$EXECUTE-> and had no end 'tags' I
    wouldn't be having this conversation, since that is nothing like tag based
    markup.

    Truth is, it works. I agree. Ofcourse I understand the rewrite was to change
    the basis, and make it scalable and cross platform. But why NOT at the same
    time make it XML? This is about those developing something using CFML, it is
    about CFML in it's self.

    Imagine the servlet responsible for scanning .cfm templates. It has to pick up
    CFML code right? If the page was valid XML, it could use available tools for
    parsing and transforming (XML transformation is pretty powerful stuff). Tools
    like Xerces and SAX and more. But now they probably have programmed their own
    servlet with a lot of logic to handle all different kinds of CFML
    constructions, since Xerces would surely choke on CFML in it's current form.

    Imagine storing CFML in an XML database such X-Hive. Not possible. Trying to
    get to statements in CFML using X-Path, not an option. Transforming CFML using
    XSLT, no go. XML has so many tools and possibilities, I wonder why NOT.

    MathML, C(hemical)ML, XHTML, MacromediaML (used in Flex) it's all ends in ML,
    they're all markup languages, and they're all XML compliant. Except CFML. I
    just wonder about such a thing. And that is regardless of wether it works good
    the way it is, we all know it works, this whole forum is probably a big
    <cfquery datasource="whatever">...

    Michiel1978 Guest

  8. #7

    Default Re: Why does CF use tags?

    Originally posted by: Michiel1978
    But why NOT at the same time make it XML? This is about those developing
    something using CFML, it is about CFML in it's self. Probably because they
    were already -- literally -- reinventing the wheel on the back end.
    Reinventing it on the front end would't make sense unless there was great
    demand for it.

    Honestly, I don't see that happening -- the demand I mean. I understand the
    benefits you're discussing but you'd be tinkering with the very nature of CF's
    RAD capability. I don't think you'd find a lot of support for such a thing.

    'course I could be wrong...

    --Matt--
    MSB Web Systems... [url]http://mysecretbase.com[/url]
    I suppose most of us overlook that fact that even Vulcans aren't
    indestructible.
    - Kirk, "Amok Time," stardate 3372.7.



    MattRobertson Guest

  9. #8

    Default Re: Why does CF use tags?

    "Michiel1978" <webforumsuser@macromedia.com> wrote in message
    news:d9a2da$kn5$1@forums.macromedia.com...

    [snipped: a whole bunch of stuff I've never had to do or even heard anyone
    vaguely mention they had to do with CFML and XML]
    > the way it is, we all know it works, this whole forum is probably a big
    > <cfquery datasource="whatever">...
    What does that mean???


    Brian Simmons Guest

  10. #9

    Default Re: Why does CF use tags?

    Michiel1978, I believe your question is valid. I'm going to reiterate what a
    couple posters have already said, as well as throw in some of my own
    speculation and reasoning.

    CFML is not XML for several reasons.
    1) when it was originally designed, XML wasn't big (SGML wasn't big either,
    and it was just big and nasty and noone wanted to think about it). It was
    designed to generate HTML pages, back when HTML was really basic.
    2) CFML is a server-side language, not meant for other services to consume
    non-parsed CFM pages. By the time some other process receives the page, all the
    coldfusion tags are gone.
    3) CFML is designed to be simple.

    Now, I agree with some of your points. The ability to validate a CFM page by
    pushing it through an XML validator would be cool. Pushing a CFM page through
    an XSL transform to make a different CFM page would also be cool, but not
    something the majority of coldfusion developers would do.

    You keep referencing tags with the assumption that to be "tags", they should
    be well-formed matching "tags" or empty "tags". Back when CF was first written,
    that wasn't the case (and still isn't the case for the majority of people that
    are using HTML, not XHTML). Alot of WYSIWYG HTML editors still don't generate
    valid XHTML. Why is that? Because it isn't a priority.

    You also reference MathML and XHTML, stating that since they end in ML and CF
    ends in ML that it should be a valid XML markup language. HTML ends in ML and
    it isn't valid ML. There are other MLs out there that aren't valid XML.

    So, CF uses tags because that's what it was originally written to use, and it
    was written to be user-friendly to people that were used to looking at HTML,
    which was tag based (and not well-formed, by the way). It also makes it fairly
    simple to edit CFM pages in HTML editors, even WYSIWYG HTML editors, because
    the tags they don't understand they can just ignore.

    I know this was all over the place, but here's my 2 cents: Would it be cool to
    have CFML be well-formed, valid XML, maybe even go so far as to have it defined
    with XML Schema so it could have its own namespace, etc etc? Sure. Would a
    majority of CF users see a benefit? Probably not. Would a change that major
    have the potential to break alot of code? Yes. Does it make business sense at
    this time to do a change like that and still call it CFML? or would it make
    more sense to do what Microsoft did with ASP going to ASP.NET? who knows. Would
    I use some of the cool things you could do if CFML was valid XML? Probably not,
    but there's a slim chance that I'd take advantage of it.

    Kronin555 Guest

  11. #10

    Default Re: Why does CF use tags?

    "Well, XHTML is XHTML..."

    Indeed it is. But it isn't HTML, which was widely implemented before anyone
    cared about closing empty tags. Thus the comparison.

    "But it looks fugly (I'm sorry) compared to C-like language constructions..."

    And some people think Perl is purty, too. :D Different strokes, different
    folks.

    Sadly, making CFML's syntax more XML friendly would be a pretty big
    undertaking. Tags like CFIF would have to be radically changed, standard
    conventions like escaping quotes with "" would need to be tossed out, and a ton
    of XML cruft would need to be introduced. (For example, ampersands in a CFSET
    would need to double-escaped in order to produce an XML-friendly string, and
    preserving whitespace in a CFSAVECONTENT would get messy.)

    There's just no significant value proposition there, and more significantly,
    no demand.

    rogben Guest

  12. #11

    Default Re: Why does CF use tags?

    Why does it use tags? The simple answer is that it was really only intended
    as a marketing ploy. The idea being that curly braces (or any other syntax
    style) were scary and tags were less scary to new coders. The downside of
    this is that tags are actually scarier to coders who are used to curly
    braces, so it also served a a deterrent to many pros. (consequently, cf
    became known as a bit of a tool for beginners and not for "real" pros)

    It's literally just a coding style, thats all. Most other languages that use
    tags actually use them optimally and to their true strength, cf tags are
    stil little more than syntactic look alikes in many cases.

    The idea was to convince people that coldfusion was simle becuase it was
    like HTML. Many people thought that this literally meant that coldfusion was
    just as easy as HTML and not at all like learning programming. So it was
    actually quite a smart move way back then.

    However, as Matt Robertson said - its not really important that the tags be
    XML compliant. CF isn't intended for document or message mark up, the fact
    that it can manipulate actual xml is the importnat thing here. Still, it
    would be nice to take the syntax to its next logical level and benefit from
    the many spin offs of this.


    "Michiel1978" <webforumsuser@macromedia.com> wrote in message
    news:d99isn$rjh$1@forums.macromedia.com...
    > In a recent post I asked the question, is CFML valid XML. More precise, I
    > stated it wasn't. It can be, but CFML allows constructs that are invalid
    > when
    > you look at the code as XML. But today this raised another question. Why
    > did
    > Macromedia develop CFML at all? What use are 'tags' in this day and age
    > where
    > everyone is moving towards standards, if you don't make sure the 'tags'
    > actually conform to a industry wide standard (XML being the de-facto 'tag'
    > standard).
    >
    > Why did MS choose to make ASP.NET valid XML (all tags have a strict <name
    > attribute="value"/> form, and all ASP tags live in their own namespace.
    > Cocoon
    > is another fine example of a Framework built around XML, and so is Flex,
    > anothe
    > Macromedia product. And to take another example, PHP's Smarty Template
    > engine
    > also works in XML
    >
    > So why is CFML not XML?
    >
    > Disclaimer: I'm new to CF, and I don't intend to flame, I just want some
    > views
    > on this (I might even be wrong about this).
    >

    Verbunsk Guest

  13. #12

    Default Re: Why does CF use tags?

    i suppose you'd tell all the tag based jsp lib developers to stop too.

    as for tag syntax being a marketing ploy, how on earth would you know that?
    you were w/the allaires back then? scared off curly brace coders? i see sean
    corefield still at mm and still happily writing cf code.

    PaulH Guest

  14. #13

    Default Re: Why does CF use tags?

    > as for tag syntax being a marketing ploy, how on earth would you know
    > that?
    I'm going to go out on a limb and say, by reading the marketing material
    with CF1.x?

    Yes, tags were a marketing idea, it made Cold Fusion the BASIC of the web.
    Easy to use and easy to design applications in minutes. No compilers, works
    with notepad and it looked similar to the HTML already being designed.

    Unfortunately, it made Cold Fusion the BASIC of the web. And while you can
    design wonderful programs in BASIC (or CF), it's considered a starter
    language. Allaire later tried to improve their image by adding CFScript, but
    by that point ASP was already released and the CF price point was too high.

    -Greg


    Greg M Guest

  15. #14

    Default Re: Why does CF use tags?

    re - i suppose you'd tell all the tag based jsp lib developers to stop too.

    uh? what did he tell you to stop?

    re - as for tag syntax being a marketing ploy, how on earth would you know
    that?

    well, it doesn't take a rocket scientist. Familiar syntax, approachable for
    html coders, why would they not exploit this. As mentioned, a smart move.




    "PaulH" <paul@sustainablegis.com> wrote in message
    news:d9b6tc$c75$1@forums.macromedia.com...
    >i suppose you'd tell all the tag based jsp lib developers to stop too.
    >
    > as for tag syntax being a marketing ploy, how on earth would you know
    > that?
    > you were w/the allaires back then? scared off curly brace coders? i see
    > sean
    > corefield still at mm and still happily writing cf code.
    >

    Mister Guest

  16. #15

    Default Re: Why does CF use tags?

    Michael,

    Have you played with Fusebox? We use fusebox 4 and it uses XML for the business logic.
    JLove Guest

  17. #16

    Default Re: Why does CF use tags?

    i've been using cf since 1.5 & i don't recall that particular marketing ploy. i'd really like to see the cf brochure. can you scan a copy?

    PaulH Guest

  18. #17

    Default Re: Why does CF use tags?

    What do you mean, tell them (who?) to stop (what?).

    How could you stop using tags in cf, thats pretty much its biggest strength
    for many people is it not? Why on earth would stopping using them make any
    sense?

    As I said in my last post, they were (are) a smart idea, largely responsible
    for drawing so many of the original coders to it. If tags did not have their
    uses then jsp coders would not have been given them in the first place,
    yeah?

    But it is pretty clear that Allaire decided upon a tag based syntax for
    reasons to do with selling it's ease of use, by making a connection between
    HTML (which is simple) and the 'simple also' CFML language they were able to
    convince a great many non coders to make the leap into th eworld of web
    development, awsome idea, yeah?








    "PaulH" <paul@sustainablegis.com> wrote in message
    news:d9b6tc$c75$1@forums.macromedia.com...
    >i suppose you'd tell all the tag based jsp lib developers to stop too.
    >
    > as for tag syntax being a marketing ploy, how on earth would you know
    > that?
    > you were w/the allaires back then? scared off curly brace coders? i see
    > sean
    > corefield still at mm and still happily writing cf code.
    >

    Verbunsk Guest

  19. #18

    Default Re: Why does CF use tags?

    > And fwiw, most, if not all, CF tags *can* be written <cfset foo = "some
    string" />.

    Sure, but this does not force xml compliance. What about cfif? It would, in
    an XML compliant world, have to read:

    <CF:IF TEST="some test here"> do stuff here </CFIF>

    Note the proper XMl namespace of "CF:" and the "TEST" attribute.

    Its a bit funny that CF may end up being the only ag based language that
    actually doesn't work like other tag/XML like languages. XSLT is perhaps the
    most famous tag based language in recent years, and it works well. CF would
    do well to puse a similar model to this as it would do wonders for its image
    and provide soem very unique advnatages over non tag bag languages.
    (particulalrly in the areas of code generation, analysis, pre compile
    directives, and so on)

    The issue would be one of cost to redo the syntax to be proper xml/tag
    syntax -I don't think the demand is there financially to justify such a
    major revamp - and it would be major, btw.
    >> You can write most CFML without the tags using <cfscript> blocks.
    How do you access your database using cfscript?
    >Later on Java shows up and uses tag
    libraries (similar to CFML tags) via JSPs in order to speed up development
    and
    provide code-reuse.

    Keep in mind that java has these tags so that developers can give web
    designers their pages without worrying about them damaging their code. It
    also allows web designers a degree of control over dynamic behaviour as they
    are allowed to set simple attributes in the tags which can change the
    behaviour of a programmers code behind the scenes.

    Tags in JSP are not intended as a programmers syntax or to help a
    programmer become productive - they are an aid to web designers invloved on
    projects involving programmers. This is very different to tags in cf which
    are the primary means of programming logic. JSP tag libs play more the role
    of cf custom tags, not the role of actual syntax.

    In fact the JSP equivalent tag of CFQUERY is very controversial in the java
    world - almost all java programmers acknowledge that it should never be
    used!! (though some compromise that it may be acceptable for prototyping
    with)

    To teh majority of the development community, tags are clumsy and fugly! But
    t those who only know HTML it feels natural for a while. The thing is
    though, after html you almost certainly need to get to grips with
    javascript, so the tag advanatage becomes redundant anyways!




    "cf_menace" <amoreno@factorsofi.com> wrote in message
    news:d99njq$55k$1@forums.macromedia.com...
    > CF was developed by Allaire 10 years ago, before ASP and most other
    > current
    > server-side scripting languages. HTML was new to the masses and providing
    > an
    > HTML-like style of programming allowed many to get into the game.
    > Macromedia
    > purchased CF from Allaire, what, 4-5 years ago?
    >
    > Once CFML showed up, Microsoft found that yet again, they'd missed another
    > bus
    > to the Internet and brewed up ASP. Later on Java shows up and uses tag
    > libraries (similar to CFML tags) via JSPs in order to speed up development
    > and
    > provide code-reuse.
    >
    > You can write most CFML without the tags using <cfscript> blocks.
    >
    > And fwiw, most, if not all, CF tags *can* be written <cfset foo = "some
    > string" />. It's preferred from 6.0 on, just not enforced as there's a lot
    > of
    > legacy code out there.
    >

    Verbunsk Guest

  20. #19

    Default Re: Why does CF use tags?

    LOL. Does anyone know if there is a way to get the forums to label Andy's
    threads so that I can avoid opening them. The sheer mindlessness of them sucks
    me in every time and I can't get any work done.

    Iceborer Guest

  21. #20

    Default Re: Why does CF use tags?

    On 2005-06-23 05:28:07 -0500, "Iceborer" <webforumsuser@macromedia.com> said:
    > LOL. Does anyone know if there is a way to get the forums to label
    > Andy's threads so that I can avoid opening them. The sheer
    > mindlessness of them sucks me in every time and I can't get any work
    > done.
    As a public service we should probably come up with a list of his
    aliases and flag new posts by him as such. The most recent confirmed
    aliases are Verbunsk and Mister, with strong suspicions on a few
    others. It's painfully obvious of course as well--if you see the same
    tired arguments stated in exactly the same way with the same
    misspellings and faulty logic, you know who you're dealing with. ;-)
    --
    Matt Woodward
    [email]mpwoodward@gmail.com[/email]
    Team Macromedia - ColdFusion

    mpwoodward *TMM* Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139