Both sides previous revision Previous revision Next revision | Previous revision |
coding-music-steve [2024/01/30 18:38] – steve.wang | coding-music-steve [2024/02/20 23:58] (current) – [Evolving Into Different Types] steve.wang |
---|
====== Evolving Into A Proper Library ====== | <html> |
| <h1 class="sectionedit1 page-header pb-3 mb-4 mt-5" id="welcome_歡迎蒞臨">Evolving Into A Proper Library<br>從零碎的程式碼演化成為完整的資料庫<a class="anchorjs-link " href="#welcome_歡迎蒞臨" aria-label="Anchor link for: welcome_歡迎蒞臨" data-anchorjs-icon="" style="font-family: anchorjs-icons; font-style: normal; font-variant: normal; font-weight: normal; line-height: 1; padding-left: 0.375em;"></a></h1> |
| </html> |
| |
By [[steve-wang|Steve Wang]] | By [[steve-wang|Steve Wang]] |
| |
Chatgpt helped with some of the analogy ideas. | Chatgpt helped with some of the analogy ideas. |
| |
{{:library-evolution-human-timeline-evolution.jpg?400|}}{{:library-evolution-gear-timeline-evolution.jpg.jpg?400|}} | |
| |
First image by: https://www.bing.com/images/create/simple-human-history-evolution-timeline-in-10-step/1-65b9a10c142547898481103384808b92?id=4E9rJZ229Ln5ELHnDlgHpw%3d%3d&view=detailv2&idpp=genimg&FORM=GCRIDP&mode=overlay | |
| |
Second image by: https://www.bing.com/images/create/evolution-timeline-from-a-metal-gear-bolt-into-a-b/1-65b9a0a9f0bf4478bfe9aaa7722d9c7f?id=evH9buvnjtinnrh5BkZVqQ%3d%3d&view=detailv2&idpp=genimg&FORM=GCRIDP&mode=overlay | |
| |
| |
===== Evolving Into Different Types ===== | ===== Evolving Into Different Types ===== |
{{:library-evolution-different-types-of-organism.jpg?400|}} | |
| |
By: https://www.bing.com/images/create/one-organism-evolving-into-different-types-of-orga/1-65b9a2118cb5443896e325ae5e15da42?id=%2f6ZKqwSEAWQcMmgLDMLA8g%3d%3d&view=detailv2&idpp=genimg&FORM=GCRIDP&mode=overlay | |
| |
Just like organs and systems differentiating overtime , the different code types was split into different files by functionality. | Just like organs and systems differentiating overtime , the different code types was split into different files by functionality. |
| |
===== Evolving to fit the environment ===== | ===== Evolving to fit the environment ===== |
{{:library-evolution-dogs-in-different-environments.jpg?400|}} | |
| |
By: https://www.bing.com/images/create/four-different-environments-dessert2c-winter2c-moun/1-65b9a3604fbf48aa9df592f32d288927?id=Vj6bJwuKDSfoU2XPO21RTA%3d%3d&view=detailv2&idpp=genimg&FORM=GCRIDP&mode=overlay | 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 [[https://nodejs.org/api/modules.html#modules-commonjs-modules|commonJS module format]] and [[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import|ECMAScript modules standard]]. So, code was adapted to be compatible with those formats. |
| |
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 [[https://nodejs.org/api/modules.html#modules-commonjs-modules|commonJS module format]] and [[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import|ECMAScript modules standard]]. So, code was adapted to be compatible with those formats. | |
| |
===== Recording History ===== | ===== Recording History ===== |
{{:library-evolution-robot-human-writing.jpg?400|}} | |
| |
By: https://www.bing.com/images/create/four-different-environments-dessert2c-winter2c-moun/1-65b9a3604fbf48aa9df592f32d288927?id=Vj6bJwuKDSfoU2XPO21RTA%3d%3d&view=detailv2&idpp=genimg&FORM=GCRIDP&mode=overlay | |
| |
At some point, humans started recording history. The job of recording history of the code writen was given to a software called [[https://git-scm.com/|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. | At some point, humans started recording history. The job of recording history of the code was given to a software called [[https://git-scm.com/|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 ===== | ===== 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 [[https://github.com/renickbell/konduktiva|Github]] and [[https://www.npmjs.com/package/konduktiva|NPM]]. | 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 [[https://github.com/renickbell/konduktiva|Github]] and [[https://www.npmjs.com/package/konduktiva|NPM]] so that it could travel anywhere with an internet. |
| |
===== Passing On Skills to Later Generation ===== | ===== Passing On Skills to Later Generation ===== |
| |
{{:library-evolution-human-horses-boats.jpg?400|}} | |
| |
By: https://www.bing.com/images/create/early-humans-building-boats2c-using-boats2c-training/1-65b9a4520a2849208593dd06d3b130df?id=3bYKcNQKhpy7a6gM2yb4Zg%3d%3d&view=detailv2&idpp=genimg&FORM=GCRIDP&mode=overlay | 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 [[http://konduktiva.org/doku.php?id=start|tutorials]] and [[https://github.com/renickbell/konduktiva/blob/main/konduktiva-documentation.md|documentation]] to help new users learn to use the code. |
| |
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 [[http://konduktiva.org/doku.php?id=start|tutorials]] and [[https://github.com/renickbell/konduktiva/blob/main/konduktiva-documentation.md|documentation]] to help new users learn to use the code. | |
| |
===== Natural Selection ===== | ===== Natural Selection ===== |
{{:library-evolution-robot-filter.jpg?400|}} | |
| |
By: https://www.bing.com/images/create/red-robots-dropping-down-from-top-through-a-filter/1-65b9a78cd9e34fedbd48f7e975a7d8ef?id=5WlHB0nu2p7huHgwrPp57w%3d%3d&view=detailv2&idpp=genimg&FORM=GCRIDP&mode=overlay | |
| |
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. | 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. |
| |
===== Outcome ===== | ===== Outcome ===== |
==== Speed + Features ==== | ==== Speed + Features ==== |
| |
{{ :evolving-library-comparison_of_two_programs.svg |}} | {{ :students:comparison_of_two_programs.svg |}} |
| Evolved library with tons of new features with a similar. |
| ==== Ease Of Use ==== |
| New one takes one line to load all the code. |
| |
| Old one needs to have multiple lines paste |
| |
| <html> |
| <h4>Old</h4> |
| <img src="https://renickbell.net/ed/2024worth/lib/exe/fetch.php?media=evolving-library-only-loading-code-pasting.gif" width="70%" height="auto"> |
| <h4>New </h4> |
| <img src="https://renickbell.net/ed/2024worth/lib/exe/fetch.php?media=evolving-library-only-loading-lib-loading.gif" width="70%" height="auto"> |
| </html> |
| |
==== Ease Of Use ==== | |
{{:steve-old-paste.gif?400|}}{{:steve-new-lib.gif?400|}} | |
| |
Evolved library with tons of new features with a similar (sometimes faster loading speed). | |
| |