Re: @import -- allow at any place in stylesheet.

2012/1/17 Sylvain Galineau <sylvaing@microsoft.com>:
> In terms of feature design, it is compatible with the import feature of many languages
> that require imports to be first (Java comes to mind). It thus at least aligns with the
> mental model and habits of many developers. Honoring the principle of least surprise is
> often helpful. As such Ambrose's point about this restriction making the language more
> complicated should maybe be qualified with: for whom? And even if lifting the restriction
> made the language harder, it's also possible it will result in apps that are much harder
> to understand and work with.

Quick comment:

Regarding the “for whom” question, that would be for people coming
from a different background than Java: For myself, that would be Perl,
PHP, C, and maybe other things (I was never good at Java). The
principle of least surprise goes both ways: For some people the
current behaviour has the least surprise; for me (and apparently
others) this is a Really Big Surprise.

But at the core I don’t think “at the top” or “anywhere” is the real
problem here. The problem (for people writing style sheets, not for
implementors) is that if your @import is not at the top, it is
SILENTLY ignored, and the important thing is the “silently”. I would
not have spent hours debugging my style sheet if the browser loudly
complained that an @import has been ignored because it’s not at the
top.

-- 
cheers,
-ambrose

Received on Wednesday, 18 January 2012 01:57:28 UTC