My onTap applications lately turn out fairly interesting in terms of
white space and code formatting. The framework includes a
cfsavecontent tag in the application.cfm but discludes the portion at
the bottom of the template where custom application stage code is
included, allowing developers to make their own decisions about how to
handle white-space before the opening <html> tag.

In my own apps I haven't bothered to cfsilent the application stage
code either, so my pages do have a trail of whitespace at the top (I
don't know how the whitespace compares to the other frameworks),
immediately followed by a large block of tightly and impecably
formatted/indented code, because the html library handles the
outputting of modular display elements ((x)html) with a single
function call which loops over the structures and arrays and outputs
them one tag per line.

It definately looks machine-crafted and takes some getting used to
looking at it, but uniformity (and line breaks and indents) help a lot
when I'm debugging. I originally had the function just output
everything without any tabs or line breaks before I realized how
insane it was to diagnose anything that way. :)

s. isaac dealey     954.927.5117

new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework
http://www.sys-con.com/story/?storyid=44477&DE=1

> I generally like to make the html that is output as neat
> and tidy as
> possible... I guess its mainly a perfectionist thing but
> all that whitespace
> on a busy site does tend to add up to lots of Mb over a
> period of time and
> it can mean the difference between being under and over
> your bandwidth limit
> when its measured on a monthly basis...

> With that in mind, I remove as much whitespace as I
> possibly can, and as a
> starting point, I use the code below as my generic page
> template...

> <cfcontent reset="yes" type="text/html;
> charset=utf-8"><cfprocessingdirective pageencoding="utf-8"
> suppresswhitespace="Yes">
> <cftry><cfsilent>
>     <!--- form handlers / page setup code --->
>     <!--- if I generate HTML here I use <cfsavecontent>
>     --->
>   </cfsilent>
>   <cfinclude template="header.cfm">
>    <!-- Main content block -->
>    <div id="">

>    </div>
>   <cfinclude template="footer.cfm">
>  <cfcatch>
>   <!--- Error handler for the page --->
>   <cfinclude template="errorhandler.cfm">
>  </cfcatch>
> </cftry>
> </cfprocessingdirective>

> Paul

>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to