权衡分析_一系列权衡

权衡分析

Jeremy Keith recently wrote a post about some of the false dichotomies in web development. When faced with two options, we are often presented with a solution that paints one option black and one white as if there was no middle ground. I’ve attempted to write a post along a similar lines many times, though to be perfectly honest, none of my drafts painted the scene quite as well as Jeremy did:

杰里米·基思(Jeremy Keith)最近写了一篇有关Web开发中错误二分法的文章 。 当面对两个选项时,我们经常会遇到一种解决方案,该解决方案将一个选项涂成黑色,将一个选项涂成白色,好像没有中间立场。 我已经尝试过多次写类似的文章,尽管老实说,我的草稿没有一个像杰里米那样画得很好:

In the world of web development, there are many choices that are commonly presented as true or false, black and white, Boolean, binary values, when in fact they exist in a grey goo of quantum uncertainty.

在Web开发的世界中,有许多选择通常表示为真或假,黑白,布尔值,二进制值,而实际上它们存在于量子不确定性的灰色状态。

What prompted my thoughts on the subject (at least recently) was a post on Simply Accessible entitled Speed vs. Accessibility. In the post, Derek Featherstone tells a story of someone who went so far as to change their markup, in a manner that made it significantly less semantic, in order to save a few bytes in file size and therefore improve performance. The result? They saved about 50 bytes, but lost contextual meaning and reduced accessibility. This lead Derek to ask if it had to be speed or accessibility (by the way, the answer is no—they can coexist).

至少在最近,促使我对此问题进行思考的是有关“简单访问”的文章,标题为“ 速度与可访问性” 。 在帖子中,德里克·费瑟斯通(Derek Featherstone)讲述了一个人的故事,该人甚至改变了标记,从而大大减少了语义,从而节省了文件大小,从而提高了性能。 结果? 他们节省了大约50个字节,但是失去了上下文的含义并降低了可访问性。 这导致Derek询问是否必须是速度可访问性(顺便说一句,答案是否定的-它们可以共存)。

The truth of the matter is, web development is a series of trade-offs. Sure, some best practices overlap between say, performance and accessibility. Many, however, do not. To make an educated decision requires a healthy level of knowledge both of the project being worked on, and of these concerns (semanticity, accessibility, performance, etc.) and their implications. Knowing what is most important to a project will give you a roadmap to follow when you inevitably have to decide which trade-offs to make.

事实是,Web开发是一系列的权衡。 当然,性能和可访问性之间存在一些最佳实践的重叠。 但是,许多人却没有。 要做出有根据的决策,需要对正在研究的项目以及这些关注点(语义,可访问性,性能等)及其含义有充分的了解。 知道什么对项目最重要将为您提供路线图,以便您不可避免地要决定要进行哪些权衡。

It’s for this reason that I give little credence to the many one-sided argumentative posts you will see online. The goal should always be to be as semantic as possible, but you should also strive to be as performant, as accessibile and as well designed as possible. For example, anyone who reads my blog knows how seriously I take performance. In my opinion however, I would never be willing to adjust my markup as the person in Derek’s story did in order to shave a few bytes of my HTML. I may be a performance zealot, but to me, having a well structured page is the base from which I prefer to build off of. I believe a well marked up document provides the ideal starting point for optimal semantics, accessibility, performance and maintainability. This means that my sites will never be quite as peformant as they could be and I’m ok with that. I’ll do my best to optimize my site in ways that I think maximize my gains and have a minimal negative impact on my markup. There are many far more effective ways to optimize my site without having to pay such a steep price.

出于这个原因,我不太相信您会在网上看到的许多单方面辩论性文章。 目标应该始终是尽可能地具有语义,但是您也应该努力做到性能高,可访问性强并且设计得尽可能好。 例如,任何阅读我的博客的人都知道我对性能的重视程度。 但是,我认为,我永远不会愿意像Derek故事中的那个人那样调整标记,以剃除HTML的一些字节。 我可能是一个狂热的狂热者,但对我而言,拥有一个结构良好的页面是我更希望以此为基础的基础。 我认为标记正确的文档为最佳语义,可访问性,性能和可维护性提供了理想的起点。 这意味着我的网站将永远不会像现在那么完美,我对此表示满意。 我会尽我所能来优化我的网站,以使我获得最大的收益,并对加价产生最小的负面影响。 有许多更有效的方法可以优化我的网站,而无需付出如此高昂的代价。

So by all means, find something you feel strongly about—learn about it, share your knowledge with others, become a strong advocate for it, but always remember that web development requires a balance. Find a solid base to build from, determine the considerations most important to the project and always keep those in mind as you make your decisions about what trade-offs to make.

因此,无论如何,要找到您强烈感兴趣的东西-学习它,与他人分享您的知识,成为它的坚决拥护者,但请始终记住,Web开发需要平衡。 找到扎实的基础,确定对项目最重要的考虑因素,并在做出权衡决定时始终牢记这些考虑因素。

翻译自: https://timkadlec.com/2010/12/a-series-of-trade-offs/

权衡分析

相关文章:

  • 2021-12-23
  • 2022-01-20
  • 2022-03-03
  • 2021-06-19
  • 2022-12-23
  • 2021-12-19
  • 2021-08-22
猜你喜欢
  • 2022-01-09
  • 2021-11-12
  • 2021-09-28
  • 2021-09-05
相关资源
相似解决方案