Peter Michaux wrote:
[snip]
So do you limit your syntax to the only the syntax valid in the very
first JavaScript enabled browser?
I have said where I draw the line: I won't test for `typeof' anymore because
that would involve evil[tm] eval() at no advantage -- `typeof' is needed for
feature tests. Consequently, I draw the line at what JavaScript 1.1 and
JScript 1.0 introduce, and what ECMAScript Edition 1 specifies.
We now know that your scripts will have syntax and runtime errors in
at least some known browsers as you assume some syntax and language
and host features (although you may start testing for all host
features). It seems that you are ok with this and presumably judge
your scripts to be of sufficient quality: perhaps even good and/or
professional quality. Perhaps you are satisfied with your decision
because the standards that must be supported to avoid the errors your
scripts will throw are old enough? Or the UAs known to have problems
are unpopular enough? or old enough? You've stated that UA age and
supported features are not necessarily related (you used the word
"coercive" and I don't quite see how that works but that is ok.) Given
you assume old syntax and features and criticised using try-catch as
it is new syntax, I don't know how you discard age from the decision
making process. How do you justify where you've drawn your line? What
makes this location a better place than where others draw their lines?
Do you believe you have made a better decision in some absolute or
objective sense?
I don't understand is how you can criticize someone for drawing a
different line for assumed/tested syntax/features for syntax/features
that have been standardized and widely implemented for many years and
even supported by legacy browsers released almost eight years ago. My
line and your line are both much further in the past than many other
developer's lines. We are all in a grey area but you seem convinced
you have made a superior choice and have justification to criticize
others almost as though they couldn't possibly have any brains at all
or even have considered the problem thoroughly given where they draw
their lines.
I suppose you could just say "I'm comfortable with my line being drawn
there" but that does not give you justification for criticizing others
who draw lines elsewhere. A more concrete foundation for your
criticism to be built upon would give your criticism more weight. As
it stands, your position can only be subjectively judged as better by
supporting some but not all very old, unpopular browsers or even
judged as worse as your resulting code is bigger.