On Tuesday 02 May 2006 23:37, JimD <[EMAIL PROTECTED]> wrote about 'Re: [gentoo-user] Web mail': > Michael Sullivan wrote: > > What other style is there besides procedural? > > A much better way IMO is to separate the presentation from the code like > you can do with ASP.Net with Mono/MS. ASP.Net makes web app development > *event* oriented. You write event handlers to handle certain events > like a page loading or a button being clicked, just as you would do with > a GUI app, and you don't have to have all the markup spewed about in the > code.
The output of ASP.Net is trash. Most notably it doesn't gracefully degrade as the browser loses features, and generates unnecessary round-trips to the server. I agree that event-driven programming generally a better fit for GUIs, however it's not really a good fit for HTTP. I prefer a middle ground that removes the spew of markup (which is bad) but doesn't work against HTTP/HTML. In general, the goal is for php/java/vb/c#/<your language here> to not generate much markup, but to generate the content inside the markup. > With an > event-driven web app, the code would have been separated and it would > have been real easy to make changes to. Code separation is easily done without writing event-driven code. You can define procedure libraries and/or Class (and object) hierarchies that don't deal with markup but use their results in the markup. Code separation is easily broken even in event-driven code -- there's nothing preventing event driven code from outputting or manipulating markup in ugly ways. Writing an event-driven dynamic webpage is a little questionable to begin with since the underlying protocol is request-driven. If your applications are request driven, you'll find they are much easier to debug. Work *with* the tools you are given, not against them. On top of that, you have very little control over the other side of the protocol, most of the time. This is basically a requirement for layer another framework on a protocol and changing how it works. E.g. TCP [stream-oriented with delivery guarantees] over IP [packet-oriented with no delivery guarantees] has fairly specific behavior for both sides of the TCP connection. All this said (and bringing the message full-circle), if your example is indicative of the larger code base: The SquirrelMail source code is trash. -- "If there's one thing we've established over the years, it's that the vast majority of our users don't have the slightest clue what's best for them in terms of package stability." -- Gentoo Developer Ciaran McCreesh
pgpfXLNSWFwTv.pgp
Description: PGP signature

