Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <!DOCTYPE html>
  2. <html>
  3. <meta charset="utf-8">
  4. <head>
  5. <style>
  6. #header
  7. {
  8. background: #2BA6E3;
  9. padding: 0.7em;
  10. text-align: left;
  11. }
  12. #header a
  13. {
  14. color: white;
  15. text-decoration: none;
  16. padding: 0.5em 1em 0.5em 1em;
  17. }
  18. #lang
  19. {
  20. float: right;
  21. }
  22. .news_item
  23. {
  24. background: #FFFFFF;
  25. width: 720px;
  26. padding: 1em;
  27. margin-top: 2em;
  28. margin-bottom: 2em;
  29. border: 1px solid #E0E0E0;
  30. text-align: left;
  31. }
  32. .news_item_contents
  33. {
  34. color: #444;
  35. line-height: 1.5em;
  36. }
  37. .news_item_date
  38. {
  39. margin-bottom: 2em;
  40. color: #aaa;
  41. }
  42. html
  43. {
  44. font-family: sans-serif;
  45. }
  46. body
  47. {
  48. background: #FAFAFA;
  49. }
  50. code, pre
  51. {
  52. font-family: monospace, serif;
  53. font-size: 1em;
  54. color: #7f0a0c;
  55. }
  56. img
  57. {
  58. width: 720px;
  59. }
  60. a
  61. {
  62. color: #3A91CB;
  63. }
  64. table
  65. {
  66. border-collapse: collapse;
  67. }
  68. table, th, td
  69. {
  70. border: 1px solid #aaa;
  71. padding: 0.5em;
  72. margin-top: 0.5em;
  73. margin-bottom: 0.5em;
  74. }
  75. </style>
  76. </head>
  77. <body>
  78. <div id="header">
  79. <strong id="title">Open Game Studio</strong>
  80. <a href="../../en/news/index.html">News</a>
  81. <a href="../../en/game/index.html">Games</a>
  82. <a href="../../en/tool/index.html">Tools</a>
  83. <a href="../../en/page/about.html">About</a>
  84. <div id="lang">
  85. <a href="../../en/news/git-budget.html">EN</a>
  86. <a href="../../ru/news/git-budget.html">RU</a>
  87. </div>
  88. </div>
  89. <center>
  90. <h1>In the news...</h1>
  91. <div class="news_item">
  92. <h2 class="news_item_title">
  93. <a href="git-budget.html">Why I keep track of spendings in a personal app made with Git+JS</a>
  94. </h2>
  95. <p class="news_item_date">
  96. 2020-05-03 00:00
  97. </p>
  98. <div class="news_item_contents">
  99. <p><img src="../../images/2020-05-06_гит-бюджет_снимок.png" alt="GitBudget" /></p>
  100. <p>In this article Michael shares his experience of using Git+JS.</p>
  101. <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>
  102. <ol>
  103. <li>Why keep track of spendings in an application?</li>
  104. <li>Why did I create the application as a personal project?</li>
  105. <li>Why does the project use Git+JS?</li>
  106. </ol>
  107. <p><strong>1. Why keep track of spendings in an application?</strong></p>
  108. <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>
  109. <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>
  110. <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>
  111. <ol>
  112. <li>Pay for the upgraded version and use a completely new "shiny" user interface.</li>
  113. <li>Stop their ripoff, keep my money and lose the history of spendings.</li>
  114. </ol>
  115. <p>I concluded that:</p>
  116. <ol>
  117. <li>I already paid for the application;</li>
  118. <li>the old version was suitable for me;</li>
  119. <li>I did not ask for an upgrade;</li>
  120. <li>if I would know I have to pay for each upgrade, I would have never purchased their application in the first place;</li>
  121. <li>I didn't want to sponsor this boorishness;</li>
  122. </ol>
  123. <p>so I stopped the ripoff and <strong>lost my history of spendings</strong>.</p>
  124. <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>
  125. <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>
  126. <p><img src="../../images/2020-05-06_гит-бюджет_заметки.png" alt="Notes" /></p>
  127. <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>
  128. <p><img src="../../images/2020-05-06_гит-бюджет_календарь-день.png" alt="Calendar" /></p>
  129. <p><img src="../../images/2020-05-06_гит-бюджет_календарь-запись.png" alt="New record" /></p>
  130. <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>
  131. <p>While I was using a calendar, I've had the following ideas frequently visiting me:</p>
  132. <ol>
  133. <li>it would be nice to keep all my data in Git to be able to easily analyze the spendings;</li>
  134. <li>it would be nice to have a convenient user interface without all the noise that prevents me from quickly adding a record.</li>
  135. </ol>
  136. <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>
  137. <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>
  138. <p>That's how the spendings look like on my phone now:</p>
  139. <p><img src="../../images/2020-05-06_гит-бюджет.png" alt="GitBudget" /></p>
  140. <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>
  141. <p>Let me highlight a few important issues:</p>
  142. <ul>
  143. <li>Git repository above reflects actions performed in the video above;</li>
  144. <li>I keep my spendings in a private repository, you should do the same;</li>
  145. <li>the application runs completely on the device and has no back-end: GitHub Pages hosting is used;</li>
  146. <li>the application talks to the outside world only during synchronization with Git;</li>
  147. <li>password is kept by a browser, the application only uses it for synchronization with Git;</li>
  148. <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>
  149. </ul>
  150. <p><strong>2. Why did I create the application as a personal project?</strong></p>
  151. <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>
  152. <p>Personal projects have the following benefits over those done at work:</p>
  153. <ol>
  154. <li>You can do whatever you want and learn from your mistakes.</li>
  155. <li>Nobody's breathing down your neck and restricting your fantasy.</li>
  156. <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>
  157. <li>Mistakes you own drastically widen your horizons.</li>
  158. </ol>
  159. <p>Personal projects have drawbacks, too:</p>
  160. <ol>
  161. <li>Nobody in the world cares about your project but you.</li>
  162. <li>Nobody would pay you for your project.</li>
  163. <li>You have to find time to do the project every day.</li>
  164. <li>Your wife won't thank you for the project, even if she would use it herself.</li>
  165. </ol>
  166. <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>
  167. <p><strong>3. Why does the project use Git+JS?</strong></p>
  168. <p>Keeping data in Git instead of an unknown back-end/API has the following benefits:</p>
  169. <ol>
  170. <li>Git is the most widespread solution for decentralized source version control among developers, i.e., almost every developer has experience with Git.</li>
  171. <li>You don't need a new API to work with Git: you just work with files.</li>
  172. <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>
  173. <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>
  174. <li>For maximum security you can always host your own Git server.</li>
  175. </ol>
  176. <p>Usage of JS with HTML/CSS over Swift/Kotlin/C#/Python has the following benefits:</p>
  177. <ol>
  178. <li>Your application runs everywhere: PC, tablet, mobile phone.</li>
  179. <li>You don't need to pass AppStore reviews to get to every device.</li>
  180. <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>
  181. <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>
  182. </ol>
  183. <p>GitBudget is the first attempt to see what Git+JS can do. I can only imagine the possibilities lying ahead.</p>
  184. </div>
  185. </div>
  186. <div id="footer">
  187. The site has been generated by <a href="http://opengamestudio.org/pskov">PSKOV</a>
  188. from <a href="http://github.com/ogstudio/site-opengamestudio">this source code</a>.
  189. The site is hosted by <a href="https://pages.github.com">GitHub Pages</a>.
  190. </div>
  191. </center>
  192. </body>
  193. </html>