2022.06.13 - Some Programming Lessons Learned from 500,000 Lines of Code
Ping Xia
Title: 2022.06.13 – Programming Insights Gleaned from 500,000 Lines of Code
This Week’s Highlights
Programming Insights Gleaned from 500,000 Lines of Code https://mp.weixin.qq.com/s/SMxcxWZt4atct0bUHPMO0g
I’ve been writing code professionally for 14 years, and conservatively I’ve accumulated about 500,000 lines. In the past year I’ve been building Bytebase from scratch and regularly reviewing teammates’ code. With the Dragon Boat Festival in mind, I’ve compiled some lessons focused on the concrete details of coding—mostly “techniques” rather than philosophy, method, or theory. First, a disclaimer: these techniques are meant to help you write more maintainable code, not to make you code faster. Enjoy.
Why Do We Rarely Hear Developers’ Voices in “Developer Productivity” Discussions? https://mp.weixin.qq.com/s/oDmSbtXV4-IN_GLmeVzlpg
Why is it that, when talking about “developer productivity,” we seldom hear from developers themselves? Most self‑styled productivity experts seem more interested in selling products than in giving developers truly effective guidance. This can trap us in a sea of buzzwords, magical metrics, and methodologies without any rigorous, systematic thinking. Also see: Reflecting on Software Development: The Human Factor (Part 1)
Write HTML Right http://lofi.limo/blog/write-html-right
Even with a great text editor, writing HTML can feel like a slog. Nice documents end up as tag swamps with tiny bits of content perched atop hills of tabs. Editing them becomes a patience test, and we dread looking at the once‑beloved source again. It doesn’t have to be this way! There’s a lightweight, relaxed way to write HTML that’s been around since the web’s early days.
Sunsetting Atom https://github.blog/2022-06-08-sunsetting-atom/
The founding team isn’t ready to say they’re rewriting it in Rust https://mp.weixin.qq.com/s/4BQwXwr3iIYBljn8Kb8tqw
We are archiving Atom and all projects under the Atom organization for an official sunset on December 15, 2022.
Kotlin Lead: How We Designed Kotlin Step by Step https://mp.weixin.qq.com/s/qAtg0rTwg1M9Yb-WF4AHlQ
A real programming language is a living thing—it evolves continuously. Like any production code, most of the designers’ time is spent fixing bugs and making small improvements rather than adding radical new features. Kotlin’s uniqueness lies in its use‑case‑ and community‑driven evolution, which began well before the 1.0 stable release in 2016 and even before its public announcement in 2011.
The Collapse of Complex Software https://nolanlawson.com/2022/06/09/the-collapse-of-complex-software/
Ultimately, whether software follows a boom‑and‑bust trajectory or a more sustainable path depends on the economic pressures of the organization producing it. A company that values growth at all costs—like the Romans greedily devouring Gaul—will likely fall into an “add complexity → collapse” cycle. A company with modest goals, a stable customer base, and little change over time (does such a thing exist?) resembles a humble tribe that follows the annual antelope migration and relies on sustainable, proven techniques. (Whether such companies will end up like the hapless Gauls, overrun by Caesar’s legions, is another question.)
Deep Dives
Goodbye, useEffect? David Khourshid’s Reactathon Talk https://www.youtube.com/watch?v=HPoC-k7Rxwo
In this talk, Stately founder David Khourshid argues for using event handlers and state machines to simplify effect handling in React apps, instead of relying on useEffect, which many developers struggle with and which isn’t always the right tool.
From “Micro‑Frontends” to “Micro‑Modules” https://juejin.cn/post/7106791733509226533
Recently I hurriedly open‑sourced a front‑end framework: Elux – a cross‑platform, cross‑framework isomorphic solution based on “micro‑modules” and model‑driven design (https://eluxjs.com/). Today I’d like to share some of the core design ideas behind the framework. These are purely my personal views; please feel free to point out any inaccuracies.
A Brief Look at Mobile Rendering Principles https://mp.weixin.qq.com/s/-ZMCk0_Mc1xKth32GI_mPA
Rendering on a computer or phone is a highly complex process. This article introduces some fundamental rendering concepts, then explains mobile rendering on iOS and Android, and finally dives deep into iOS off‑screen rendering and techniques for optimizing corner radius performance.
First‑Party Cookie Recipes https://web.dev/first-party-cookie-recipes/
Learn how to set first‑party cookies to ensure security, cross‑browser compatibility, and minimize breakage as third‑party cookies are phased out.
The Future of Frontend Build Tools https://www.smashingmagazine.com/2022/06/future-frontend-build-tools/
This article examines tooling for frontend web development. You’ll learn why we need frontend tooling, the stages of its evolution, and the upcoming developments that will shape the next generation of build tools. A general understanding of modern frontend development is assumed.
JavaScript Hydration Is a Workaround, Not a Solution https://thenewstack.io/javascript-hydration-is-a-workaround-not-a-solution/
Hydration adds interactivity to server‑rendered HTML by attaching client‑side event handlers. In this article I argue that hydration is overhead—a hack that consumes memory and slows startup, especially on mobile. Here, “overhead” means work that could be avoided while still achieving the same result.
When WebAssembly Replaces Docker https://thenewstack.io/when-webassembly-replaces-docker/
One of the buzzworthy topics at KubeCon + CloudNativeCon was how WebAssembly (Wasm), by design, can replace Docker in many scenarios. However, focusing solely on this aspect misses the point; the more important discussion is the business use‑cases that WebAssembly can enable, as described below.
Mobile‑First CSS: Is It Time for a Rethink? https://alistapart.com/article/mobile-first-css-is-it-time-for-a-rethink/
Mobile‑first design is great—it centers on what truly matters to users, is well‑practiced, and has been a common pattern for years. So writing your CSS mobile‑first should be great too…right?
Mathematical Notation for JavaScript Developers Explained https://runjs.app/blog/mathematical-notation-for-javascript-developers-explained
Understanding and implementing mathematics in JavaScript is valuable, especially for highly visual and interactive applications. This post explains common mathematical concepts and symbols, provides code examples, and helps you translate those symbols into JavaScript.
SQLite’s Web Renaissance https://changelog.com/posts/sqlite-web-renaissance
Everyone’s favorite tiny embedded DB is having another moment.
Under the Hood: Meta’s Cloud Gaming Infrastructure https://engineering.fb.com/2022/06/09/web/cloud-gaming-infrastructure/
Enabling cloud gaming at Meta required building new hardware and software infrastructure to meet the inherent challenges of cloud gaming. Cloud‑based games need low end‑to‑end latency for smooth gameplay, with high‑quality video and audio streamed with minimal jitter. The infrastructure also needs to be capable…
(content truncated)
Originally written by Ping Xia (平侠) and published in Chinese on Web技术周刊 (Web Tech Weekly). Translated and adapted for DriftSeas with permission.
Sources & References
- [1]https://mp.weixin.qq.com/s/SMxcxWZt4atct0bUHPMO0g
- [2]https://mp.weixin.qq.com/s/oDmSbtXV4-IN_GLmeVzlpg
- [3]Reflecting on Software Development: The Human Factor (Part 1)
- [4]http://lofi.limo/blog/write-html-right
- [5]https://github.blog/2022-06-08-sunsetting-atom/
- [6]https://mp.weixin.qq.com/s/4BQwXwr3iIYBljn8Kb8tqw
- [7]https://mp.weixin.qq.com/s/qAtg0rTwg1M9Yb-WF4AHlQ
- [8]https://nolanlawson.com/2022/06/09/the-collapse-of-complex-software/
- [9]https://www.youtube.com/watch?v=HPoC-k7Rxwo
- [10]https://juejin.cn/post/7106791733509226533
- [11]https://eluxjs.com/
- [12]https://mp.weixin.qq.com/s/-ZMCk0_Mc1xKth32GI_mPA