Lea Verou
W3C CSS工作组特邀专家,设计CSS语言的委员之一,此前曾在W3C担任开发者代言人。目前,她在麻省理工学院从事人机交互领域的研究。她还是一位博客作家,并经常在国际性的技术会议上担任讲师;她创建的多个开源项目广受开发者欢迎。

-图说-
来自CSS一姐的个人网站(http://lea.verou.me),也多用于各种公众场合,例如本书的作者介绍部分。

-图说-
Lea的运动照,爱游泳。

-图说-
Lea自己设计的图标,常见各种公众场合,包括本书的封面。

访谈内容:

中文版

It's our great honor to have this interview with Lea Verou, author of the popular book—CSS Secrets. What has inspired you to write such a book? And what are the most important things you want readers to learn from the book?

There were many CSS books about introducing the reader to either CSS in general or to an aspect of CSS, but nothing that taught you how to think creatively about solving problems with CSS, nothing about getting past that initial introduction. This seems to be a pervasive problem in learning in general, about any topic: most books provide canned solutions but refrain from trying to teach the reader how to think about creating their own solutions. Especially when it comes to CSS books, the reader is usually assumed to have very little technical knowledge and the content is structured accordingly. CSS Secrets is a book that respects the language and the reader and does not dumb it down. The readers who will gain the most from this book are the most advanced CSS developers, those who really understand how CSS works and want to take their knowledge one step further.

On the book cover, a logo similar to pirates' element appears at the bottom right. Interestingly, it also shows on your website. May i know the implication behind? (It seems to me you really appreciate something of pirates, and you have kind of critical thinking model to discover beauty from "evil".)

This is my personal logo, which I've had for several years. It's not meant to be taken very seriously, it's a bit tongue-in-cheek :) The braces ({}) stand for "code" (as they are a syntax element that is very common in both CSS and JS) and the swords for "pirate", i.e. "code pirate". In Western culture "pirate" doesn't only have negative connotations, it can also mean "badass" in certain contexts, which was what I jokingly tried to convey.

As a female (underprivileged to males) from Greece (far away from places of progressive web technology), what makes you become a recognized developer worldwide? Do things one was born with determine where she/he can reach?

Thankfully, due to the wide reach of the Web, where one is born with has little to do with what they can achieve these days. I have seen people get locked in to their own little corner of the Web, interacting and working only with people from their own country, but that is their choice. As long as someone speaks English well, there is no limit to what they can do and to where they can be known. I would urge anyone who dreams of doing anything on the international stage to focus a lot on their English, not just their HTML, CSS and JS. No matter how good your technical knowledge is, if you cannot communicate your ideas well, nobody will know.

Fun fact: Before I started my successful blog lea.verou.me, I had tried to start a Greek one. It was a complete and utter failure. Very few were interested in cutting edge CSS tricks in Greece, which makes sense given how underpaid web developers are there and how bullied they are by their clients. I'm glad I didn't give up and started an international blog instead, otherwise my life would have been very different today.

As for being female, there might still be some sexism in Greece, but it's not so overt that it would actually hold me back. Actually, in some ways, Greece is even more progressive than other Western countries when it comes to gender equality. As I've recently written in a blog post about this 1, I personally haven't really experienced much sexism at any point in my career. I love being in this industry :)

Apart from writing, you've created several open-source projects for other developers to use. But, as far as i know, some refuses to show out their coding examples. They believe that it's natural to display a well-built building or bridge, but not its blueprint. How do you think of that?

Sharing code is a way to give back to the community, since we all use multiple open source projects in anything we do. Imagine if everyone had the same logic you describe, how different our profession would be. It's a little selfish to use others' open source work but refuse to publish any of your own code. Yes, other industries don't have a similar culture, that's why they are less awesome to work in. I love the openness of our industry and how developers love sharing their knowledge and helping each other, whether that is by publishing their code, or by answering stack overflow questions. It seemed only natural that I would do the same once I was able to. Besides, I love knowing that my work is used and has helped other people, it's why I'm in this field. Also, releasing code as open source means that other people can contribute, so it ends up being much higher quality. For example, when I released Bliss it had no tests, now it has a full testsuite which helped fix quite a lot of bugs. Also, many of my projects such as PrismJS are maintained by the community at this point. I simply don't have the time to maintain them myself, so if they were not open source, they would just rot.

Live coding demonstration should be regarded as a higher form of open source projects. But haven't you thought of delays or even bugs affecting your flow during speeches? How do you make preparation for conference speeches?

I rehearse the live coding demos multiple times, this is very important. I also try to keep them as short as possible, both to minimize the room for mistakes, and because the typical audience member cannot digest more than a few lines of code per slide. I've seen live coding demos where people fire up an IDE with 100 lines of code already there, these people have already lost the audience before even starting.

However, despite every measure you take against it, if you do a lot of live coding, you will always make a few mistakes. I try to debug on the fly, but unless that immediately fixes it I just make a joke and move on. No-one wants to see a long struggle on stage. In my experience audiences are very understanding, provided you recover quickly.

The following questions are concerned with your love——CSS. JavaScript moves too fast, compared with CSS. It usually takes several years for new CSS features to be used widely. So, someone suggests writing more CSS polyfills. How do you think of that?

That would certainly help speed up adoption of new features. PostCSS with CSSNext has helped a lot in that direction, but not all new features can be preprocessed. For more dynamic features like new units of custom properties, polyfilling is currently significantly harder than for most new JS APIs. The Houdini APIs will solve this problem for good and will enable us to write CSS polyfills as easily as we can write JS polyfills.

Houdiniis a new W3C task force whose ultimate goal is to make browser support problem of CSS features go away forever. If that does come true, it may be the most exciting development in CSS. Do you think Houdini's plan will be accessible?

Houdini will certainly make it possible to write CSS polyfills, which is indeed an exciting development and I'm looking forward to it. What worries me is that I've seen Houdini used as a crutch by browsers when they don't want to implement something. They just refuse to discuss it altogether, with the excuse that developers can always write a library for it using the Houdini APIs. I would hate to see CSS stop evolving because of Houdini, and I would hate to see CSS becoming a dependency hell where you need to include a ton of libraries to do basic things.

As using HTML in JS has cleaned a lot of things up, some developers attempt to do the same thing with CSS. In order to solve problems with CSS at scale, React.js developers want a combined language of CSS and JS. For instance, they've developed CSS Modules and used it widely. What do you think of "CSS in JS"?

I think that it's a technique mainly invented and used by JS developers who don't really understand CSS and just want to write JS code for everything. "If all you have is a hammer, everything looks like a nail". While doing that, they are excluding a large portion of potential collaborators: 1 in 2 HTML & CSS authors is not very comfortable with JS.

enter image description here

However, in the CSS WG we do recognize the pains involved in CSS scoping and encapsulation and we are actively discussing the issue.

Nowadays, CSS has stretched itself beyond Web field into publishing domain. O'Reilly has even already attempted to use CSS in publishing. Could CSS work as people expected in publishing domain? Will W3C work on CSS standards for publishing domain in later years?

CSS was designed as a document styling language from the start, so using it in publishing was an obvious step. In fact, the first book to be published with CSS was "Cascading Style Sheets: Designing for the Web, 3rd edition" by the creators of CSS, Bert Bos and Hakon Wium Lie, in 2005, 11 years ago! http://alistapart.com/article/boom

Of course, there is a lot of work that still needs to be done to make CSS as flexible as existing tools like InDesign. There has been a lot of progress on this in the last few years, and more to come. Unfortunately, browsers have a lot more resources than publishing houses, so their voice is heard more in the CSS WG. But printing is a serious concern, and we do consider it for every new feature we add.


更多精彩,加入图灵访谈微信!