In response to my post Why runat="server" for ASP.NET?, Talbott Crowell tried of Microsoft National Services tried to comment but got an error from dasBlog. I’ve decided to post his emailed comments here:
I understand your point, but the importance of [runat="server"] is more for consistancy and extensibility. If the developer has to mark some tags some ways (ie an [<asp:] a ignore to ASP.NET tell otherwise difficult be would it tags, the of one with collision name has future agent user some if What engine. by parsed needs what and Response.Write as directly sent is simplifies this Also, confusion. more creates then runat, using cases other in prefix)
To which I replied:
I was suggesting all tags would default to [runat=server], and for those that must not run at server, then the developer would use [runat=client].
To which Talbot replied:
If [runat=client] was required for all client-side tags, the parser would need to parse all tags and strip out the [runat=client] part. Currently, if my guess is correct, the parser simply ignores all text (tags or no tags) unless it is a tag with the [runat=server] attribute or a “<%” prefix or ssi “<!– #include…
Which ends our email conversation that was forced by the error Talbot got when trying to comment on my blog. Bringing it back online I respond with:
What would be the problem with the parser having to parse all tags? Unless I misunderstand, it only parses once after every time the file is changed, and from then on runs the compiled version.
Reasons I really don’t like [runat=server] include it forces markup to be a lot more verbose than it already is requiring lots of left-right scrolling or up-down scrolling, and it trips me up with run-time errors when I forget to include it, as do semi-colons in C#. Why have something required for the normal case? Why can’t the normal case be simplier and the default? BTW, I’d be happy with a directive at the top of the page that sets the default explicitly so that the default would not be hidden in configuration somewhere.
Oh, and as for the “dubious benefit“ statement, that deserves a future full and complete blog essay…
So let the comments continue…(And thanks Talbot for your comments)