开发者

Are progressive enhancement and graceful degradation same thing, practically speaking?

开发者 https://www.devze.com 2023-01-04 12:02 出处:网络
Are progressive enhancement and gracefu开发者_如何学JAVAl degradation basically the same thing?Not quite.They tackle similar problems, but from different angles.

Are progressive enhancement and gracefu开发者_如何学JAVAl degradation basically the same thing?


Not quite. They tackle similar problems, but from different angles.

"Graceful degradation" implies you have spiffy functionality, and can deal with it being less spiffy (but still need it to work somehow) in browsers that don't support it. "alt" attributes on images, and the <noscript> tag, are examples of this.

"Progressive enhancement" implies you're starting out with just basic content, and want to add spiff for browsers that support it without breaking the site for those that don't. As an example of this, imagine you have a list of links that serves as your nav menu. It works fine, but if you add some javascript it can give you flyout menus, tooltips, and all that.

Basically, progressive enhancement says "start out with good content, and make it better when you can", and graceful degradation says "i assume you can do this cool stuff...but if you can't...well...here's some other crap you can do."

Guess which one's better.


Graceful degradation is one of the advantages or outcomes of progressive enhancement. If you do PE correctly, if any part of the system fails (like Javascript), the page will still work correctly (if not beautifully).

You might also hear "separation of concerns", which is a discipline that is part of the above. Eg, no CSS in your HTML, no HTML in your business logic. Each part can be maintained independently, and the failure of one part won't cause the failure of other parts.

0

精彩评论

暂无评论...
验证码 换一张
取 消