I am also a bit late in the process of giving my humble advice on this thread.

Being a C programmer for almost 20 years, I would like to cover my developer's 
hat for a few minutes. I strongly discourage using comments to obtain ... 
"conditional compilation/interpretation".

In many languages, such as C, conditional compilation is achieved via the C 
pre-processor, a sort of pre-compilation step. In interpreted languages, the 
statements are conditionally interpreted via specific directives.

Pre-processing directives, or any derivative, is the proper way to achieve 
"conditional interpretation".

I have taken the decision to step away from this weird possibility of IE ... 
simply because I do not want to be obliged, in a year or two, to change a bulk 
of web sites built on that feature.

... voilĂ  ... this is my humble contribution.

Pat



-----Original Message-----
Hi

This is a bit late, the internet broke for me for the last few days...

On 9/30/05, Thierry Koblentz <[EMAIL PROTECTED]> wrote:
>
> James Ellis wrote:
> > Conditional statements in HTML such as those used by IE/Windows are a
> > slippery slope and they seriously break a central tenet of
> > programming. They are contained with <!-- HTML comments --> and
> > comments in code are not meant to be parsed as code. It's just plain
> > badness.
>
> I don't follow you here. These comments *are meant to be* parsed by
> IE/Win.


Wrong.. comments are not meant to be parsed by an interpreter. Comments are
descriptive rather than interpretive.

Taking one step back here from the browser level here to get closer to the
programming layer would be good. The result of the use of code in comments
is being focused on here rather than how the result was made. In
programming, if we reach a result that appears to work based on poor coding,
we don't have a solution to the problem - we have a workaround based on
exploitable hacks. Mistakes building on mistakes.

Forget that it's IE for a second and look at what is happening in the
programming layer. There is an interpreter that is parsing the code, when it
comes upon a comment section it blithely ignores the fact the programmer has
escaped out of the interpreted part of the script and into the descriptive
part of the script. "Oh, you didn't want me to parse that but I'll do it
anyway -- just to be sure..." where could this end up? I don't know but I
sure don't like the idea of any interpreter parsing comments, with
unexpected results.

I agree with you both that it works in this situation, but it's based on
flawed programming principles and in doing this we've exposed the fact that
the IE interpreter parses what's in the comment, something that's not for
the interpreter to consume. Place something benign in the comment that is
then interpreted as an action to be carried out - bang! the interpreter
falls over or worse. It's a seriously flawed method of developing
applications.

Link : http://en.wikipedia.org/wiki/Comments
Link : http://webdesign.about.com/od/beginningtutorials/a/aa050503a.htm

> What happens if someone adds a comment that happens to be
> > parsed by some piece of software? the software then goes on and does
> > some unexpected things.
>
> Anything inside coments is supposed to be ignored by UAs so if something
> goes wrong it would be because of the browser and not because of what's
> inside these comments.


Haven't you just said above that the special conditional comments are meant
to be parsed by IE/Win? I don't follow.

> Comments, of course, can be machine readable such as those used to
> > provide code documentation or CVS/SVN keywords, but these don't
> > actually run anything or fork the code base.
> >
> > This is a 2005 version of mid 90's browser sniffing - forking the
> > codebase to provide slighlty different content based on the client in
> > use. Better to get the browsers actually rendering things to the
> > published spec (hard, yes, but a better outcome).
>
> IMHO, this is a nice idea, but not very realistic.


Well, if we decide not to push the doors won't open.

James 

******************************************************
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
******************************************************

Reply via email to