编程与软件工程breck-mckye.com
前端开发为什么如此不稳定?
Why Is Front-End Development So Unstable?
2018 — 2022,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
作者分析了前端开发为何总是动荡不安:框架更迭频繁、工具链复杂、社区充斥自我营销与教条争论。文章从技术、文化和商业多个角度剖析了这种不稳定的根源,并提醒开发者警惕炒作、专注解决自己的实际问题。
为什么经久不衰:它对前端生态' churn '现象的剖析切中要害,多年后重登首页仍引发共鸣,对今天被新框架和工具轰炸的开发者依然是一剂清醒剂。
HN 评论精选
前端不稳定的根源是数据在多层表示间的阻抗失配,导致抽象永远不令人满意
Web 框架之所以频繁更迭,是因为它们是覆盖着棘手'阻抗失配'的严重抽象泄漏。一个典型 Web 应用的数据存在于数据库行、服务端对象、JSON、JS 对象、DOM 标签、像素等六层之中,每次跨层转换都需要'魔法'式的翻译层(ORM、模板引擎等),而这些翻译层既滥用语义又泄漏抽象。高级用户必须懂到能自己造一个的程度,所以一旦被失配坑到,总有人掀桌子自己重写——当然也解决不了根本问题。
meredydd查看英文原文
Web frameworks are churn-y because they are incredibly leaky abstractions covering really awkward impedance mismatches. This means that they are never quite satisfactory - and that just to use one, you need to be capable of building a new one yourself. Think of a typical web app. Your data exists: 1. As rows in a database, accessed via SQL 2. As model objects on the server, accessed via method calls and attributes 3. As JSON, accessed via many HTTP endpoints with a limited set of verbs (GET/PUT/POST/DELETE) 4. As Javascript objects, accessed via (a different set of) method calls and attributes 5. As HTML tags, accessed via the DOM API 6. As pixels, styled by CSS. -- Each time you translate from one layer to the next, there's a nasty impedance mismatch. This, in turn, attracts "magic": ORMs (DB<->Object); Angular Resources (REST<->JS Object); templating engines (JS Object<->DOM); etc. Each of these translation layers shares two characteristics: (A) It is "magic": It abuses the semantics of one layer (eg DB model objects) in an attempt to interface with another (eg SQL). (B) It's a terribly leaky abstraction. This means that (a) every translation layer is prone to unintuitive failures, and (b) every advanced user of it needs to know enough to build one themselves. So when the impedance mismatch bites you on the ass, some fraction of users are going to flip the table, swear they could do better, and write their own. Which, of course, can't solve the underlying mismatch, and therefore won't be satisfactory...and so the cycle continues. Of these nasty transitions, 4/5 are associated with the front end, so the front end gets the rap. (I gave a lightning talk at PyCon two weeks ago, about exactly this - stacking this up against the "Zen of Python" and talking about some of the ways we avoid this in Anvil: https://anvil.works/blog/pycon18-making-the-web-more-pythonic)
JS 社区过度围绕个人品牌和营销,而非技术本身
这篇文章写得很好、思考深入且不流于论战。作者关于'警惕自我推销'的部分尤其引起共鸣:近年来 JS 世界自我营销愈发激进,出现自引、生造专有术语、抢注名字等不诚实手段。社区越来越围绕人和个人品牌而非技术本身,这不健康。
freedomben查看英文原文
This is a really well-written and well-thought out piece. The author touches on a number of points but never gets polemical. This piece resonated with me particularly well: > Be wary of self-promotion > Over the last few years I’ve seen much more aggressive self-marketing in the JavaScript world, possibly due to the rise of paid online training materials and the employment/consulting advantage of being a Github ‘celebrity’. I’ve no problem with people being incentivised for good content, but increasingly I feel I see dishonest tactics: self-citation; invented, proprietary terminology (so searching takes you back to the author’s materials), and name-squatting (e.g. ‘Standard.js’) This is becoming a big problem in JS world, particularly over the last 3 to 4 years. Like the author, I have no problem with people taking credit and being respected, but we as a community are becoming much too centered around people/personality than technology. I've been guilty of this in the past too (love you Pete Hunt ;-) but it's not healthy IMHO.
框架本身精简不等于项目精简,Vue 式的'全家桶'有时更省心
当模块'微'到一定程度,管理和学习它们的成本就超过了自己实现的成本,多数 JS 项目都走在这条线上。React 主打'只做渲染'听起来很精简,但项目仍需要其他所有东西,只能从别处拼凑,反而增加复杂度。而 Vue 只需一个 script 标签就能开发现代响应式 UI,无需构建系统和其他模块——有时这种'全都要'反而更有价值。
_bxg1查看英文原文
At some point, when modules get "micro" enough, the effort of managing them and learning their usage outweighs the effort of implementing the thing yourself. Most JavaScript projects seem to walk that line quite closely. I'm a React developer at work, but I recently gave Vue a try at home. This is one of the things that most stood out to me about it. React makes a selling point out of the fact that it's "just rendering". It doesn't try to do everything for you, it tries to do one thing really well. That sounds great, but it leaves out a factor. Having your primary framework be "simple" and "lean" doesn't translate to your project being simple and lean, because your project still needs all that other stuff. You just now have to get it from somewhere else, which often adds more complexity than it's worth. When I downloaded Vue all I had to do was add a script tag to my HTML document and start writing a modern reactive UI. No other modules or frameworks. No build system. No special JS-targeted languages. Vue does everything you need, and it does it all pretty well, and sometimes that's more valuable.
作者四年后改口:前端已趋稳定,如今的问题是有 VC 资本的厂商在制造'革命'叙事
我是本文作者。我不再认为前端存在人们指责的那种不稳定了。现在有很多厂商(背后有大量 VC 资金)试图围绕自己的产品掀起'革命',但那是另一个问题。
jbreckmckye查看英文原文
I'm the author of this piece. I no longer think front-end suffers the instability people accuse it of. I think there are a lot of _vendors_ trying to usher in a revolution around their particular products - there's a lot of VC funding in JavaScript tooling nowadays - but that's a different problem.
历次讨论
同类还值得读
开源应用架构
The Architecture of Open Source Applications
《开源软件架构》(AOSA)是一本在线免费书,邀请知名开源项目的作者亲自剖析其内部设计,涵盖 SQLAlchemy、LLVM、Audacity、Apache、Bash 等系统。
编程与软件工程上首页 9 次 · 2011–2024aosabook.org编辑精选编程语言简史:简短、不完整且多半错误
A Brief, Incomplete, and Mostly Wrong History of Programming Languages
一篇以戏谑、故意不准确的方式回顾编程语言史的博客文章,用夸张轶事和讽刺定义串起 Lisp、C、C++、Java、JavaScript、PHP 等语言。
编程与软件工程上首页 8 次 · 2009–2021james-iry.blogspot.comSQLite 是如何测试的
How SQLite is tested
SQLite 官方文档页,系统介绍 SQLite 的测试体系:多种测试方法(TCL 测试、模糊测试、回归测试、静态分析等)和海量测试用例,展示了这个小型开源项目如何靠极致测试获得…
编程与软件工程上首页 8 次 · 2009–2025sqlite.org编辑精选高级编程语言(2009)
Advanced programming languages (2009)
Matt Might 的经典文章,按用途推荐“高级编程语言”:如果追求就业就选主流语言,如果追求表达力、学术研究或创业,则推荐 Haskell、OCaml、Scala 等函数式语…
编程与软件工程上首页 8 次 · 2009–2022matt.might.net我的 Forth 与栈机器经历
Yosefk - My history with Forth & stack machines
作者以亲身经历回顾了使用 Forth 语言和栈式机器的历程:既赞叹其简洁优雅、代码量小、可自举的优点,也坦率指出栈操作在实际编程中的痛苦,以及 Forth 社区文化中的问题。
编程与软件工程上首页 8 次 · 2010–2024yosefk.com编辑精选