[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
a thought on mixing Dylan & HTML
> IMO, that's poor style anyway. I could go on at length as to why
> I think this, but I won't.
I agree it's poor style to mix application logic into the display
specification. In fact, I've done my own web server & dynamic page thing in
a 4GL, and my embedded language was stripped down to: foreach, if, and tags
to display formatted values. So all the processing is done by a function
outside the page, which leaves the relevant arrays (or more like database
cursors in this case) set up so that the embedded language can display them.
It's a clean separation, easy to use, and I've gotten good mileage out of
it.
***BUT***
- what can go in the if statement is a very limited subset, basically just
testing boolean or making a straight comparison, because I didn't have the
time to do more, any more complex test has to be added outside the page and
the results made available in a boolean variable or array to be used by the
display logic
- formatting of values for display is similarly emasculated; any formatting
that requires a bit of code in the language must be performed outside the
page and the results stored into a variable or array to be used by the
display logic
- sometimes when experimenting it would be convenient to just lump the app &
display logic together until I figure out how they should really work.
So in my experience this argues for:
- special macros or functions to help with those display-type tasks that
*should* be embedded in the HTML
- full access to the programming language in the HTML, for support of
complex formatting and quick-and-dirty work
- the discipline during implementation to keep app & display logic
separated.
--
Scott Ribe
scott_ribe@killerbytes.com
http://www.killerbytes.com/
(303) 665-7007 voice