ContentsImportant RulesWeb Page Designers Should Not Write Programs
Previous: Plan for Decoupled Development | Next: Programmers Should Not Design Web Pages

Web Page Designers Should Not Write Programs

It is entirely possible to use WELD to write entire applications in the TCL language.  Don't do it.  It's nice to know the power is there, and it is entirely reasonable to make prototypes, but the focus of the web page designer is to delegate the business logic to the Java programmers.

With this rule in place, I'm now going to show you what I mean.  This example will give you an idea of the power that is abstracted by WELD.

Please remember that I'm showing you what you should NOT do as a web page designer!

Suppose you want to make a quick table consisting of a spectrum of colors and their red-green-blue HTML specification.  You could certainly do that by hand coding this information in your page, but it's fairly easy to do this task in TCL.  First, here's the code that goes into the WELD file at the place where you want the table to appear:

<table border=3><tr><th width=20%>Color<th width=10%>Red<th width=10%>Green<th width=10%>Blue
[
set range {00 40 80 C0 FF};
set rows {};
foreach red $range {
	foreach green $range {
		foreach blue $range {
			set rgb #$red$green$blue;
			append rows "<tr><td bgcolor=$rgb align=center>";
			append rows [join "$rgb $red $green $blue" "<td align=center>"];
			};
		};
	};
set rows;
]
</table>

Scary, huh?  Don't do it.  If you did, though, this would be the output from the WELD server:

ColorRedGreenBlue
#000000000000
#000040000040
#000080000080
#0000C00000C0
#0000FF0000FF
#004000004000
#004040004040
#004080004080
#0040C00040C0
#0040FF0040FF
#008000008000
#008040008040
#008080008080
#0080C00080C0
#0080FF0080FF
#00C00000C000
#00C04000C040
#00C08000C080
#00C0C000C0C0
#00C0FF00C0FF
#00FF0000FF00
#00FF4000FF40
#00FF8000FF80
#00FFC000FFC0
#00FFFF00FFFF
#400000400000
#400040400040
#400080400080
#4000C04000C0
#4000FF4000FF
#404000404000
#404040404040
#404080404080
#4040C04040C0
#4040FF4040FF
#408000408000
#408040408040
#408080408080
#4080C04080C0
#4080FF4080FF
#40C00040C000
#40C04040C040
#40C08040C080
#40C0C040C0C0
#40C0FF40C0FF
#40FF0040FF00
#40FF4040FF40
#40FF8040FF80
#40FFC040FFC0
#40FFFF40FFFF
#800000800000
#800040800040
#800080800080
#8000C08000C0
#8000FF8000FF
#804000804000
#804040804040
#804080804080
#8040C08040C0
#8040FF8040FF
#808000808000
#808040808040
#808080808080
#8080C08080C0
#8080FF8080FF
#80C00080C000
#80C04080C040
#80C08080C080
#80C0C080C0C0
#80C0FF80C0FF
#80FF0080FF00
#80FF4080FF40
#80FF8080FF80
#80FFC080FFC0
#80FFFF80FFFF
#C00000C00000
#C00040C00040
#C00080C00080
#C000C0C000C0
#C000FFC000FF
#C04000C04000
#C04040C04040
#C04080C04080
#C040C0C040C0
#C040FFC040FF
#C08000C08000
#C08040C08040
#C08080C08080
#C080C0C080C0
#C080FFC080FF
#C0C000C0C000
#C0C040C0C040
#C0C080C0C080
#C0C0C0C0C0C0
#C0C0FFC0C0FF
#C0FF00C0FF00
#C0FF40C0FF40
#C0FF80C0FF80
#C0FFC0C0FFC0
#C0FFFFC0FFFF
#FF0000FF0000
#FF0040FF0040
#FF0080FF0080
#FF00C0FF00C0
#FF00FFFF00FF
#FF4000FF4000
#FF4040FF4040
#FF4080FF4080
#FF40C0FF40C0
#FF40FFFF40FF
#FF8000FF8000
#FF8040FF8040
#FF8080FF8080
#FF80C0FF80C0
#FF80FFFF80FF
#FFC000FFC000
#FFC040FFC040
#FFC080FFC080
#FFC0C0FFC0C0
#FFC0FFFFC0FF
#FFFF00FFFF00
#FFFF40FFFF40
#FFFF80FFFF80
#FFFFC0FFFFC0
#FFFFFFFFFFFF

ContentsImportant RulesWeb Page Designers Should Not Write Programs
Previous: Plan for Decoupled Development | Next: Programmers Should Not Design Web Pages

Modified: Thu Apr 13 11:52:41 EDT 2000