Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

git-budget.html 11KB

2 miesięcy temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <!DOCTYPE html>
  2. <html>
  3. <meta charset="utf-8">
  4. <head>
  5. <link rel="stylesheet" href="../../style.css">
  6. </head>
  7. <body>
  8. <script data-goatcounter="https://services.opengamestudio.org:443/count" async src="//services.opengamestudio.org:443/count.js"></script>
  9. <div id="header">
  10. <div class="header2">
  11. <div class="menu">
  12. <a href="../../en/news/index.html">News</a>
  13. <a href="../../en/game/index.html">Games</a>
  14. <a href="../../en/tool/index.html">Tools</a>
  15. <a href="../../en/page/about.html">About</a>
  16. </div>
  17. <div id="lang">
  18. <a href="../../en/news/git-budget.html">EN</a>
  19. <a href="../../ru/news/git-budget.html">RU</a>
  20. </div>
  21. <div class="clear"></div>
  22. </div>
  23. </div>
  24. <h3 class="left_item_title">In the news...</h3>
  25. <center>
  26. <div class="news_item">
  27. <h2 class="news_item_title">
  28. <a href="git-budget.html">Why I keep track of spendings in a personal app made with Git+JS</a>
  29. </h2>
  30. <p class="news_item_date">
  31. 2020-05-03 00:00
  32. </p>
  33. <div class="news_item_contents">
  34. <p><img src="../../images/2020-05-06_гит-бюджет_снимок.png" alt="GitBudget" /></p>
  35. <p>In this article Michael shares his experience of using Git+JS.</p>
  36. <p>Hi, folks, let me share my experience of creating an application to keep track of my spendings. Specifically, let me do it by answering the following questions:</p>
  37. <ol>
  38. <li>Why keep track of spendings in an application?</li>
  39. <li>Why did I create the application as a personal project?</li>
  40. <li>Why does the project use Git+JS?</li>
  41. </ol>
  42. <p><strong>1. Why keep track of spendings in an application?</strong></p>
  43. <p>I, like many people out there, wanted to become rich and <a href="https://youtu.be/7RchntYFtSE">successful</a>. To become rich, one is often advised to run a personal budget, that's what I started to do several years ago. I'd like to point out that running my personal budget hasn't made me rich and successful, and I increased income simply by moving to Moscow.</p>
  44. <p>I think I started to run the budget somewhere around 2012. By that time I already had a professional programmer deformation, which can be described as "made by someone else = bad" formula and is usually manifested by a strong desire to rewrite everything from scratch. However, I had no experience with budgeting back then, so I decided to try a "professional" solution and purchased <a href="https://www.youneedabudget.com">YNAB</a> (You Need A Budget) to use the application on both PC and mobile.</p>
  45. <p>I tried to do my best to set out budget plans and fulfill them in the course of three years. However, somewhere around 2015 the authors released a new application version and <strong>demanded money for the upgrade</strong>, the old version was no longer functioning. I had to choose one of the options:</p>
  46. <ol>
  47. <li>Pay for the upgraded version and use a completely new "shiny" user interface.</li>
  48. <li>Stop their ripoff, keep my money and lose the history of spendings.</li>
  49. </ol>
  50. <p>I concluded that:</p>
  51. <ol>
  52. <li>I already paid for the application;</li>
  53. <li>the old version was suitable for me;</li>
  54. <li>I did not ask for an upgrade;</li>
  55. <li>if I would know I have to pay for each upgrade, I would have never purchased their application in the first place;</li>
  56. <li>I didn't want to sponsor this boorishness;</li>
  57. </ol>
  58. <p>so I stopped the ripoff and <strong>lost my history of spendings</strong>.</p>
  59. <p>This was a very disappointing situation for me, so I stopped tracking my spendings for about a year. However, I was once experiencing a "painful synchronization" (also known as "figuring things out" with a wife). I failed to defend myself against a financial vocal attack like "you're a waster, you always waste money on junk". Then I realized I really need to keep track of my spendings. </p>
  60. <p>This time I decided not to repeat my mistake of giving all my data to someone with the risk of losing it, so I started to track my spendings with simple phone notes. The format was simple and looked like this:</p>
  61. <p><img src="../../images/2020-05-06_гит-бюджет_заметки.png" alt="Notes" /></p>
  62. <p>I used the notes solely on the phone until mid-2018. Then, a new need arose: I wanted to be able to <strong>work on my spendings from a PC</strong> to analyze them. I took the time to see through the solutions that would allow me to work with my spendings on both PC and mobile <strong>free of charge</strong>. A calendar turned out to be such a solution:</p>
  63. <p><img src="../../images/2020-05-06_гит-бюджет_календарь-день.png" alt="Calendar" /></p>
  64. <p><img src="../../images/2020-05-06_гит-бюджет_календарь-запись.png" alt="New record" /></p>
  65. <p>I used a Google account to access <a href="https://developers.google.com/apps-script">Apps Script</a> (a clone of JavaScript) to analyze the spendings. Working with spendings in Apps Script turned out to be quite daunting because calendar records are not designed to host spendings. Data ownership question was still unresolved: my data was still dusting on an unknown server I don't control, and I could only access my data through an API, <strong>which might change in the future by someone else's decision</strong>.</p>
  66. <p>While I was using a calendar, I've had the following ideas frequently visiting me:</p>
  67. <ol>
  68. <li>it would be nice to keep all my data in Git to be able to easily analyze the spendings;</li>
  69. <li>it would be nice to have a convenient user interface without all the noise that prevents me from quickly adding a record.</li>
  70. </ol>
  71. <p>Autumn 2019 I discovered <a href="https://isomorphic-git.org/">Isomorphic-Git</a>, which allows JavaScript to work with Git, quickly verified the ability to work with Git, and realized I found my Holy Grail. Recently I've finished creating the first version of GitBudget application, you can see its functionality here:</p>
  72. <iframe width="720" height="405" src="https://www.youtube.com/embed/ii_cLXAy3S0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
  73. <p>That's how the spendings look like on my phone now:</p>
  74. <p><img src="../../images/2020-05-06_гит-бюджет.png" alt="GitBudget" /></p>
  75. <p>Git data looks like this: <a href="https://gitlab.com/kornerr/git-budget-sample-data/-/blob/me/gb.log">https://gitlab.com/kornerr/git-budget-sample-data/-/blob/me/gb.log</a></p>
  76. <p>Let me highlight a few important issues:</p>
  77. <ul>
  78. <li>Git repository above reflects actions performed in the video above;</li>
  79. <li>I keep my spendings in a private repository, you should do the same;</li>
  80. <li>the application runs completely on the device and has no back-end: GitHub Pages hosting is used;</li>
  81. <li>the application talks to the outside world only during synchronization with Git;</li>
  82. <li>password is kept by a browser, the application only uses it for synchronization with Git;</li>
  83. <li>the application should be loaded over HTTP because the currently used Isomorphic-Git version (0.70.0) makes some requests (metadata) to Git over HTTP, and browsers prohibit HTTP requests from HTTPS nowadays.</li>
  84. </ul>
  85. <p><strong>2. Why did I create the application as a personal project?</strong></p>
  86. <p>I spent 40 hours of my life during the first quarter of 2020, i.e., on average, I worked for about half an hour each day.</p>
  87. <p>Personal projects have the following benefits over those done at work:</p>
  88. <ol>
  89. <li>You can do whatever you want and learn from your mistakes.</li>
  90. <li>Nobody's breathing down your neck and restricting your fantasy.</li>
  91. <li>The above two points keep you calm and give you the strength to perform any stupid activity that might be required at work.</li>
  92. <li>Mistakes you own drastically widen your horizons.</li>
  93. </ol>
  94. <p>Personal projects have drawbacks, too:</p>
  95. <ol>
  96. <li>Nobody in the world cares about your project but you.</li>
  97. <li>Nobody would pay you for your project.</li>
  98. <li>You have to find time to do the project every day.</li>
  99. <li>Your wife won't thank you for the project, even if she would use it herself.</li>
  100. </ol>
  101. <p>It's easy to note that all drawbacks of the personal project are balanced with the benefits of the work project. And all drawbacks of the work project are balanced with the benefits of the personal project. Yin and Yang.</p>
  102. <p><strong>3. Why does the project use Git+JS?</strong></p>
  103. <p>Keeping data in Git instead of an unknown back-end/API has the following benefits:</p>
  104. <ol>
  105. <li>Git is the most widespread solution for decentralized source version control among developers, i.e., almost every developer has experience with Git.</li>
  106. <li>You don't need a new API to work with Git: you just work with files.</li>
  107. <li>There are numerous services offering Git free of charge if you're not too crazy about security and don't want to pay for the service.</li>
  108. <li>Of course, a Git service provider might be <a href="https://github.blog/2018-06-04-github-microsoft/">acquired by a large corporation</a> one day, however, it's easy to move your Git data wherever you want.</li>
  109. <li>For maximum security you can always host your own Git server.</li>
  110. </ol>
  111. <p>Usage of JS with HTML/CSS over Swift/Kotlin/C#/Python has the following benefits:</p>
  112. <ol>
  113. <li>Your application runs everywhere: PC, tablet, mobile phone.</li>
  114. <li>You don't need to pass AppStore reviews to get to every device.</li>
  115. <li>HTML/CSS/JS standards are international, so <a href="https://arstechnica.com/features/2018/09/macos-10-14-mojave-the-ars-technica-review/12/">no single company may stop supporting it</a> or <a href="https://medium.com/@DoorDash/tips-and-tricks-for-migrating-from-swift-2-to-swift-3-c67a8520dbac">change its API</a>; this may result in backward compatibility of <a href="on-the-way-to-durable-applications.html">20 years</a> or more.</li>
  116. <li>Since there's no back-end, all logic resides in JS executed on the client, so you can save the version of the application that best suits you and forget about recurrent updates that <a href="https://hardforum.com/threads/anyway-to-turn-off-the-damn-automatic-driver-updates-in-windows-10.1948410/">usually only hamper usability</a>.</li>
  117. </ol>
  118. <p>GitBudget is the first attempt to see what Git+JS can do. I can only imagine the possibilities lying ahead.</p>
  119. </div>
  120. </div>
  121. <div id="disqus_thread"></div>
  122. <script>
  123. var disqus_config = function () {
  124. this.page.url = "https://opengamestudio.org/en/news/git-budget.html";
  125. this.page.identifier = "git-budget.html";
  126. };
  127. (function() { // DON'T EDIT BELOW THIS LINE
  128. var d = document, s = d.createElement('script');
  129. s.src = 'https://opengamestudio.disqus.com/embed.js';
  130. s.setAttribute('data-timestamp', +new Date());
  131. (d.head || d.body).appendChild(s);
  132. })();
  133. </script>
  134. <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
  135. <div id="footer">
  136. The site has been generated by <a href="http://opengamestudio.org/pskov">PSKOV</a>
  137. from <a href="http://github.com/ogstudio/site-opengamestudio">this source code</a>.
  138. </div>
  139. </center>
  140. </body>
  141. </html>