功利主义编程的终结
功利主义编码的定义如下:<i>你所编写的代码应该是*直接*有用的,或者至少能为一个真实的人类服务。</i>这听起来可能有些抽象或模糊,因此举一些例子可能会有所帮助。例如,我不认为<i>框架</i>属于功利主义代码。你所创建的更像是一个画框,真正的画作是由其他人(用户)来完成的。虽然你在这个过程中确实提供了部分帮助,但这充其量是间接的。你在这里是供应链的一部分,而不是团队的一员。
在某个unix服务器上运行的聪明而机智的bash脚本也不是功利主义编码,因为没有人能直接从中受益。
库可以算是某种程度上的功利主义,至少比框架更接近。它们至少提供了一些开箱即用的可重用功能,比如日志记录、扫描条形码、从URL获取数据等。但同样,这也充满了间接性,持续的时间也很短,你在这个过程中学到了什么关于实现和生活的东西呢,我的朋友?
我坚信,我们生活的目的不仅仅是学习技术,还有生活中其他非技术性的事情(比如生活本身)。在过去十年中,许多程序员通过将自己划分为库、框架、规范、包管理器、构建工具等,某种程度上与生活的复杂性和互动脱离了关系。
大约十年前(即2014-15年左右),我认为功利主义编码走到了尽头。直到那时(主要是桌面编程)占主导地位的编程是高度功利的。你曾经为客户开发一个Winforms应用程序,里面有实际的文本框、下拉菜单和按钮,完全根据他们的具体需求和领域知识量身定制,这还有什么比这更功利呢!你不仅获得了技术专长,还获得了领域专长。
随着事物开始转向云计算,最终用户与程序员之间的互动越来越少,功利主义编码也开始衰退。当一群被称为“敏捷专家”、“Scrum大师”、“技术倡导者”、“思想领袖”等的新型专家开始插入到编码者和最终用户之间时,前者的角色开始变得模糊,变成了只处理技术而不涉及其他的“鸵鸟政策”。我们开始失去与领域专长的联系,变得被贴上“Python程序员”、“PHP脚本编写者”、“网页开发者”、“AI开发者”等标签。这就是人们开始不断推出更多框架、库、包、模板、辅助脚本等,而不是关注与利益相关者解决实际问题的原因。
目前情况大致如此,桌面开发和其他形式的功利主义编码仍然在某个小领域保持着,但它们只是一个小众市场。这并不是一个健康的发展,也不是长期可持续的。我强烈感觉到,这个泡沫即将破裂,功利主义编码将会重新回归。即使是云本身也需要变得更加功利,外面有很多不必要的杂乱,可以简化。
你怎么看?欢迎在评论中告诉我。
查看原文
Utilitarian coding is defined as follows: <i>The code you write should be *directly* useful or serve the interest of at least one actual human being.</i> It might appear somewhat abstract or vague, so examples might help. For example, I don't consider <i>frameworks</i> as utilitarian code. What you create are like the "frames" of a picture box, someone else (the user) will take it and draw the actual picture. Though you did help with part of the process, it's indirect at best. You're part of the supply chain here, not part of the team.<p>A clever and witty bash script running on a unix server somewhere is also not utilitarian coding, no human ever directly benefited from it.<p>Libraries can be somewhat utilitarian, at least more than frameworks. At least they provide some reusable functionality to the user out of the box like logging, scanning a barcode, fetching data from a URL, etc. But again, a lot of indirection and little lasting time, what did *you* learn about implementation and life in that process my friend?<p>It's my strong belief that our life's purpose isn't just about learning technology but also other non-technical things in life (such as life itself). By compartmentalizing themselves into libraries, frameworks, specifications, package managers, build and tooling, etc, many coders over the last decade have sort of divorced themselves from the intricacies and interaction with life itself.<p>A decade ago from now (i.e. circa 2014-15) is where I'd say utilitarian coding came to an end. The kind of programming that prevailed until then (mostly desktop programming) was highly utilitarian in nature. You used to develop a Winforms App for the client, with actual textboxes, dropdowns and buttons, tailored to their specific requirements and domain knowledge, what could be more utilitarian than that! You used to gain domain expertise and not just technology expertise.<p>As things started moving to the cloud, the interaction between the end-user and programmer became less and less, that's when utilitarian coding started dying too. As a new breed of specialists called "Agile Experts", "Scrum Masters", "Tech Advocates", "Thought Leaders", etc. started inserting themselves between the coder and end user, the former's role started morphing as the ostrich policy of dealing only with technology and nothing else. We started losing touch with domain expertise, and became branded as "python coder", "PHP scripter", "web developer", "AI developer", etc. That's how folks started churning out more frameworks, libraries, packages, stencils, helper scripts, etc. instead of worrying about actual problem solving with the stakeholders.<p>This is how things stand right now for the most part, desktop development and other forms of utilitarian coding have still maintained their small niche somewhere, but they're just a niche. But it's not a healthy development, nor is it sustainable long term. I strongly feel that this bubble is waiting to burst one day soon, and there will be a reversion towards utilitarian coding again. Even the cloud itself needs to be more utilitarian, a lot of needless clutter out there which can be simplified.<p>What do you think? Let me know in comments.