{"componentChunkName":"component---src-templates-blog-post-js","path":"/looking-at-the-root-problem","result":{"data":{"markdownRemark":{"html":"<h1>Looking At The Root Problem</h1>\n<p>Sometime when we are working on a hard problem, we will kind of stuck in the middle and found lots of hacky way to overcome the problem. But lots of time, the solution is not perfect and you need to keep coming back cause sometime it simply doesn't work. Sometimes, you need to look at the big picture, it might solve the problem entirely.</p>\n<p>Here is an example, the product I am working on has to support i18n. Means need to support multiple languages. The problem we have is we don't know when we will recieve the translations. If the translation doesn't come back by the time we ship our code, user will see some missing string when viewing in the languages other then English.</p>\n<p>To overcome this problem, we come up with an idea by adding fallback logic in our code base. If user is not viewing English, then we inject the missing translation in English. This works well, but it is time consuming. Adding the fallback logic is time consuming, removing the logic when translation came back is time consuming too.</p>\n<p>By looking at the problem again, we found we can simply using webpack plugin to merge the translation file, all the missing string in the translation files will be replace with English string. This only took me few hours to implement, but the on going cost of adding and removing fallback logic is uncountable.</p>","frontmatter":{"date":"August 09, 2018","path":"/looking-at-the-root-problem","tags":["probelm solving"],"title":"Looking At The Root Problem"}}},"pageContext":{"prev":{"excerpt":"Feature Toggle And Regression It is OK to violate DRY principls to copy the code when working on a new feature that is high couple to old behaviour. As a professional software engineer, I kind of strickly obey the DRY principals, and don't want to…","html":"<h1>Feature Toggle And Regression</h1>\n<p>It is OK to violate DRY principls to copy the code when working on a new feature that is high couple to old behaviour.</p>\n<p>As a professional software engineer, I kind of strickly obey the DRY principals, and don't want to introduce any regression. But this could end up you can not easily to write a clean code and refactor. You need to branch your code in the exisitng code base. </p>\n<p>Copy the exisitng code will ease your regresion nightmare. Once toggle is removed, the old code will disappear, so you are not violating DRY prinsipal any more. But you need to make sure the toggle will be removed and old behaviour will not needed. Otherwise, you could put yourself in a situation that DRY try to address, maintain multiple codes that basically indentical.</p>","id":"542576fb-98c8-5d3b-ae45-751baaf7b524","timeToRead":1,"frontmatter":{"date":"2018-08-09T21:12:26.441Z","path":"/feature-toggle-and-regression","tags":["dry","feature-toogle","regression"],"title":"Feature Toggle And Regression"}},"next":{"excerpt":"Thoughts About Productivity Distrative Spot any steps in thw workflow that could easily distract from your work. For example, a developer might occarually run an end to end test. This e2e srcipts need few steps to complete.  install dependencies…","html":"<h1>Thoughts About Productivity</h1>\n<h2>Distrative</h2>\n<p>Spot any steps in thw workflow that could easily distract from your work. For example, a developer might occarually run an end to end test. This e2e srcipts need few steps to complete. </p>\n<ol>\n<li>install dependencies</li>\n<li>update webdriver</li>\n<li>start webdriver</li>\n<li>run the test scripts\nThe steps might look simple and easy to follow. But to an ordanary developer like myself, can only vaguely remember how to do this few weeks later. So what ends up is, I alwasy need to check the README or whatever that document the process. This is a distraction. A distraction will end up lots of mental cost, including context switching.\nA developer might developing a feature and just want to know wheather his code will pass the e2e tests, but now he has forced to switch context to learn how to run the tests again.\nIf these steps can be run in a single command, like <code class=\"language-text\">npm run e2e-test</code>, then it is a way better improvement in terms of distraction. A single command is way easy to remember than a sequnce of commands.</li>\n</ol>\n<p>Scripting all simple process if possible.</p>","id":"92d39662-079d-5be0-8933-2519895f0c0d","timeToRead":1,"frontmatter":{"date":"2018-08-08T22:38:22.164Z","path":"/thoughts-about-productivity","tags":["productivity"],"title":"Thoughts About Productivity"}}}}}