This is an old revision of the document!
Evolving Into A Proper Library
By Steve Wang Evolving into a proper programming library explained in biological evolution terms.
Chatgpt helped with some of the analogy ideas.
Evolving Into Different Types
Just like organs and systems differentiating overtime , the different code types was split into different files by functionality.
Evolving to fit the environment
Just like living beings, code needs to adapt to be useful in a certain environment. In Javascript, there are main methods in which code can be imported it can be done via commonJS module format and ECMAScript modules standard. So, code was adapted to be compatible with those formats.
Recording History
At some point, humans started recording history. The job of recording history of the code writen was given to a software called Git version control. It could record major changes of the code when prompted to and it could travel back in the timeline to reverse changes to a specific version.
Spread and Diversification Over Different environments and conditions
Early humans started building boats and training horses to be able to travel further than their birth place. Similarly, the code was placed on placed on Github and NPM.
Passing On Skills to Later Generation
Humans made tutorials, wrote books and taught lessons to help the younger generations learn the lessons that took them years to learn. Similarly, we have written tutorials and documentation to help new users learn to use the code.
Natural Selection
In nature, animals who have desireable traits get to pass down these traits via survival and reproduction. In code, the code is tested so that the code which is broekn or not up to spec, get filtered out, rewritten. So that future versions do not need to use the undesirable code.
Outcome
Speed + Features
Ease Of Use
Old

New

Evolved library with tons of new features with a similar (sometimes faster loading speed).