2010년 5월 25일 Cascading Style Sheets and Declarative Languages
The most bright choice made by creators of CSS is, that it is declarative. Well, it turns out to have some other problems as well but it’s a lot easier and saner than XSL. That’s because it is not a full-fledged language: you don’t know how the page is rendered1 in the core of web browsers, but still you can make a reasonable design in CSS!
Declarative languages like CSS and SQL are very useful if imperative approach is cumbersome and intractable. The downside of declarative approach is, of course, that you cannot guarantee the exact behavior in general, and that you normally have to rely on the particular implementation (like web browsers and RDBMS engines). SQL does have this problem — sometimes you need to “tune” SQLs to meet the performance criteria, and end up with (often proprietary) hints for the particular engine. But CSS is much simpler than SQL and mostly free of such problems, so it is a wise choice for CSS to remain declarative. That’s why I was sharply critical of CSS transitions and animations: first of all, do you really want to code an animation in CSS?!
