There are a lot of things in the wonderful and wacky world of web programming that are simply wrong, browser specific hacks being the biggest by far. One thing it gets right compared to the majority of the desktop programming world is that setting up a GUI is declarative. Most .NET, Java, and C++ GUI libraries are procedural when it comes to setting up a UI. True, they usually use OOP techniques, but setting up a UI is a long string of statements that say, in effect, "create this widget, with properties X, Y, Z, A, C, and D and put it here". There are some things in place to try and take the pain out, but this is what is happening. For example, if you look at the code that the .NET form editor creates, you find stuff just like this. Don't even get me started on Java's Swing framework. WPF is a move towards a declarative way to do GUIs as is Glade, but these make up a comparably small amount of GUI code in the wild. For the most part, GUIs are still done in a highly procedural way. Programmers who come solely from a Java/C++/C# background (hereafter, referred to as the "Java way") accept this as more or less the way things must be done. This is because the Java way is only pseudo OOP in the first place and the meat of the work is done procedurally. The heavy lifting does not happen, ala Smalltalk, through signals propagating through a web of classes, but through a series of instructions in a method.

However, the functional tradition (which includes languages that are less hard core than Haskell) does not view the world this way. Instead, in functional languages you seek, as much as possible, to be declarative in your code. This brings me to the greatest irony of all: despite having the best facilities to represent user interfaces, functional languages have few libraries for GUI work and are seldom used for this purpose.

HTML has the right idea, and should show the way.