By Steve Wang Evolving into a proper programming library explained in biological evolution terms.
Chatgpt helped with some of the analogy ideas.
Just like organs and systems differentiating overtime , the different code types was split into different files by functionality.
Just like living beings, code needs to adapt to be useful in a certain environment. In JavaScript, there are 2 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.
At some point, humans started recording history. The job of recording history of the code 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.
Early humans started building boats and training horses to be able to travel further from their birth place. Similarly, the code was placed on placed on Github and NPM so that it could travel anywhere with an internet.
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.
In nature, animals who have desirable traits get to pass down these traits via survival and reproduction. In coding terms, code is tested so that code which is broken or not up to spec, get filtered out, rewritten. So that future versions do not need to use the undesirable code.
Evolved library with tons of new features with a similar.
New one takes one line to load all the code.
Old one needs to have multiple lines paste