编程与软件工程lea.verou.me
外行人眼中的今日 JavaScript
Today’s JavaScript, from an outsider’s perspective (2020)
2020 — 2022,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
Lea Verou 从旁观者视角记录了 2020 年前后 JavaScript 生态的入门体验:模块系统混乱、TypeScript 文件用 .js 扩展名、Node/NPM 工具链对新手极不友好。文章时隔两年再次登上 HN,引发关于前端工具链复杂度的长期讨论。
为什么经久不衰:它精准捕捉了 JS 生态“局外人视角”的痛点,而工具链易用性问题至今仍未彻底解决,对任何想进入前端或评估 JS 生态的人仍有参考价值。
HN 评论精选
前端工具链过度复杂,连资深开发者都无法手动配置
我也有同样经历。作为后端工程师尝试写前端应用,JS、打包器、压缩工具、TypeScript、React 这一整套工具链,基本只有靠某个神奇的初始化脚本才能跑起来,而且远超实际所需。如果只想做最简单的事,比如在浏览器里跑一个 TypeScript 应用,祝你好运——网上几百篇教程没一篇能用。前端开发已经坏掉了。有趣的是,我问过几个资深前端如何手动配置 React、webpack 和 TS,没有一个人能做到。
hudo查看英文原文
My experience also. As a backend engineer trying to create a front end app, the whole toolchain of JS, bundlers, minifiers, Typescript, React... is basically; works if you have one magical init script that wires up everything, and much more than you really need since its tailored for more complex apps, but if you need just simplest thing, like run Typescript app in browser, well, good luck with that! Hundreds of tutorials (unofficial blog posts) on internents, none of them work. Front end dev work is broken. Also, funny experience: asked few senior FE devs how to configure React, webpack and TS manually, absolutely nobody could do it.
工具链入门痛苦是所有语言的通病,并非 JS 独有
这听起来和我使用任何不熟悉的语言时的体验一样。想试试 C++:下载解压,Windows 上要 .project 文件,Visual Studio 提示要升级,然后报链接错误;换 Xcode 再来一遍。试 Ruby:旧版本装新 gem 失败,还得执行一堆“魔法咒语”做全局配置,然后又是新错误。我很同情作者,这确实糟心,但这不是 JS 独有的问题。
gernb查看英文原文
sounds like the same experience I have with pretty much every language I'm not used to. I just want to try this C++, download, unzip, oh it's windows so .project file. Fine, redo on windows , oh it's 3 versions of vstuido old and says it wants to upgrade , okay. Hmm errors. Try to fix. Now it's getting linking error. repeat the same with xcode and any project in c, c++, objc, swift okay how about ruby? oh I have old ruby , hmmm , try to install new ruby, seems to run, but it can't find certain gems or something. oh and this other ruby thing I was using is now broken ? why do I have to install this stuff globally? You don't but there are several magic spells you must execute and runes you must set in the rigtt places. Oh ... I think I got that setup but it getting this new error. .... I'm sypathetic it sucks but it's not unique to js
工具链在进步但对外来者仍不友好,割裂了前后端开发者
这几年 JS 工具进步巨大,Vite 比之前的一切都好,Esbuild 不可思议且显然是未来。问题是对刚接触 JS 生态的人来说门槛依然很高。PHP/Python/Ruby 开发者想在 Django、Laravel、Rails 中结合现代 JS,往往得并行装一整套 Node/NPM 工具链,这也是前后端割裂、许多“全栈”开发者退回后端的原因。我在做 Tetra 框架来解决这个问题。绝大多数开发者不想操心工具,只想快速把东西做出来。
samwillis查看英文原文
JS tooling has come a long way in the last couple of years, Vite for example is so much better than everything that came before. Esbuild is incredible and clearly the future of all JS build tools. The trouble is that to people who are only just outside JS ecosystem it’s not very accessible. If you are a PHP, Python or Ruby developer who cut your teeth in the era of jQuery or earlier (prototype.js & script.aculo.us!) it can be quite difficult to make the transition. Combining the modern JS environments with platforms like Django, Laravel or Rails often means having to install and setup from scratch a full Node/NPM toolchain in parallel with your backend toolchain. I believe this is some of the reason for such a disconnect between the the “backend” and “frontend” unless you go 100% JS. I think it's pushed a lot of devs who used to think of themselves as "full stack" towards the backend. I’m trying to fix this with Tetra (https://www.tetraframework.com) for the Django ecosystem, the plan is to eventually bundle a esbuild/postcss/sass/less toolchain along with built in tools for installing JS dependancies so you can completely live within the Python/Django environment. It will manage all the complexities of JS tooling for you. The vast majority of developers don't want to think about tooling, they just want to build something quickly and get it out there.
问题在于学习路径缺失,新手不该同时学六样东西
我第一次配置 Python + Django 时也有同样挫败的经历。但作者的问题在于让新手同时学习太多东西:Node 环境、浏览器环境、JS 语法、本地服务器、模块系统、NPM 包管理——这些应该一个一个来,同时学当然会很惨。这篇文章与其说反映了 JS 生态的现状,不如说暴露了缺乏标准化学习路径的问题。
esperent查看英文原文
I had a similarly frustrating experience when I first set up Python to use Django. The complete mess that is the Python 2/3 split (thankfully somewhat better now after many years), trying to figure out what the hell pip and pipenv were (this was before I was familiar with package management). However, I initially learned some Python in university and I liked it then. We just installed Idle and ran some simple scripts, and everything worked. That's the right way to learn a language. If you dive straight into JS package management, you are attempting to learn multiple things at the same time: * Node.js environment * Browser environment * JavaScript syntax * 'running a localhost' * JavaScript modules * NPM package management You need to tackle these one by one. If you do them all at once, even with prior experience in other languages, of course you're gonna have a bad time. Really what I take away from this post is that the author is a bad teacher, although the experience of her student is probably similar to what many people experience when trying to learn by themselves. There are many improvements that could be made to the JS ecosystem, but this post does not do the current state justice. What it highlights, if anything, is a problem with the available of a standardized learning path. But I'm not sure what the solution to that would be.
历次讨论
同类还值得读
开源应用架构
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编辑精选