少点错误 2024年07月05日
Libs vs Frameworks, Middle-Level Regularities vs Theories
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

文章探讨了软件工程中的库和框架,以及它们在科学研究中的对应关系。作者指出,库类似于科学研究中的“中间层次规律”,它们简单实用,但需要更多工作来构建更大的整体。而框架则类似于科学研究中的“高级理论”,它们提供了更完整的抽象,但也限制了使用者的自由。作者认为,库更稳定,而框架则更易于被更新或替代。

🤔 **库与中间层次规律:** 库就像一个简单的工具,专注于完成一项特定任务,例如数学计算或字符串操作。它们遵循简单易用的原则,就像科学研究中的“中间层次规律”一样,例如阿基米德的杠杆原理和斯涅尔-笛卡尔折射定律。这些规律简单易懂,经久耐用,为更复杂的研究提供了基础。 库的优点在于其简单性和可组合性,可以轻松地与其他库集成,构建更大的应用程序。然而,库也需要更多的代码量来实现更复杂的功能,需要更多的工作来构建更大的整体。

🏗️ **框架与高级理论:** 框架则是一个完整的解决方案,提供了一种构建应用程序的整体方法,例如React和Angular。它们就像科学研究中的“高级理论”,例如牛顿力学和麦克斯韦电磁理论。这些理论试图解释整个领域,但随着科学的发展,它们可能会被更复杂、更细致的理论所取代。 框架的优点在于其抽象性和可扩展性,可以快速构建应用程序,并提供更强大的功能。然而,框架也限制了开发者的自由,需要遵循框架的规则和规范。框架的维护也更加复杂,需要大量的开发人员来更新和维护,以满足不断变化的需求。

📚 **库和框架的启示:** 文章指出,库和框架的对比,可以启发我们思考科学研究中的“中间层次规律”和“高级理论”之间的关系。我们应该关注“中间层次规律”的稳定性和可靠性,并以此为基础构建更复杂、更全面的“高级理论”。同时,我们也应该认识到,“高级理论”可能会随着时间的推移而被更新或替代,需要不断地进行探索和创新。

💡 **库和框架的启示:** 文章指出,库和框架的对比,可以启发我们思考科学研究中的“中间层次规律”和“高级理论”之间的关系。我们应该关注“中间层次规律”的稳定性和可靠性,并以此为基础构建更复杂、更全面的“高级理论”。同时,我们也应该认识到,“高级理论”可能会随着时间的推移而被更新或替代,需要不断地进行探索和创新。

🚀 **库和框架的启示:** 文章指出,库和框架的对比,可以启发我们思考科学研究中的“中间层次规律”和“高级理论”之间的关系。我们应该关注“中间层次规律”的稳定性和可靠性,并以此为基础构建更复杂、更全面的“高级理论”。同时,我们也应该认识到,“高级理论”可能会随着时间的推移而被更新或替代,需要不断地进行探索和创新。

💡 **库和框架的启示:** 文章指出,库和框架的对比,可以启发我们思考科学研究中的“中间层次规律”和“高级理论”之间的关系。我们应该关注“中间层次规律”的稳定性和可靠性,并以此为基础构建更复杂、更全面的“高级理论”。同时,我们也应该认识到,“高级理论”可能会随着时间的推移而被更新或替代,需要不断地进行探索和创新。

🚀 **库和框架的启示:** 文章指出,库和框架的对比,可以启发我们思考科学研究中的“中间层次规律”和“高级理论”之间的关系。我们应该关注“中间层次规律”的稳定性和可靠性,并以此为基础构建更复杂、更全面的“高级理论”。同时,我们也应该认识到,“高级理论”可能会随着时间的推移而被更新或替代,需要不断地进行探索和创新。

💡 **库和框架的启示:** 文章指出,库和框架的对比,可以启发我们思考科学研究中的“中间层次规律”和“高级理论”之间的关系。我们应该关注“中间层次规律”的稳定性和可靠性,并以此为基础构建更复杂、更全面的“高级理论”。同时,我们也应该认识到,“高级理论”可能会随着时间的推移而被更新或替代,需要不断地进行探索和创新。

🚀 **库和框架的启示:** 文章指出,库和框架的对比,可以启发我们思考科学研究中的“中间层次规律”和“高级理论”之间的关系。我们应该关注“中间层次规律”的稳定性和可靠性,并以此为基础构建更复杂、更全面的“高级理论”。同时,我们也应该认识到,“高级理论”可能会随着时间的推移而被更新或替代,需要不断地进行探索和创新。

Published on July 4, 2024 7:01 PM GMT

Recently, a friend of mine brought out the essential distinction between libraries and frameworks in software engineering.

A library is a small software program that does one thing, does it cleanly, and lets you apply this thing to whatever you want. It lives and dies by the UNIX philosophy and the Keep It Simple Stupid (KISS) principle. At its heart, a library is the digital equivalent of a hammer.

Whereas a framework comes with a whole approach to solving many problems at once, with a common unified and cleaned abstraction. These days the word gets used mostly for web frameworks like React, but it applies whenever the program you use dictates how the full thing must be done (the technical term is inversion of control). So a framework is much more like a massive and complex factory that works amazingly well for a specific type of product, defined in a particular way.

At its core, this dichotomy is between low-level simplicity, which is infinitely composable and easier to use but also requires more repeated work to build larger wholes, and complex abstraction which captures some core patterns and intuitions but forces you to follow its rules and constraints.

This also means that a nice small library can easily live for as long as the programming language it uses exists and is in use, with next to no maintenance, whereas frameworks require armies of developers to update and anticipate the needs of their users, constantly refactoring the architecture and abstraction because any change reverberates everywhere, until users start dropping en masse for the next framework.

What’s unexpected is that this split also captures a core distinction in the practice of science, highlighted by the great Hasok Chang in his masterpiece “Inventing Temperature”: the distinction between middle-level regularities and high-level theories.

Following Herbert Feigl, Chang distinguishes the empirical laws that simply capture and compress some core phenomena (Archimedes’ law of the lever, Snell-Descartes’ law of refraction, the ideal gas law…), which he calls middle-level regularities, from the complex high-level theories that aim to unify and explain all phenomena in a domain (Newtonian Mechanics, Maxwell’s Electromagnetism, Lavoisier’s Chemistry…)

The latter clearly compresses and simplifies much more, giving you an incredible reach on the moment. But Feigl and Chang’s point is that theories tend to get invalidated and replaced by more complex and subtler ones, often built on completely different (incommensurable) abstractions; not so much middle-level regularities, which at worst get clearer bounds on their range of application.

As Chang puts it:

Herbert Feigl emphasized that the stability of empirical science lies in the remarkable degree of robustness possessed by certain middle-level regularities, a robustness that neither sense-data nor high-level theories can claim: ‘‘I think that a relatively stable and approximately accurate basis—in the sense of testing ground—for the theories of the factual sciences is to be located not in individual observations, impressions, sense-data or the like, but rather in the empirical, experimental laws’’ (Feigl 1974, 8). For example, weight measurements using balances rely on Archimedes’s law of the lever, and observations made with basic optical instruments rely on Snell’s law of refraction. These laws, at least in the contexts of the measurements they enable, have not failed and have not been questioned for hundreds of years.

- Hasok Chang, Inventing Temperature, p52

So middle-level regularities act like libraries: always there for you, but never overreaching, leaving you most of the heavy lifting. Whereas theories are frameworks that empower you, but must survive more and more pressure from the experimental data and user needs, until they get at replaced (as emphasized by among others Kuhn and his paradigms).

Maybe one epistemological inspiration we can take from this analogy is to search for the libraries/regularities hidden in our theories, and attempt to carve them out. From these, we might build many theories that will rise and fall, leaving only dust, successors, and a handful of eternal libraries.



Discuss

Fish AI Reader

Fish AI Reader

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

FishAI

FishAI

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

联系邮箱 441953276@qq.com

相关标签

框架 软件工程 科学研究 中间层次规律 高级理论
相关文章