Derek Sivers blog 09月29日 12:01
手写代码胜过自动生成
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

作者认为自动生成的网站、应用和文件会产生大量不必要的代码,导致加载缓慢。相比之下,手写代码更加简洁高效,例如用SVG手动创建矢量logo只需几行代码,文件大小减少95%。作者还手动编写EPUB文件,文件大小减少90%,认为这就像清理社区环境一样令人愉悦。

🌍 手动编写代码可以显著减少不必要的代码量,提高加载速度和效率。自动生成的代码往往包含大量冗余,导致文件庞大,影响性能。

✍️ 作者通过手动创建SVG logo和EPUB文件,分别将文件大小减少了95%和90%,证明了手动编写的简洁性和高效性。

🧹 手动编写代码就像清理社区环境一样,能够消除数字污染,让一切变得更快速、更简单、更干净,提升用户体验。

You couldn’t just roll down the street leaving huge piles of garbage everywhere you go, making life slower for everyone as they climb over your mountains of junk, just to get on with their life.You’d feel bad about it, right?

That’s how I feel about the digital things we put out into the world: websites, apps, and files.

I prefer coding everything by hand, because I don’t like the huge piles of garbage that the automated generators create.These programs that generate a website, app, or file for you spit out thousands of lines of unnecessary junk when really only 10 lines are needed.Then people wonder why their site is so slow, and they think it’s their phone or connection’s fault.

Yesterday I needed to make a little vector logo.Two lines and two triangles.I tried to use a couple different vector drawing programs but they saved it as hundreds of lines.I knew it could be simpler, so I read up on SVG and made exactly what I wanted:

<svg height="54" width="54"><defs><style type="text/css"><![CDATA[line,polygon{stroke:black;stroke-width:4} polygon{fill:black}]]></style></defs><line x1="2" y1="2" x2="2" y2="52" /><line x1="52" y1="2" x2="52" y2="52" /><polygon points="2,2 27,27 2,27" /><polygon points="52,2 27,27 52,27" /></svg> 

Much better!95% smaller file size, and the joy of making something by hand instead of having it done for me.But I think my biggest joy is eliminating the digital pollution that the auto-generated one created.It makes everything faster, easier, and cleaner for anyone involved.95% less junk over the wires.

Same thing with the EPUB file for my new book.Today I spent the day creating the EPUB’s XML and XHTML by hand, instead of using a generator.I love the manual control and again - 90% smaller file size.

This makes me unreasonably happy.It feels like cleaning up the neighborhood.Or at least my yard.

(And I love it when people notice how fast my site loads.)

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

手写代码 自动生成 性能优化 数字污染 SVG EPUB
相关文章