<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Thai Vo</title><description>Computer enthusiast · software engineer · product developer — notes on books, systems, and software design.</description><link>https://vnqthai.com/</link><item><title>Clean Code by Robert C. Martin - Code quality is your responsibility</title><link>https://vnqthai.com/post/clean-code/</link><guid isPermaLink="true">https://vnqthai.com/post/clean-code/</guid><description>&quot;Writing clean code is what you must do in order to call yourself a professional. There is no reasonable excuse for doing anything less than your best.&quot;</description><pubDate>Sat, 04 Apr 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;If you &lt;strong&gt;care&lt;/strong&gt; about quality of your software, happiness of your colleagues, and professionalism of yourself, you should read this book.&lt;/p&gt;
&lt;p&gt;You will very soon pay for bad code, much sooner than you may expected.  We spend most of our development time in reading code. The ratio of reading and writing is around 10:1. So please write clean code, that will help you and your colleagues a lot.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/clean-code/cover.jpg&quot; alt=&quot;Clean Code - A Handbook of Agile Software Craftmanship book&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Clean Code - A Handbook of Agile Software Craftmanship, by Robert C. Martin. Image source: kobo.com&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;em&gt;Texts in italic&lt;/em&gt;, bullet/numbered lists and source code examples are quotes from the book.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;If you want to go fast, if you want to get done quickly, if you want your code to be easy to write, make it easy to read.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Working program is not enough. They must have readability, flexibility, maintainability, and reusability. &lt;em&gt;Getting software to work and making software clean are two very different activities. Most of us have limited room in our heads, so we focus on getting our code to work more than organization and cleanliness. The problem is that too many of us think that we are done once the program works.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;There are many recommendations and guidelines to help us make our code clean. They will be listed below, then summarized in &lt;a href=&quot;#smells-and-heuristics&quot;&gt;Smells and Heuristics&lt;/a&gt;. However, there are some points that I have my own idea, they will be listed in the very last section: &lt;a href=&quot;#what-do-i-not-agree&quot;&gt;What do I not agree&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;#1: Clean Code&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Most managers may defend the schedule and requirements with passion; but that&apos;s their job. It&apos;s &lt;strong&gt;your&lt;/strong&gt; job to defend the code with equal passion.&lt;/em&gt; It is programmer&apos;s responsibility to tell managers about the importance of code quality and the cost of owning a mess. Write clean code will save you time sooner than you can imagine.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;You will &lt;strong&gt;not&lt;/strong&gt; make the deadline by making the mess. Indeed, the mess will slow you down instantly, and will force you to miss the deadline. The &lt;strong&gt;only&lt;/strong&gt; way to make the deadline - the only way to go fast - is to keep the code as clean as possible at all times.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Some people can &amp;quot;smell&amp;quot; bad code, but don&apos;t know how to write clean one, just like cooking.&lt;/p&gt;
&lt;h3&gt;Many definitions&lt;/h3&gt;
&lt;p&gt;There are many definitions and point of views about clean code. Based on perspective, background, experience...&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.stroustrup.com&quot;&gt;Bjarne Stroustrup&lt;/a&gt;, inventor of C++ and author of &amp;quot;The C++ Programming Language&amp;quot;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I like my code to be &lt;strong&gt;elegant&lt;/strong&gt; and &lt;strong&gt;efficient&lt;/strong&gt;. The logic should be straightforward to make it hard for bugs to hide, the dependencies minimal to ease maintenance, error handling complete according to an articulated strategy, and  performance close to optimal so as not to &lt;strong&gt;tempt&lt;/strong&gt; people to make the code messy with unprincipled optimizations. Clean code does one thing well.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Grady_Booch&quot;&gt;Grady Booch&lt;/a&gt;, author of &amp;quot;Object Oriented Analysis and Design with Applications&amp;quot;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer&apos;s intent but rather is full of &lt;strong&gt;crisp&lt;/strong&gt; abstractions and straightforward lines of control.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&amp;quot;Big&amp;quot; Dave Thomas, founder of OTI, godfather of the Eclipse strategy:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;quot;Clean code can be read, and enhanced by a developer other than its original author. It has unit and acceptance tests. It has meaningful names. It provides one way rather than many ways for doing one thing. It has &lt;strong&gt;minimal&lt;/strong&gt; dependencies, which are explicitly defined, and provides a clear and minimal API.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Michael Feathers, author of &amp;quot;Working Effectively with Legacy Code&amp;quot;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Clean code always looks like it was written by someone who &lt;strong&gt;cares&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href=&quot;https://ronjeffries.com/&quot;&gt;Ron Jeffries&lt;/a&gt;, author of &amp;quot;Extreme Programming Installed&amp;quot; and &amp;quot;Extreme Programming Adventures in C#&amp;quot;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Reduced duplication, high expressiveness, and early building of simple abstractions. That&apos;s what makes clean code for me.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;em&gt;Leave this world a little better than you found it...&lt;/em&gt; Leave the code a little cleaner than you checked it out...&lt;/p&gt;
&lt;h2&gt;#2: Meaningful Names&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Choosing good names takes time but saves more than it takes. So take care with your names and change them when you find better ones.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;There are many simple rules for good names:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Use intention-revealing names&lt;/li&gt;
&lt;li&gt;Avoid disinformation&lt;/li&gt;
&lt;li&gt;Make meaningful distinctions: distinguish names in such a way that the reader knows what the differences offer&lt;/li&gt;
&lt;li&gt;Use pronounceable names&lt;/li&gt;
&lt;li&gt;Use searchable names&lt;/li&gt;
&lt;li&gt;Avoid encodings&lt;/li&gt;
&lt;li&gt;Avoid mental mapping&lt;/li&gt;
&lt;li&gt;Classes and objects should have noun or noun phrase names&lt;/li&gt;
&lt;li&gt;Methods should have verb or verb phrase names&lt;/li&gt;
&lt;li&gt;Don&apos;t be cute&lt;/li&gt;
&lt;li&gt;Pick one word for one abstract concept and stick with it&lt;/li&gt;
&lt;li&gt;Avoid using the same word for two purposes&lt;/li&gt;
&lt;li&gt;Use solution domain names: technical terms, computer science terms, algorithm names, pattern names, math terms...&lt;/li&gt;
&lt;li&gt;Use problem domain names&lt;/li&gt;
&lt;li&gt;Add meaningful context&lt;/li&gt;
&lt;li&gt;Don&apos;t add gratuitous context: shorter names are generally better than longer ones, so long as they are clear&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;#3: Clean Functions&lt;/h2&gt;
&lt;p&gt;Should be small, but deep. Keeping functions small and deep is hard. Whatever they are, they should be clean. You can achieve this by refactoring and extracting functions.&lt;/p&gt;
&lt;p&gt;Do one thing: &lt;em&gt;Functions should do one thing. They should do it well. They should do it only.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Use descriptive names: &lt;em&gt;You know you are working on clean code when each routine turns out to be pretty much what you expected.&lt;/em&gt; &lt;em&gt;Don&apos;t be afraid to make a name long. A long descriptive name is better than a short enigmatic name. A long descriptive name is better than a long descriptive comment.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Arguments: Keep as less function arguments as possible. Because it introduces more detail, it also make testing harder. Consider instance variable or wrap arguments into a class.&lt;/p&gt;
&lt;p&gt;Avoid output arguments: &lt;em&gt;If a function is going to transform its input argument, the transformation should appear as the return value. If your function must change the state of something, have it change the state of its own object.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Avoid flag arguments: &lt;em&gt;It immediately complicates the signature of the method, loudly proclaiming that this function does more than one thing.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Command query separation: &lt;em&gt;Functions should either do something or answer something, but not both.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;A function should have no side effects.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Anything that forces you to check the function signature is equivalent to a double-take. It&apos;s a cognitive break and should be avoided.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;#4: Comments&lt;/h2&gt;
&lt;p&gt;Comment &lt;strong&gt;is&lt;/strong&gt; excuse for bad code. &lt;em&gt;The proper use of comments is to compensate for our failure tor express ourself in code.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;When code evolves, it is hard to maintain correctness and up-to-date of its comments. Inaccurate comments are more dangerous than no comment at all. &lt;em&gt;The only truly good comment is the comment that you found a way not to write.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;We know it&apos;s a mess. So we say to ourselves, &amp;quot;Ooh, I&apos;d better comment that!&amp;quot; No! You&apos;d better clean it!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Try to make the self-explain. Instead of doing this:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-java&quot;&gt;// Check to see if the employee is eligible for full benefits
if ((employee.flags &amp;amp;&amp;amp; HOURLY_FLAG) &amp;amp;&amp;amp;
    (employee.age &amp;gt; 65))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Do this:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-java&quot;&gt;if (employee.isEligibleForFullBenefits())
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Bad comments&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Mumbling. If you decide to write a comment, then spend the time necessary to make sure it is the best comment you can write.&lt;/li&gt;
&lt;li&gt;Redundant: repeat, clutter, obscure code&lt;/li&gt;
&lt;li&gt;Misleading&lt;/li&gt;
&lt;li&gt;Mandated comments&lt;/li&gt;
&lt;li&gt;Journal comments&lt;/li&gt;
&lt;li&gt;Noise: restate the obvious and provide no new information. We learned to ignore them, our eyes simply skip over them. Eventually the comments begin to lie as the code around them changes. Bad examples:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-java&quot;&gt;/**
 * Returns the day of the month.
 *
 * @return the day of the month.
 */
 public int getDayOfMonth() {
   return dayOfMonth;
 }
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-java&quot;&gt;/** The name. */
private String name;

/** The version. */
private String version;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Don&apos;t use a comment when you can use function names and variable names&lt;/li&gt;
&lt;li&gt;Position markers. For example:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-java&quot;&gt;// Actions ///////////////////////////////////////
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Closing brace comments: If you find yourself wanting to mark your closing braces, try to shorten your functions instead.&lt;/li&gt;
&lt;li&gt;Attributions and bylines&lt;/li&gt;
&lt;li&gt;Commented-out code: Just delete the code. We won&apos;t lose it. Promise.&lt;/li&gt;
&lt;li&gt;HTML comments&lt;/li&gt;
&lt;li&gt;Nonlocal information: Make sure a comment describes the code it appears near. Don&apos;t offer systemwide information in the context of a local comment.&lt;/li&gt;
&lt;li&gt;Too much information&lt;/li&gt;
&lt;li&gt;Inobvious connection between a comment and the code it describes. It is a pity when a comment needs its own explanation.&lt;/li&gt;
&lt;li&gt;Function headers&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Necessary comments&lt;/h3&gt;
&lt;p&gt;But in some cases, we need comments:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Legal, copyright, authorship&lt;/li&gt;
&lt;li&gt;Informative&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-java&quot;&gt;// format matched kk:mm:ss EEE, MMM dd, yyyy
Pattern timeMatcher = Pattern.compile(
  &amp;quot;\\d*:\\d*:\\d* \\w*, \\w* \\d*, \\d*&amp;quot;);
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;Explanation of intent behind a decision&lt;/li&gt;
&lt;li&gt;Clarification: make obscure thing more readable&lt;/li&gt;
&lt;li&gt;Warning of consequences&lt;/li&gt;
&lt;li&gt;&lt;code&gt;//TODO&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Amplify importance of something that may be missed&lt;/li&gt;
&lt;li&gt;Docs for public APIs&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;#5: Code Formatting&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Code formatting is important. It is about communication, and communication is the professional developer&apos;s first order of business.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The coding style and readability set precedents that continue to affect maintainability and extensibility long after the original code has been changed beyond recognition. &lt;strong&gt;Your style and discipline survives, even though your code does not.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;There are many guidelines for keeping code format &amp;quot;natural&amp;quot; and easy to navigate:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Small files are usually easier to understand than large files.&lt;/li&gt;
&lt;li&gt;Related concepts should be kept close to each other. We want to avoid forcing our readers to hop around through our source files and classes.&lt;/li&gt;
&lt;li&gt;Keep lines short.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Variables&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Variables should be declared as close to their usage as possible.&lt;/li&gt;
&lt;li&gt;Instance variables should be declared at the top of the class, because in a well-designed class, they are used by many, if not all, of the methods of the class.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Functions&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;If one function calls another, they should be vertically close, and the caller should be above the callee, if possible. This gives the program a natural flow. This creates a nice flow down the source code module from high level to low level.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;This is the exact opposite of languages like Pascal, C, and C++ that enforce functions to be defined, or at least declared, before they are used.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;#6: Objects and Data Structures&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Procedural code (code using data structures) makes it easy to add new functions without changing the existing data structures. OO code, on the other hand, makes it easy to add new classes without changing existing functions.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Procedural code makes it hard to add new data structures because all the functions must change. OO code makes it hard to add new functions because all the classes must change.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;#7: Error Handling&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Error handling is important, but if it obscures logic, it&apos;s wrong.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Some techniques and considerations for error handling:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Use exceptions rather than return codes&lt;/li&gt;
&lt;li&gt;Write your &lt;code&gt;try-catch-finally&lt;/code&gt; statement first&lt;/li&gt;
&lt;li&gt;Use unchecked exceptions: stack trace, informative error messages&lt;/li&gt;
&lt;li&gt;Define exception classes in terms of a caller&apos;s needs: concern about how exceptions are caught&lt;/li&gt;
&lt;li&gt;Define the normal flow&lt;/li&gt;
&lt;li&gt;Don&apos;t return &lt;code&gt;null&lt;/code&gt;. Checking &lt;code&gt;null&lt;/code&gt; after each function call is bad. If we don&apos;t check, what exactly should you do in response to a &lt;code&gt;NullPointerException&lt;/code&gt; throw from the depths of your application?&lt;/li&gt;
&lt;li&gt;Don&apos;t pass &lt;code&gt;null&lt;/code&gt;. Avoid whenever possible.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;#8: Boundaries&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Learning the third-party code is hard. Integrating the third-party code is hard too. Doing both at the same time is doubly hard.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Learning/Boundary test: &lt;em&gt;verify that the third-party packages we are using work the way we expect them to. If the third-party package changes in some way incompatible with our tests, we will find out right away.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;#9: Unit Tests&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;It is unit tests that keep your code flexible, maintainable, and reusable.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Having dirty tests is equivalent to, if not worse than, having no tests. The problem is that tests must change as the production code evolves. Test code is as important as production code.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Only put expressive code to the test: build data, operate on that data, and check expected results. Other things are considered noise and should be refactored to helper methods.&lt;/p&gt;
&lt;h3&gt;FIRST rule&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;F&lt;/strong&gt;ast&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;I&lt;/strong&gt;ndependent&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;R&lt;/strong&gt;epeatable: in any environment: production, QA, local without network&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;S&lt;/strong&gt;elf-validating: have boolean output: pass or fail&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;T&lt;/strong&gt;imely&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;#10: Classes&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Single responsibility: &lt;em&gt;We regularly encounter classes that do far too many things. But, a class or module should have one, and only one, reason to change.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Organizing for change: &lt;em&gt;Needs will change, therefore code will change. Change is continual.&lt;/em&gt; Change introduces risks, and must be retested.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This chapter focuses on making classes small. But I would prefer keeping them &amp;quot;deep&amp;quot;, as stated in &lt;a href=&quot;https://vnqthai.com/post/a-philosophy-of-software-design/#modules-should-be-deep&quot;&gt;&amp;quot;A Philosophy of Software Design&amp;quot; post&lt;/a&gt; and &lt;a href=&quot;#small-and-deep&quot;&gt;&amp;quot;What do I not agree&amp;quot; section below&lt;/a&gt;. Sometimes, deep and small are 2 different directions. I also don&apos;t agree with some code improvement examples in this chapter because of the same reason.&lt;/p&gt;
&lt;h2&gt;#11: Systems&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Software systems are unique compared to physical systems. Their architectures can grow incrementally.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;It is a myth that we can get systems &amp;quot;right in the first time.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;About design process: &lt;em&gt;Big Design Up Front (BDUF) is harmful because it inhibits adapting to change, due to the psychological resistance to discarding prior effort and because of the way architecture choices influence subsequent thinking about design.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Whether you are designing systems or individual modules, never forget to use the simplest thing that can possibly work.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;About decision making: &lt;em&gt;It is also best to postpone decisions until the last possible moment. This isn&apos;t lazy or irresponsible; it lets us make informed choices with the best possible information. A premature decision is a decision made with suboptimal knowledge.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;#12: Emergence&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;A design is &amp;quot;simple&amp;quot; if it follow these rules, in order of importance:&lt;/em&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Runs all the tests&lt;/li&gt;
&lt;li&gt;Contains no duplication&lt;/li&gt;
&lt;li&gt;Expresses the intent of the programmer&lt;/li&gt;
&lt;li&gt;Minimizes the number of classes and methods&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;#13: Concurrency&lt;/h2&gt;
&lt;p&gt;Concurrency is &lt;strong&gt;hard&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Concurrency incurs some overhead, both in performance as well as writing additional code.&lt;/li&gt;
&lt;li&gt;Correct concurrency is hard, even for simple problems.&lt;/li&gt;
&lt;li&gt;Concurrency bugs aren&apos;t usually repeatable, so they are often ignored as one-offs instead of the true defects they are.&lt;/li&gt;
&lt;li&gt;Concurrency often requires a fundamental change in design strategy.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Concurrency myths and misconceptions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Concurrency always improves performance&lt;/li&gt;
&lt;li&gt;Design does not change when writing concurrent programs&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Useful recommendations:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Keep your concurrency-related code separate from other code&lt;/li&gt;
&lt;li&gt;Take data encapsulation to heart; severely limit the access of any data that may be shared&lt;/li&gt;
&lt;li&gt;Attempt to partition data into independent subsets than can be operated on by independent threads, possibly in different processors&lt;/li&gt;
&lt;li&gt;Keep your synchronized sections as small as possible&lt;/li&gt;
&lt;li&gt;Do not ignore system failures as one-offs&lt;/li&gt;
&lt;li&gt;Do not try to chase down nonthreading bugs and threading bugs at the same time. Make sure your code works outside of threads.&lt;/li&gt;
&lt;li&gt;Make your thread-based code especially pluggable so that you can run it in various configurations&lt;/li&gt;
&lt;li&gt;Run your threaded code on all target platforms early and often&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Deadlock&lt;/h3&gt;
&lt;p&gt;This book has a very good part about deadlock: causes, how to avoid and how to test: on &lt;strong&gt;Appendix A, page 335&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;#14: Successive Refinement&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;If we have learned anything over the last couple of decades, it is that &lt;strong&gt;programming is a craft more than it is a science&lt;/strong&gt;. To write clean code, you must first write dirty code and then clean it.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;It is not enough for code to work. Code that works is often badly broken. Programmers who satisfy themselves with merely working code are behaving unprofessionally. They may fear that they don&apos;t have time to improve the structure and design of their code, but I disagree. &lt;strong&gt;Nothing has a more profound and long-term degrading effect upon a development project than bad code.&lt;/strong&gt; Bad schedules can be redone, bad requirements can be redefined. Bad team dynamics can be repaired. But bad code rots and ferments, becoming an inexorable weight that drags the team down. Time and time again I have seen teams grind to a crawl because, in their haste, they created a malignant morass of code that forever thereafter dominated their destiny.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Of course bad code can be cleaned up. But it&apos;s very expensive. As code rots, the modules insinuate themselves into each other, creating lots of hidden and tangled dependencies. Finding and breaking old dependencies is a long and arduous task. On the other hand, keeping code clean is relatively easy. If you made a mess in a module in the morning, it is easy to clean it up in the afternoon. Better yet, if you made a mess five minutes ago, it&apos;s very easy to clean it up right now.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;So the solution is to continuously keep your code as clean and simple as it can be. Never let the rot get started.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;Smells and Heuristics&lt;/h2&gt;
&lt;p&gt;Key points stated in previous chapters:&lt;/p&gt;
&lt;p&gt;General:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Multiple languages in one source file&lt;/li&gt;
&lt;li&gt;Obvious behavior is unimplemented&lt;/li&gt;
&lt;li&gt;Incorrect behavior at the boundaries&lt;/li&gt;
&lt;li&gt;Overridden safeties&lt;/li&gt;
&lt;li&gt;Duplication&lt;/li&gt;
&lt;li&gt;Code at wrong level of abstraction&lt;/li&gt;
&lt;li&gt;Base classes depending on their derivatives&lt;/li&gt;
&lt;li&gt;Too much information&lt;/li&gt;
&lt;li&gt;Dead code&lt;/li&gt;
&lt;li&gt;Vertical separation&lt;/li&gt;
&lt;li&gt;Inconsistency&lt;/li&gt;
&lt;li&gt;Clutter&lt;/li&gt;
&lt;li&gt;Artificial coupling&lt;/li&gt;
&lt;li&gt;Feature envy&lt;/li&gt;
&lt;li&gt;Selector arguments&lt;/li&gt;
&lt;li&gt;Obscured intent&lt;/li&gt;
&lt;li&gt;Misplaces responsibility&lt;/li&gt;
&lt;li&gt;Inappropriate static&lt;/li&gt;
&lt;li&gt;Use explanatory variables&lt;/li&gt;
&lt;li&gt;Function names should say what they do&lt;/li&gt;
&lt;li&gt;Understand the algorithm&lt;/li&gt;
&lt;li&gt;Make logical dependencies physical&lt;/li&gt;
&lt;li&gt;Prefer polymorphism to if/else or switch/case&lt;/li&gt;
&lt;li&gt;Follow standard conventions&lt;/li&gt;
&lt;li&gt;Replace magic numbers with named constants&lt;/li&gt;
&lt;li&gt;Be precise&lt;/li&gt;
&lt;li&gt;Structure over convention&lt;/li&gt;
&lt;li&gt;Encapsulate conditionals&lt;/li&gt;
&lt;li&gt;Avoid negative conditionals&lt;/li&gt;
&lt;li&gt;Functions should do one thing&lt;/li&gt;
&lt;li&gt;Hidden temporal couplings&lt;/li&gt;
&lt;li&gt;Don&apos;t be arbitrary&lt;/li&gt;
&lt;li&gt;Encapsulate boundary conditions&lt;/li&gt;
&lt;li&gt;Functions should descend only one level of abstraction&lt;/li&gt;
&lt;li&gt;Keep configurable data at high levels&lt;/li&gt;
&lt;li&gt;Avoid transitive navigation&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Names:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Choose descriptive names&lt;/li&gt;
&lt;li&gt;Choose names at the appropriate level of abstraction&lt;/li&gt;
&lt;li&gt;Use standard nomenclature where possible&lt;/li&gt;
&lt;li&gt;Unambiguous names&lt;/li&gt;
&lt;li&gt;Use long names for long scopes&lt;/li&gt;
&lt;li&gt;Avoid encodings&lt;/li&gt;
&lt;li&gt;Names should describe side-effects&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Functions:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Too many arguments&lt;/li&gt;
&lt;li&gt;Output arguments&lt;/li&gt;
&lt;li&gt;Flag arguments&lt;/li&gt;
&lt;li&gt;Dead function&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Tests:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Insufficient tests&lt;/li&gt;
&lt;li&gt;Use a coverage tool&lt;/li&gt;
&lt;li&gt;Don&apos;t skip trivial tests&lt;/li&gt;
&lt;li&gt;An ignored test is a question about an ambiguity&lt;/li&gt;
&lt;li&gt;Test boundary conditions&lt;/li&gt;
&lt;li&gt;Exhaustively test near bugs&lt;/li&gt;
&lt;li&gt;Patterns of failure are revealing&lt;/li&gt;
&lt;li&gt;Test coverage patterns can be revealing&lt;/li&gt;
&lt;li&gt;Tests should be fast&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Comments:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Inappropriate information&lt;/li&gt;
&lt;li&gt;Obsolete comment&lt;/li&gt;
&lt;li&gt;Redundant comment&lt;/li&gt;
&lt;li&gt;Poorly written comment&lt;/li&gt;
&lt;li&gt;Commented-out code&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Environment:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Build requires more than one step&lt;/li&gt;
&lt;li&gt;Tests requires more than one step&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Java:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Avoid long import lists by using wildcards&lt;/li&gt;
&lt;li&gt;Don&apos;t inherit constants&lt;/li&gt;
&lt;li&gt;Constants versus enums&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;What do I not agree&lt;/h2&gt;
&lt;h3&gt;Small and deep&lt;/h3&gt;
&lt;p&gt;The small function/class rule of this book, in some specific cases, contradicts with the &lt;a href=&quot;https://vnqthai.com/post/a-philosophy-of-software-design/#modules-should-be-deep&quot;&gt;deep module&lt;/a&gt; principle of &amp;quot;A Philosophy of Software Design&amp;quot; by John Ousterhout. In cases that raise a contradiction, I would prefer the &amp;quot;deep module&amp;quot; principle. Deep does not mean unclean. With good skills, we can make deep modules/classes clean.&lt;/p&gt;
&lt;h3&gt;Listing 3-7&lt;/h3&gt;
&lt;p&gt;To make functions &amp;quot;do just one thing&amp;quot;, the author break them into smaller ones. In my opinion, this increase reference cost, reader must read forward and backward go get the big picture. Each function is shallow. They just do &amp;quot;elemental&amp;quot; things, and doesn&apos;t provide any extra calculation except calling another function. They are just function forwarder. A lot of references to get one thing done make the code harder to read.&lt;/p&gt;
&lt;p&gt;My proposed change: functions can do more than one thing. As long as they provide helpful calculation, keep themselves clean and easy to read. No need to do function references here and there in order to just keep them small.&lt;/p&gt;
&lt;h3&gt;Listing 9-4, 9-5&lt;/h3&gt;
&lt;p&gt;Reader must have knowledge about upper and lower case convention, or need to read many functions in production code, to understand what &lt;code&gt;HBchL&lt;/code&gt; actually mean.&lt;/p&gt;
&lt;h2&gt;Final words&lt;/h2&gt;
&lt;p&gt;Reading the book is not enough. You must &lt;strong&gt;practice&lt;/strong&gt;. Do code reviews in many years will make the most of it.&lt;/p&gt;
&lt;p&gt;Happy coding. And make your colleagues happy coders, too.&lt;/p&gt;
</content:encoded></item><item><title>A Philosophy of Software Design by John Ousterhout - All about complexity</title><link>https://vnqthai.com/post/a-philosophy-of-software-design/</link><guid isPermaLink="true">https://vnqthai.com/post/a-philosophy-of-software-design/</guid><description>&quot;One of the biggest obstacles to good design is mindset. If you don&apos;t have the right mindset, you will just never produce a good design.&quot;</description><pubDate>Sun, 08 Dec 2019 00:00:00 GMT</pubDate><content:encoded>&lt;blockquote&gt;
&lt;p&gt;Writing computer software is one of the purest creative activities in the history of the human race. Programmers aren&apos;t bound by practical limitations such as the laws of physics; we can create exciting virtual worlds with behaviors that could never exist in the real world. Programming doesn&apos;t require great physical skill or coordination, like ballet or basketball. All programming requires is a creative mind and the ability to organize your thoughts. If you can visualize a system, you can probably implement it in a computer program.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This book is must-read for programmers who want to improve design skill and build greater, long-lasting software. Its principles can be applied for both architectural level and code organization.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Contents are copied from the book and &lt;a href=&quot;https://youtu.be/bmSAYlu0NcY&quot;&gt;the author&apos;s talk at Google&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/a-philosophy-of-software-design/cover-1.jpg&quot; alt=&quot;A Philosophy of Software Design book&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;A Philosophy of Software Design, by John Ousterhout. Image source: ebook3000&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The greatest limitation in writing software is our ability to understand the systems we are creating.&lt;/p&gt;
&lt;h2&gt;It&apos;s all about complexity&lt;/h2&gt;
&lt;p&gt;If we want to make it easier to write software, so that we can build more powerful systems more cheaply, we must find ways to make software simpler.&lt;/p&gt;
&lt;p&gt;This book is about one thing: &lt;strong&gt;complexity&lt;/strong&gt;. Dealing with complexity is the most important challenge in software design. It is what makes systems hard to build and maintain, and it often makes them slow as well.&lt;/p&gt;
&lt;p&gt;Furthermore, the &lt;strong&gt;investments&lt;/strong&gt; you make in good design will pay off quickly. The modules you defined carefully at the beginning of a project will save you time later as you reuse them over and over. The clear documentation that you wrote six months ago will save you time when you return to the code and add a new feature. The time you spent honing your design skills will also pay for itself: as your skills and experience grow, you will find that you can produce good designs more and more quickly. &lt;em&gt;Good design doesn&apos;t really take much longer than quick-and-dirty design, once you know how.&lt;/em&gt;&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/a-philosophy-of-software-design/investment.jpeg&quot; alt=&quot;Investment&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Investment. Image source: Pixabay&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The reward for being a good designer is that you get to spend a larger fraction of your time in the design phase, which is fun. Poor designers spent most of their time chasing bugs in complicated and brittle code. If you improve your design skills, not only will you produce higher quality software more quickly, but the software development process will be more enjoyable.&lt;/p&gt;
&lt;h2&gt;The nature of complexity&lt;/h2&gt;
&lt;p&gt;It is easier to tell whether a design is simple than it is to create a simple design, but once you can recognize that a system is too complicated, you can use that ability to guide your design philosophy towards simplicity.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Complexity is anything related to the structure of a software system that makes it hard to understand and modify the system.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Complexity is more apparent to readers and writers. &lt;em&gt;If you write a piece of code and it seems simple to you, but other people think it is complex, then it is complex.&lt;/em&gt; Your job as a developer is not just to create code that you can work with easily, but to create code that others can also work with easily. &lt;strong&gt;Software should be designed for ease of reading, not ease of writing.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Symptoms of complexity:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Change amplification:&lt;/strong&gt; a seemingly simple change requires code modifications in many different places.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cognitive load:&lt;/strong&gt; how much a developer needs to know in order to complete a task. A higher cognitive load means that developers have to spend more time learning the required information, and there is a greater risk of bugs because they have missed something important. Sometimes an approach that requires more lines of code is actually simpler, because it reduces cognitive load.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Unknown unknowns:&lt;/strong&gt; it is not obvious which pieces of code must be modified to complete a task, or what information a developer must have to carry out the task successfully.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Complexity is caused by two things: &lt;strong&gt;dependencies&lt;/strong&gt; and &lt;strong&gt;obscurity&lt;/strong&gt;. Complexity isn&apos;t caused by a single catastrophic error; it accumulates in lots of small chunks. Once complexity has accumulated, it is hard to eliminate, since fixing a single dependency or obscurity will not, by itself, make a big difference.&lt;/p&gt;
&lt;h2&gt;Strategic vs. tactical programming&lt;/h2&gt;
&lt;p&gt;If you want a good design, you must take a more strategic approach where you invest time to produce clean designs and fix problems. The strategic approach produces better designs and is actually cheaper than the tactical approach over the long run.&lt;/p&gt;
&lt;p&gt;Once you start down the tactical path, it&apos;s difficult to change. Tactical programming makes it nearly impossible to produce a good system design. If you are in a company leaning in this direction, you should realize that once a code base turns to spaghetti, it is nearly impossible to fix. You will probably pay high development costs for the life of the product.&lt;/p&gt;
&lt;p&gt;The first step towards becoming a good software designer is to realize that &lt;strong&gt;working code isn&apos;t enough&lt;/strong&gt;. It&apos;s not acceptable to introduce unnecessary complexities in order to finish your current task faster. The most important thing is the long-term structure of the system. Most of the code in any system is written by extending the existing code base, so your most important job as a developer is to facilitate those future extensions. Thus, you should not think of &amp;quot;working code&amp;quot; as your primary goal, though of course your code must work. Your primary goal must be to produce a great design, which also happens to work. This is &lt;strong&gt;strategic programming&lt;/strong&gt;.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/a-philosophy-of-software-design/strategic-vs-tactical-programming.png&quot; alt=&quot;Strategic vs tactical programming&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;At the beginning, a tactical approach to programming will make progress more quickly than a strategic approach. However, complexity accumulates more rapidly under the tactical approach, which reduces productivity. Over time, the strategic approach results in greater process. Image source: the author&apos;s talk at Google&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Once you start delaying design improvements, it&apos;s easy for the delays to become permanent and for your culture to slip into the tactical approach. The longer you wait to address design problems, the bigger they become; the solutions become more intimidating, which makes it easy to put them off even more.&lt;/p&gt;
&lt;p&gt;One of the most important factors for success of a company is the &lt;strong&gt;quality of its engineers&lt;/strong&gt;. The best way to lower development costs is to hire great engineers: they don&apos;t cost much more than mediocre engineers but have tremendously higher productivity. However, the best engineers care deeply about good design. If your code base is a wreck, word will get out, and this will make it harder for you to recruit. As a result, you are likely to end up with mediocre engineers. This will increase your future costs and probably cause the system structure to degrade even more.&lt;/p&gt;
&lt;h2&gt;Modules should be deep&lt;/h2&gt;
&lt;p&gt;The best modules are those whose interfaces are &lt;em&gt;much simpler&lt;/em&gt; than their implementations. Such modules have two advantages. First, a simple interface minimizes the complexity that a module imposes on the rest of the system. Second, if a module is modified in a way that does not change its interface, then no other module will be affected by the modification.&lt;/p&gt;
&lt;p&gt;Deep classes are more efficient than shallow ones, because they get more work done for each method call. Shallow classes result in more layer crossings, and each layer crossing adds overhead.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/a-philosophy-of-software-design/classes-should-be-thick.png&quot; alt=&quot;Classes should be thick&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Classes should be thick. Image source: Can great programmers be taught? - John Ousterhout, Stanford University&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;This maximizes the amount of complexity that is concealed.&lt;/p&gt;
&lt;h3&gt;Pull complexity downwards&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;It is more important for a module to have simple interface than a simple implementation.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;When developing a module, look for opportunities to take a little bit of extra suffering upon yourself in order to reduce the suffering of your users.&lt;/p&gt;
&lt;h3&gt;General-purpose modules are deeper&lt;/h3&gt;
&lt;p&gt;The module&apos;s functionality should reflect your current needs, but its interface should not. Instead, the interface should be general enough to support multiple uses.&lt;/p&gt;
&lt;p&gt;One of the most important elements of software design is determining who needs to know what, and when. When the details are important, it is better to make them explicit and as obvious as possible.&lt;/p&gt;
&lt;h3&gt;Avoid configuration parameters&lt;/h3&gt;
&lt;p&gt;You should avoid configuration parameters as much as possible. Before exporting a configuration parameter, ask yourself: &amp;quot;will users (or higher-level modules) be able to determine a better value than we can determine here?&amp;quot; When you do create configuration parameters, see if you can compute reasonable defaults automatically, so users will only need to provide values under exceptional conditions. Ideally, each module should solve a problem completely; configuration parameters result in an incomplete solution, which adds to system complexity.&lt;/p&gt;
&lt;h2&gt;Better together or better apart?&lt;/h2&gt;
&lt;p&gt;If the components are truly independent, then separation is good: it allows the developer to focus on a single component at a time, without being distracted by the other components. On the other hand, if there are dependencies between the components, then separation is bad: developers will end up flipping back and forth between the components. Even worse, they may not be aware of the dependencies, which can lead to bugs.&lt;/p&gt;
&lt;p&gt;When designing methods, the most important goal is to provide clean and simple abstractions. &lt;strong&gt;Each method should do one thing and do it completely.&lt;/strong&gt; The method should have a clean and simple interface, so that users don&apos;t need to have much information in their heads in order to use it correctly. The method should be deep: its interface should be much simpler that its implementations. If a method has all of these properties, then it probably doesn&apos;t matter whether it is long or not.&lt;/p&gt;
&lt;h2&gt;Define errors out of existence&lt;/h2&gt;
&lt;p&gt;The exceptions throw by a class are part of its interface; &lt;strong&gt;classes with lots of exceptions have complex interfaces, and they are shallower than classes with fewer exceptions.&lt;/strong&gt; An exception is a particularly complex element of an interface.&lt;/p&gt;
&lt;p&gt;Throwing exceptions is easy; handling them is hard. Thus, the complexity of exceptions comes from the exception handling code. The best way to reduce the complexity damage caused by exception handling is to &lt;strong&gt;reduce the number of places where exceptions have to be handled&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The best way to reduce bugs is to make software simpler.&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Design special cases out of existence&lt;/h3&gt;
&lt;p&gt;Special cases should be eliminated wherever possible. The best way to do this is by &lt;strong&gt;designing the normal case in a way that automatically handles the special cases without any extra code&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Special cases of any form make code harder to understand and increase the likelihood of bugs.&lt;/p&gt;
&lt;h2&gt;Write comments&lt;/h2&gt;
&lt;p&gt;Developers should be able to understand the abstraction provided by a module without reading any code other than its externally visible declarations.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The process of writing comments, if done correctly, will actually improve a system&apos;s design.&lt;/strong&gt; Conversely, a good software design loses much of its value if it is poorly documented.&lt;/p&gt;
&lt;p&gt;The reason for writing comments is that statements in a programming language can&apos;t capture all of the important information that was in the mind of the developer when the code was written. The guiding principle for comments is that &lt;strong&gt;comments should describe things that aren&apos;t obvious from the code, it is to capture information that was in the mind of the designer but couldn&apos;t be represented in the code.&lt;/strong&gt; Without documentation, future developers will have to re-derive or guess at the developer&apos;s original knowledge; this will take additional time, and there is a risk of bugs if the new developer misunderstands the original designer&apos;s intentions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Comments augment the code by providing information at a different level of detail.&lt;/strong&gt; Some comments provide information at a lower, more detailed, level than the code; these comments add &lt;em&gt;precision&lt;/em&gt; by clarifying the exact meaning of the code. Other comments provide information at a higher, more abstract, level than the code; these comments offer &lt;em&gt;intuition&lt;/em&gt;, such as the reasoning behind the code, or a simpler and more abstract way of thinking about the code.&lt;/p&gt;
&lt;h2&gt;Modify existing code&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Ideally, when you have finished with each change, the system will have the structure it would have had if you had designed it from the start with that change in mind.&lt;/strong&gt; To achieve this goal, you must resist the temptation to make a quick fix. Instead, think about whether the current system design is still the best one, in light of the desired change. If not, refactor the system so that you end up with the best possible design. With this approach, the system design improves with every modification. &lt;strong&gt;If you&apos;re not making the design better, you are probably making it worse.&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;Consistency&lt;/h2&gt;
&lt;p&gt;If a system is consistent, it means that similar things are done in similar ways, and dissimilar things are done in different ways. Consistency creates cognitive leverage: once you have learned how something is done in one place, you can use that knowledge to immediately understand other places that use the same approach. If a system is not implemented in a consistent fashion, developers must learn about each situation separately.&lt;/p&gt;
&lt;p&gt;The more nit-picky that code reviewers are, the more quickly everyone on the team will learn the conventions, and the cleaner the code will be.&lt;/p&gt;
&lt;p&gt;Consistency is another example of the investment mindset. It will take a bit of extra work to ensure consistency: work to decide on conventions, work to create automated checkers, work to look for similar situations to mimic in new code, and work in code reviews to educate the team. The return on this investment is that your code will be more obvious. Developers will be able to understand the code&apos;s behavior more quicky and accurately, and this will allow them to work faster, with fewer bugs.&lt;/p&gt;
&lt;h2&gt;Design for performance&lt;/h2&gt;
&lt;p&gt;It&apos;s tempting to rush off and start making performance tweaks, based on your intuitions about what is slow. Don&apos;t do this! Programmers&apos; intuitions about performance are unreliable. This is true even for experienced developers. If you start making changes based on intuition, you&apos;ll waste time on things that don&apos;t actually improve performance, and you&apos;ll probably make the system more complicated in the process.&lt;/p&gt;
&lt;h2&gt;Design it twice&lt;/h2&gt;
&lt;p&gt;Designing software is hard, so it&apos;s unlikely that your first thoughts about how to structure a module or system will produce the best design. You&apos;ll end up with a much better result if you consider multiple options for each major design decision: &lt;strong&gt;design it twice&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Try to pick approaches that are radically different from each other; you&apos;ll learn more that way. Even if you are certain that there is only one reasonable approach, &lt;em&gt;consider a second design anyway&lt;/em&gt;, no matter how bad you think it will be. It will be instructive to think about the weaknesses of that design and contrast them with the features of other designs. After you have roughed out the designs for the alternatives, make a list of the pros and cons of each one.&lt;/p&gt;
&lt;p&gt;It is also worth considering other factors:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Does one alternative have a simpler interface than another?&lt;/li&gt;
&lt;li&gt;Is one interface more general-purpose than another?&lt;/li&gt;
&lt;li&gt;Does one interface enable a more efficient implementation than another?&lt;/li&gt;
&lt;li&gt;Is one interface ease of use for higher level software?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Once you have compared alternative designs, you will be in a better position to identify the best design. The best choice may be one of the alternatives, or you may discover that you can combine features of multiple alternatives into a new design that is better than any of the original choices.&lt;/p&gt;
&lt;h3&gt;Smart people&lt;/h3&gt;
&lt;p&gt;The design-it-twice principle is sometimes hard for really smart people to embrace. When they are growing up, smart people discover that their first quick idea about any problem is sufficient for a good grade; there is no need to consider a second or third possibility. This makes it easy to develop bad work habits. However, as these people get older, they get promoted into environments with harder and harder problems. Eventually, everyone reaches a point where your first ideas are no longer good enough; if you want to get really great results, you have to consider a second possibility, or perhaps a third, no matter how smart you are. The design of large software systems falls in this category: no-one is good enough to get it right with their first try.&lt;/p&gt;
&lt;p&gt;Unfortunately, I often see smart people who insist on implementing the first idea that comes to mind, and this causes them to underperform their true true potential (it also makes them frustrating to work with). Perhaps they subconsciously believe that &amp;quot;smart people get it right the first time,&amp;quot; so if they try multiple designs it would mean they are not smart after all. This is not the case. &lt;em&gt;It isn&apos;t that you aren&apos;t smart; it&apos;s that the problems are really hard!&lt;/em&gt; Furthermore, that&apos;s a good thing: it&apos;s much more fun to work on a difficult problem where you have to think carefully, rather than an easy problem where you don&apos;t have to think at all.&lt;/p&gt;
&lt;p&gt;The design-it-twice approach not only improves your designs, but it also improves your design skills. The process of devising and comparing multiple approaches will teach you about the factors that make designs better or worse. Over time, this will make it easier for you to rule out bad designs and hone in on really great ones.&lt;/p&gt;
&lt;h2&gt;Process&lt;/h2&gt;
&lt;p&gt;Because software is so malleable, software design is a &lt;em&gt;continuous process&lt;/em&gt; that spans the entire lifecycle of a software system; this makes software design different from the design of physical systems such as buildings, ships, or bridges.&lt;/p&gt;
&lt;p&gt;The waterfall model rarely works well for software. Software systems are intrinsically more complex than physical systems; it isn&apos;t possible to visualize the design for a large software system well enough to understand all of its implications before building anything. As a result, the initial design will have many problems. The problems do not become apparent until implementations is well underway.&lt;/p&gt;
&lt;p&gt;Incremental development means that software design is never done. Design happens continuously over the life of a system: developers should always be thinking about design issues. Incremental development also means continuous redesign. &lt;em&gt;The initial design for a system or component is almost never the best one; experience inevitably shows better ways to do things.&lt;/em&gt; As a software developer, you should always be on the lookout for opportunities to improve the design of the system you are working on, and you should plan on spending some fraction of your time on design improvements.&lt;/p&gt;
&lt;p&gt;It isn&apos;t possible to visualize a complex system well enough at the outset of a project to determine the best design. The best way to end up with a good design is to develop a system in increments, where each increment adds a few new abstractions and refactors existing abstractions based on experience.&lt;/p&gt;
&lt;h3&gt;Test-driven development (TDD)&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;The problem with test-driven development is that it focuses attention on getting specific features working, rather than finding the best design.&lt;/strong&gt; This is tactical programming pure and simple, with all of its disadvantages. Test-driven development is to incremental: at any point in time, it&apos;s tempting to just hack in the next feature to make the next test pass. There&apos;s no obvious time to design, so it&apos;s easy to end up with a mess.&lt;/p&gt;
&lt;p&gt;One place where it makes sense to write the tests first is when fixing bugs. Before fixing a bug, write a unit test that fails because of the bug. Then fix the bug and make sure that the unit test now passes. This is the best way to make sure you really have fixed the bug. If you fix the bug before writing the test, it&apos;s possible that the new unit test doesn&apos;t actually trigger the bug, in which case it won&apos;t tell you whether you really fixed the problem.&lt;/p&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;Here are the most important software &lt;strong&gt;design principles&lt;/strong&gt; discussed in this book:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Complexity is incremental: you have to sweat the small stuff.&lt;/li&gt;
&lt;li&gt;Working code isn&apos;t enough.&lt;/li&gt;
&lt;li&gt;Make continual small investments to improve system design.&lt;/li&gt;
&lt;li&gt;Modules should be deep.&lt;/li&gt;
&lt;li&gt;Interfaces should be designed to make the most common usage as simple as possible.&lt;/li&gt;
&lt;li&gt;It&apos;s more important for a module to have a simple interface than a simple implementation.&lt;/li&gt;
&lt;li&gt;General-purpose modules are deeper.&lt;/li&gt;
&lt;li&gt;Separate general-purpose and special-purpose code.&lt;/li&gt;
&lt;li&gt;Different layers should have different abstractions.&lt;/li&gt;
&lt;li&gt;Pull complexity downward.&lt;/li&gt;
&lt;li&gt;Define errors (and special cases) out of existence.&lt;/li&gt;
&lt;li&gt;Design it twice.&lt;/li&gt;
&lt;li&gt;Comments should describe things that are not obvious from the code.&lt;/li&gt;
&lt;li&gt;Software should be designed for ease of reading, not ease of writing.&lt;/li&gt;
&lt;li&gt;The increments of software development should be abstractions, not features.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here are a few of the most important &lt;strong&gt;red flags&lt;/strong&gt; discussed in this book. The presence of any of these symptoms in a system suggests that there is a problem with the system&apos;s design:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Shallow module:&lt;/strong&gt; the interface for a class or method isn&apos;t much simpler than its implementation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Information leakage:&lt;/strong&gt; a design decision is reflected in multiple modules.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Temporal decomposition:&lt;/strong&gt; the code structure is based on the order in which operations are executed, not on information hiding.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Overexposure:&lt;/strong&gt; an API forces callers to be aware of rarely used features in order to use commonly used features.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pass-through method:&lt;/strong&gt; a method does almost nothing except pass its arguments to another method with a similar signature.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Repetition:&lt;/strong&gt; a nontrivial piece of code is repeated over and over.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Special-general mixture:&lt;/strong&gt; special-purpose code is not cleanly separated from general purpose code.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Conjoined methods:&lt;/strong&gt; two methods have so many dependencies that it is hard to understand the implementation of one without understanding the implementation of the other.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Comment repeats code:&lt;/strong&gt; all of the information in a comment is immediately obvious from the code next to the comment.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Implementation documentation contaminates interface:&lt;/strong&gt; an interface comment describes implementation details not needed by users of the thing being documented.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vague name:&lt;/strong&gt; the name of a variable or method is so imprecise that it doesn&apos;t convey much useful information.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hard to pick name:&lt;/strong&gt; it is difficult to come up with a precise and intuitive name for an entity.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hard to describe:&lt;/strong&gt; in order to be complete, the documentation for a variable or method must be long.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Nonobvious code:&lt;/strong&gt; the behavior or meaning of a piece of code cannot be understood easily.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Other good notes&lt;/h2&gt;
&lt;p&gt;Every rule has its exceptions, and every principle has its limits. If you take any design idea to its extreme, you will probably end up in a bad place. Beautiful designs reflect a balance between competing ideas and approaches.&lt;/p&gt;
&lt;p&gt;There is quite a bit of scientific evidence that outstanding performance in many fields is related more to high-quality practice than innate ability.&lt;/p&gt;
&lt;p&gt;The author also had &lt;a href=&quot;https://youtu.be/bmSAYlu0NcY&quot;&gt;this talk at Google&lt;/a&gt;, which is good and worth watching.&lt;/p&gt;
</content:encoded></item><item><title>Why I need a good laptop? And a good laptop only</title><link>https://vnqthai.com/post/why-i-need-a-good-laptop/</link><guid isPermaLink="true">https://vnqthai.com/post/why-i-need-a-good-laptop/</guid><description>I use laptop for studying, working, and entertainment. Most of the time, I do not distinguish these three.</description><pubDate>Tue, 09 Jul 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;In my life, beside sleep, maybe using computer is the most time-consuming and meaningful activity. That&apos;s why I choose it carefully, invest a lot in it, both hardware and software.&lt;/p&gt;
&lt;h2&gt;Hardware&lt;/h2&gt;
&lt;p&gt;Why to choose laptop over desktop: &lt;em&gt;mobility&lt;/em&gt;. I can bring laptop almost everywhere in the world. In the weekend, if bored with staying in the same room, I can go to cafeteria, park, or mountain and continue to code. I cannot do so with a PC.&lt;/p&gt;
&lt;p&gt;Why MacBook: &lt;em&gt;comfortable&lt;/em&gt;. It is expensive. But if I use that laptop for 3 years, more than 1000 days, and it costs $3000, so $3 a day is not expensive at all for a device that can earn money and grow me to new level. I do not care if today I am having $5 fruit or not, so why I should bother if today I am spending $3 for such an important device? Laptop is an investment that make my life easier and happier.&lt;/p&gt;
&lt;p&gt;Another important reason is most companies I work with provide employees MacBooks. So I can get familiar with working environment both at company and at home. If you use one tool set in company and another at home, that would cost you a lot of time and happiness.&lt;/p&gt;
&lt;p&gt;Why chose to use a not-so-good laptop keyboard instead of mechanical one: again, mobility. I had a blue-switch mechanical keyboard, a split-layout ErgoDox EZ and used them for years. Mechanical keyboards provide far more good-feeling to fingers and mind than laptop keyboards. I always love the feeling when using it. But now I am more focus on working mobility, and have to sacrifice that good feeling. I would prefer coding on top of a mountain rather than stick with a favorite mechanical keyboard but stay in an air-conditioned room.&lt;/p&gt;
&lt;p&gt;Same reason to a separate big monitor. I use a Dell UltraSharp at work, because I usually not bring company work to the jungle. But I do not use a monitor at home, because I sometimes code side project on the edge of a cliff. Where impractical to bring monitor or keyboard to.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/me-coding-on-mountain.JPG&quot; alt=&quot;Me coding on a mountain, in 2012&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Me on a mountain. That was a memorable experience&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Getting familiar with a well-setup and many-device working space takes me to a strange environment if I want to move. And I often move. Right after changing environment, laptop&apos;s built-in keyboard can felt not good enough and typing speed reduces 10 percent compared to mechanical keyboard. My eyes are little painful after switching between different screen resolutions. Window arrangement has just filled for large screen now must be rearranged to fit in smaller space. These things have switching costs. Now I prefer easy movement to many types of environments, as long as my laptop can be brought there.&lt;/p&gt;
&lt;p&gt;Similar with speaker. I used to have a good 2.1 one. But now, my laptop&apos;s built-in speaker is acceptable. And I have AirPods. They are good enough for almost all my current needs.&lt;/p&gt;
&lt;p&gt;A good laptop fits 80 percent of my requirements at the beginning, and now 95 percent after weeks playing around. That is ok for me and I am still happy with my lovely device. Until I find a new interesting way to experience.&lt;/p&gt;
&lt;h2&gt;Software&lt;/h2&gt;
&lt;p&gt;Taking the chance of having new laptop, I would like to reinstall and research everything about tools which I want to install in it, for working, learning, and playing purposes. So I started with a terminal. Besides browser, terminal is my most active software.&lt;/p&gt;
&lt;p&gt;If you are interested in how I setup working softwares, please continue on reading &lt;a href=&quot;https://vnqthai.com/&quot;&gt;this post (will release soon)&lt;/a&gt;. Hope you will get some useful information there.&lt;/p&gt;
</content:encoded></item><item><title>Building Microservices by Sam Newman - Think about it carefully before using it</title><link>https://vnqthai.com/post/building-microservices/</link><guid isPermaLink="true">https://vnqthai.com/post/building-microservices/</guid><description>Valuable lessons to read if you have ever heard about microservices.</description><pubDate>Mon, 06 May 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;This post summarizes points that I feel interesting and worth remembering. Contents are copied from the book.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;quot;The Microservices architecture has many appealing qualities, but the road towards it has painful traps for the unwary. This book will help you figure out if this path is for you, and how to avoid those traps on your journey.&amp;quot; - Martin Fowler&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/building-microservices/cover-1.jpg&quot; alt=&quot;Building Microservices - Designing Fine-Grained Systems book&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Building Microservices - Designing Fine-Grained Systems, by Sam Newman. Image source: O&apos;Reilly&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2&gt;1. Microservices&lt;/h2&gt;
&lt;p&gt;Microservices are &lt;strong&gt;small&lt;/strong&gt;, &lt;strong&gt;autonomous&lt;/strong&gt; services that work together.&lt;/p&gt;
&lt;p&gt;Key benefits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Technology heterogeneity&lt;/li&gt;
&lt;li&gt;Resilience&lt;/li&gt;
&lt;li&gt;Scaling&lt;/li&gt;
&lt;li&gt;Ease of deployment&lt;/li&gt;
&lt;li&gt;Organizational alignment&lt;/li&gt;
&lt;li&gt;Composability&lt;/li&gt;
&lt;li&gt;Optimizing for replaceability&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Microservices are no free lunch or silver bullet and make for a bad choice as a golder hammer. They have all the associated complexity of distributed systems.&lt;/p&gt;
&lt;h2&gt;2. The evolutionary architect&lt;/h2&gt;
&lt;p&gt;Architects can have a direct impact on the quality of the systems built, on the working conditions of their colleagues, and on their organization&apos;s ability to respond to change.&lt;/p&gt;
&lt;p&gt;Our architects need to shift their thinking away from creating the perfect end product, and instead focus on helping create a framework in which the right systems can emerge, and continue to grow as we learn more.&lt;/p&gt;
&lt;p&gt;Making decisions in system design is all about trade-offs, and microservice architecture give us lots of trade-offs to make.&lt;/p&gt;
&lt;p&gt;Great software comes from great people. If you worry only about the technology side of the equation, you&apos;re missing way more than half of the picture.&lt;/p&gt;
&lt;h2&gt;3. How to model services&lt;/h2&gt;
&lt;p&gt;We want to find boundaries within our problem domain that help ensure that related behavior is in one place, and that communicate with other boundaries as loosely as possible.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Loose coupling&lt;/strong&gt;: A change to one service should not require a change to another. A loosely coupled service knows as little as it needs to about the services with which it collaborates.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;High cohesion&lt;/strong&gt;: We want related behavior to sit together, and unrelated behavior to sit elsewhere.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Premature decomposition&lt;/h3&gt;
&lt;p&gt;When starting out, however, keep the new system on the more monolithic side; getting service boundaries wrong can be costly, so waiting for things to stabilize as you get to grips with a new domain is sensible.&lt;/p&gt;
&lt;p&gt;Premature decomposing a system into microservices can be costly, especially if you are new to the domain. In many ways, having an existing codebase you want to decompose into microservices is much easier than trying to go to microservices from the beginning.&lt;/p&gt;
&lt;h2&gt;4. Integration&lt;/h2&gt;
&lt;p&gt;Build if it is unique to what you do, and can be considered a strategic asset; buy if your use of the tool isn&apos;t that special.&lt;/p&gt;
&lt;p&gt;Keep your APIs technology-agnostic: Avoid integration technology that dictates what technology stacks we can use.&lt;/p&gt;
&lt;p&gt;Avoid shared database at (nearly) all costs.&lt;/p&gt;
&lt;h3&gt;Two different idiomatic styles of collaboration&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Request/Response&lt;/strong&gt;: a client initiates a request and waits for the response.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Event-based&lt;/strong&gt;: says &lt;em&gt;thing happened&lt;/em&gt; and expects other parties to know what to do.
&lt;br&gt;&lt;em&gt;Highly decoupled&lt;/em&gt;: the client that emits an event doesn&apos;t have any way of knowing who or what will react to it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Don&apos;t Repeat Yourself (DRY)&lt;/h3&gt;
&lt;p&gt;DRY more accurately means that we want to avoid duplicating our system &lt;em&gt;behavior and knowledge&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Don&apos;t violate DRY within a microservice, but be relaxed about violating DRY across all services. The evils of too much coupling between services are far worse than the problems caused by code duplication.&lt;/p&gt;
&lt;h2&gt;5. Splitting the monolith&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Seam&lt;/strong&gt; is a portion of the code that can be treated in isolation and worked on without impacting the rest of the codebase. Identify seams that can become service boundaries.&lt;/p&gt;
&lt;p&gt;There is no need for this to be a big-bang approach. It is something that can be done bit by bit, day by day.&lt;/p&gt;
&lt;p&gt;We can - and will - make mistakes, and we should embrace that. What we should also do, though, is understand how best to mitigate the costs of those mistakes.&lt;/p&gt;
&lt;h2&gt;6. Deployment&lt;/h2&gt;
&lt;h3&gt;CI/CD&lt;/h3&gt;
&lt;p&gt;With &lt;strong&gt;Continuous Integration (CI)&lt;/strong&gt;, the core goal is to keep everyone in sync with each other, which we achieve by making sure that newly checked-in code properly integrates with existing code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Build pipeline&lt;/strong&gt;: having different stages in our build. We build our artifact, and that artifact is used throughout the pipeline. As our artifact moves through these stages, we feel more confident that the software will work in production.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Continuous Delivery (CD)&lt;/strong&gt; is the approach whereby we get constant feedback on the production readiness of each and every check-in, and furthermore treat each and every check-in as a release candidate.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CI builds artifacts, CD validates artifacts.&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;Automation&lt;/h3&gt;
&lt;p&gt;Embracing a culture of automation is key if you want to keep the complexities of microservices architectures in check.&lt;/p&gt;
&lt;p&gt;Automate everything, and if the technology you have doesn&apos;t allow this, get some new technology!&lt;/p&gt;
&lt;h2&gt;7. Testing&lt;/h2&gt;
&lt;p&gt;Optimize for fast feedback, and separate types of tests accordingly.&lt;/p&gt;
&lt;p&gt;Avoid the need for end-to-end tests wherever possible. Focus on a &lt;em&gt;small&lt;/em&gt; (very low double digits even for complex system) number of core journeys to test for the whole system. Any functionality not covered in these core journeys needs to be covered in tests that analyze services in isolation from each other.&lt;/p&gt;
&lt;h2&gt;8. Monitoring&lt;/h2&gt;
&lt;p&gt;Monitor the small things, and use aggregation to see the bigger picture.&lt;/p&gt;
&lt;p&gt;We can never know what data will be useful.&lt;/p&gt;
&lt;p&gt;Monitoring is one area where &lt;strong&gt;standardization&lt;/strong&gt; is incredibly important:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Write your logs out in a standard format&lt;/li&gt;
&lt;li&gt;Have all your metrics in one place&lt;/li&gt;
&lt;li&gt;Have a list of standard names for your metrics&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Use &lt;strong&gt;correlation IDs&lt;/strong&gt; to track call chains across multiple services. With the right log aggregation tooling, you&apos;ll then be able to trace that event all the way through your system. You can picture the whole cascade of calls.&lt;/p&gt;
&lt;h2&gt;9. Security&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Authentication&lt;/strong&gt; is the process by which we confirm that a party is who she says she is.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Type in username and password.&lt;/li&gt;
&lt;li&gt;Use fingerprint to confirm.&lt;/li&gt;
&lt;li&gt;Use face to confirm (Face ID)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When we are talking abstractly about who or what is being authenticated, we refer to that party as the &lt;strong&gt;principal&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Authorization&lt;/strong&gt; is the mechanism by which we map from a principal to the action we are allowing her to do.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Go with the well known&lt;/strong&gt;: The easiest way you can mess up data encryption is try to implement your own encryption algorithms, or even try to implement someone else&apos;s. Badly implemented encryption could be worse than having none, as the false sense of security can lead you to take your eye off the ball.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Don&apos;t write your own crypto. Don&apos;t invent your own security protocols.&lt;/strong&gt; Unless you are a cryptographic expert with years of experience, if you try inventing your own encoding or elaborate cryptographic protections, you will get it wrong. And even &lt;em&gt;if&lt;/em&gt; you are a cryptographic expert, you may still get it wrong. Reinventing the wheel in many cases is often just a waste of time, but when it comes to security it can be outright dangerous.&lt;/p&gt;
&lt;h2&gt;10. Conway&apos;s law and system design&lt;/h2&gt;
&lt;p&gt;Melwin Conway&apos;s law:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Any organization that design a system (defined more broadly here than just information systems) will inevitably produce a design whose structure is a copy of the organization&apos;s communication structure.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Eric S. Raymond summarized:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you have four groups working on a compiler, you&apos;ll get a 4-pass compiler.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;11. Microservices at scale&lt;/h2&gt;
&lt;p&gt;Systems that just act slow are &lt;em&gt;much&lt;/em&gt; harder to deal with than systems that just fail fast. In a distributed system, latency kills.&lt;/p&gt;
&lt;p&gt;A planned outage is much easier to deal with than an unplanned one.&lt;/p&gt;
&lt;p&gt;At scale, even if you buy the best kit, the most expensive hardware, you cannot avoid the fact that things can and will fail.&lt;/p&gt;
&lt;h3&gt;Scaling&lt;/h3&gt;
&lt;p&gt;The architecture that get you started may not be the architecture that keeps you going when your system has to handle very different volumes of load &lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;[11]&lt;/a&gt;&lt;/sup&gt;. You should &amp;quot;design for ~10x growth, but plan to rewrite before ~100x.&amp;quot; You need to do something pretty radical to support the next level of growth.&lt;/p&gt;
&lt;p&gt;There is a danger that people will see the need to rearchitect when certain scaling thresholds are reached as a reason to build for massive scale from beginning. &lt;em&gt;This can be disastrous.&lt;/em&gt; At the start of a new project, we often don&apos;t know exactly what we want to build, nor do we know if it will be successful. We need to be able to rapidly experiment, and understand what capabilities we need to build. If we tried building for massive scale up front, we&apos;d end up front-loading a huge amount of work to prepare for load that may never come, while diverting effort away from more important activities, like understanding if anyone will want to actually use our product.&lt;/p&gt;
&lt;p&gt;The need to change our systems to deal with scale isn&apos;t a sign of failure. It is a sign of success.&lt;/p&gt;
&lt;h3&gt;CAP theorem&lt;/h3&gt;
&lt;p&gt;In a distributed system, we have three things we can trade off against each other: &lt;strong&gt;consistency&lt;/strong&gt;, &lt;strong&gt;availability&lt;/strong&gt;, and &lt;strong&gt;partition tolerance&lt;/strong&gt;. Specifically, the theorem tells us that we get to keep two in a failure mode.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Consistency&lt;/strong&gt; is the system characteristic by which I will get the same answer if I go to multiple nodes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Availability&lt;/strong&gt; means that every request receives a response.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Partition tolerance&lt;/strong&gt; is the system&apos;s ability to handle the fact that communication between its parts is sometimes impossible.&lt;/p&gt;
&lt;p&gt;If our system has no partition tolerance, it can&apos;t run over a network. In other words, it needs to be a single process operating locally. CA (Consistency and Availability) systems don&apos;t exist in distributed systems.&lt;/p&gt;
&lt;p&gt;Getting multinode consistency right is so hard that I would strongly, &lt;em&gt;strongly&lt;/em&gt; suggest that if you need it, don&apos;t try to invent it yourself. Instead, pick a data store or lock service that offers these characteristics.&lt;/p&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://martinfowler.com/articles/richardsonMaturityModel.html&quot;&gt;Richardson Maturity Model&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://martinfowler.com/bliki/TolerantReader.html&quot;&gt;Tolerant Reader&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://semver.org/&quot;&gt;Semantic Versioning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://martinfowler.com/bliki/StranglerApplication.html&quot;&gt;Strangler Application&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/Netflix/aegisthus&quot;&gt;Netflix&apos;s Aegisthus project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.martinfowler.com/bliki/TestDouble.html&quot;&gt;Test Double&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html&quot;&gt;JSON Web Token (JWT)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://crackstation.net/hashing-security.htm&quot;&gt;Salted Password Hashing - Doing it Right&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.owasp.org&quot;&gt;Open Web Application Security Project (OWASP)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing&quot;&gt;Fallacies of distributed computing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://static.googleusercontent.com/media/research.google.com/en//people/jeff/WSDM09-keynote.pdf&quot;&gt;Challenges in Building Large-Scale Information
Retrieval Systems&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
</content:encoded></item><item><title>How Google Works - An inspirational journey</title><link>https://vnqthai.com/post/how-google-works/</link><guid isPermaLink="true">https://vnqthai.com/post/how-google-works/</guid><description>Harmonization between big-corporate and start-up culture, academic and business goals, long and short term priorities.</description><pubDate>Sun, 03 Feb 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;This book have a lot of &amp;quot;ah&amp;quot;, &amp;quot;oh&amp;quot;, which I cannot do anything else but agree. So I will mostly quote statements from it that would best demonstrate my thoughts.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/how-google-works/how-google-works.png&quot; alt=&quot;How Google Works by Eric Schmidt &amp; Jonathan Rosenberg, with Alan Eagle&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;How Google Works by Eric Schmidt &amp; Jonathan Rosenberg, with Alan Eagle. Image source: howgoogleworks.net&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2&gt;Convention&lt;/h2&gt;
&lt;p&gt;Regular texts are my words, which is not many. &lt;em&gt;Italic&lt;/em&gt; texts and &lt;em&gt;blockquotes&lt;/em&gt; are citations from the book. Some of them are cited by the authors.&lt;/p&gt;
&lt;h2&gt;How Google Works&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;The only way to succeed in business in the twenty-first century is to continually create great products, and the only way to do that is to attract &lt;strong&gt;smart creatives&lt;/strong&gt; and put them in an environment where they can succeed at scale.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/how-google-works/the-smart-creative.jpg&quot; alt=&quot;The smart creative&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;The smart creative. (Illustration in the book)&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;blockquote&gt;
&lt;p&gt;We have long felt that the start-up model, with small, autonomous teams located in one office led by passionate founders, is the most effective way to achieve remarkable new things (or fail quickly in the effort).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Dependence on process, no matter how well intentioned, squelches start-ups and the start-up spirit.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;&lt;em&gt;Introduction&lt;/em&gt;&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;In the old world, you devoted 30 percent of your time to building a great service and 70 percent of your time to shouting about it. In the new world, that inverts.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Product development has become a faster, more flexible process, where radically better products don&apos;t stand on the shoulders of giants, but on the shoulders of lots of iterations. The basis for success then, and for continual product excellence, is speed.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;If you can&apos;t tell someone how to think, then you have to learn to manage the environment where they think. And make it a place where they want to come every day.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Hire enough great people, and the resulting intellectual mixture will inevitably combust into creativity and success.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;&lt;em&gt;Culture&lt;/em&gt;&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Believe your own slogans&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/how-google-works/believe-your-own-slogans.jpg&quot; alt=&quot;Believe your own slogans&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Believe your own slogans. (Illustration in the book)&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h4&gt;Google&apos;s culture focuses on people.&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;Smart creatives, though, place culture at the top of the list. To be effective, they need to care about the place they work. This is why, when starting a new company or initiative, culture is the most important thing to consider.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Once established, company culture is very difficult to change, because early on in a company&apos;s life a self-selection tendency sets in.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;At Google &amp;quot;it doesn&apos;t matter who you are, just what you do.&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;You want to invest in the people who are going to do what they think is right, whether or not you give them permission.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Dissent must be an obligation, not an option.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;There is no perfect organizational design, don&apos;t try to find one.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;About knaves:&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;The character of a company is the sum of the characters of its people, so if you strive for a company of sterling character, that is the standard you must set for your employees. There is no room for knaves. And generally, in our experience, one a knave, always a knave. (Tom Peters: &amp;quot;There is no such thing as a minor lapse of integrity.&amp;quot;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;There are tipping points in knave density. It approaches a critical mass - which is smaller than you think - and people start to believe they need to be knave-like to succeed, which only exacerbates the problem. Smart creatives may have a lot of good traits, but they aren&apos;t saints, so it&apos;s important to watch your knave quotient.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;About work-life balance:&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;For many people, work is an important part of life, not something to be separated.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Give your smart creatives control, and they will usually make their own best decisions about how to balance their lives.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;We encourage people to take real vacations, although not to promote &amp;quot;work-life balance.&amp;quot; If someone is so critical to the company&apos;s success that he believes he can&apos;t unplug for a week or two without things crashing down, then there is a larger problem that must be addressed.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;&lt;em&gt;Strategy&lt;/em&gt;&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Businesses should be built on a strong set of strategic principles, not an MBA-style plan that’s bound to fail.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/how-google-works/your-plan-is-wrong.jpg&quot; alt=&quot;Your plan is wrong&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Your plan is wrong. (Illustration in the book)&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;blockquote&gt;
&lt;p&gt;A &lt;strong&gt;technical insight&lt;/strong&gt; is a new way of applying technology or design that either drives down the cost or increases the functions and usability of the product by a significant factor. The result is something that is better than the competition in a fundamental way. The improvement is often obvious; it doesn&apos;t take a lot of marketing for customers to figure out that this product is different from everything else.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;^ I like that approach.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Most of Google&apos;s successful products have been based on strong technical insights, while most of the less successful ones lacked them.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Giving the customer what he wants is less important than giving him what he doesn&apos;t yet know he wants.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;About competition:&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Don&apos;t follow competition.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;If you focus on your competition, you will never deliver anything truly innovative. While you and your competitors are busy fighting over fractions of a market-share point, someone else who doesn&apos;t care will come in and build a new platform that completely changes the game.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;In general I think there&apos;s a tendency for people to think about the things that exist. Our job is to think of the thing you haven&apos;t though of yet that you really need.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;As Nietzche wrote in &amp;quot;Thus Spake Zarathustra&amp;quot;: &amp;quot;You must be proud of your enemy; then your enemy&apos;s successes are also your successes.&amp;quot; Be proud of your competitors. Just don&apos;t follow them.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;&lt;em&gt;Talent&lt;/em&gt;&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Hiring is the most important thing you do.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;We want to hire the best minds available, because we believe there is a big difference between people who are great and those who are good, and we will do everything we can to separate the two.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;A workforce of great people not only does great work, it attracts more great people. The best workers are like a herd: They tend to follow each other. Get a few of them, and you&apos;re guaranteed that a bunch more will follow.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Favoring specialization over intelligence is exactly wrong, especially in high tech.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;When considering candidates for a role, favor the ones with a track record of learning new things over the ones with a track record in that particular role.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/how-google-works/hire-learning-animals.jpg&quot; alt=&quot;Hire learning animals&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Hire learning animals. (Illustration in the book)&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;blockquote&gt;
&lt;p&gt;In a peer-based hiring process, the emphasis is on people, not organization. The smart creatives matter more than the role; the company matters more than the manager.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;The urgency of the role isn&apos;t sufficiently important to compromise quality in hiring. In the inevitable showdown between speed and quality, quality must prevail.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;We would rather our hiring process generate more false negatives (people we should have hired but didn&apos;t) than false positives (we shouldn&apos;t have hired, but did).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Hire them not for the knowledge they possess, but for the things they don&apos;t yet know.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;If you think your abilities are fixed, you&apos;ll set for yourself what she calls &amp;quot;performance goals&amp;quot; to maintain that self-image, but if you have a growth mindset, you&apos;ll set &amp;quot;learning goals&amp;quot; - goals that&apos;ll drive you to take risks without worrying so much about how, for example, a dumb question or a wrong answer will make you look. You won&apos;t care because you&apos;re a learning animal, and in the long run you&apos;ll learn more and scale greater heights.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;About passion:&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;Passionate people don&apos;t wear their passion on their sleeves; they have it in their hearts. They live it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;If someone is truly passionate about something, they&apos;ll do it for a long time even if they aren&apos;t at first successful. Failure is often part of the deal.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;About recruitment:&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;Recruiting is everyone&apos;s job.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Recruiters can manage the process, but everyone should be recruited for recruiting.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;The interview is where you truly learn about a person - it is far more important than the résumé.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;About promotion:&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;Promotions have a company-wide impact, so they are too important to be left in the hands of individual managers.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;&lt;em&gt;Google&apos;s hiring dos and don&apos;ts&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;Hire people who are smarter and more knowledgeable than you are.&lt;br&gt;
Don&apos;t hire people you can&apos;t learn from or be challenged by.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Hire people who will add value to the product and our culture.&lt;br&gt;
Don&apos;t hire people who won&apos;t contribute well to both.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Hire people who will get things done.&lt;br&gt;
Don&apos;t hire people who just think about problems.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Hire people who are enthusiastic self-motivated, and passionate.&lt;br&gt;
Don&apos;t hire people who just want a job.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Hire people who inspire and work well with others.&lt;br&gt;
Don&apos;t hire people who prefer to work alone.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Hire people who will grow with your team and with the company.&lt;br&gt;
Don&apos;t hire people will narrow skill sets or interests.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Hire people who are well rounded, with unique interests and talents.&lt;br&gt;
Don&apos;t hire people who only live to work.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Hire people who are ethical and who communicate openly.&lt;br&gt;
Don&apos;t hire people who are political or manipulative.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Hire only when you&apos;ve found a great candidate.&lt;br&gt;
Don&apos;t settle for anything else.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;&lt;em&gt;Decisions&lt;/em&gt;&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;The process by which you reach the decision, the timing of when you reach it, and the way it is implemented are just as important as the decision itself.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;We don&apos;t seek to convince bay saying &amp;quot;I think.&amp;quot; We convince bay saying &amp;quot;Let me show you.&amp;quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/how-google-works/decide-with-data.jpg&quot; alt=&quot;Decide with data&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Decide with data. (Illustration in the book)&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;blockquote&gt;
&lt;p&gt;Most conference room at Google have two projectors. One of them is for videoconferencing with other offices or for projecting meeting notes. The other is for data.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Slides should not be used to run a meeting or argue a point. They should just contain the data, so that everyone has the same facts. If the data is wrong or not relevant, you can&apos;t fix it with fancy slides.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;The right decision is the best decision, not the lowest common denominator decision upon which everyone agrees. And it&apos;s not always your solution.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;About consensus and dissent:&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;To achieve true consensus, you need dissent.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;If everyone is thinking alike, then somebody isn&apos;t thinking.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;The job is to make sure everyone&apos;s voice is heard, regardless of their functional role.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;If someone truly have nothing to say, in which case maybe they shouldn&apos;t be at the meeting in the first place.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Do your best to surface all potential dissent early in the process; there is a natural (and valid) bias toward rejecting dissent the later it surfaces in the decision-making process.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Ensure that everyone who was involved does one of two things: disagree but commit, or escalate publicly.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;About meeting:&lt;/h4&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Meeting should have a single decision-maker/owner.&lt;/li&gt;
&lt;li&gt;Even if a meeting is not a decision-making meeting - for example it&apos;s designed to share information or brainstorm solutions - it should have a clear owner.&lt;/li&gt;
&lt;li&gt;The decision-maker should be hands on. He or she should call the meeting, ensure that the content is good, set the objectives, determine the participants, and share the agenda (if possible) at least twenty-four hours in advance. After the meeting, the decision-make (and no one else) should summarize decisions taken and action items by email to at least every participant - as well as any others who need to know - within forty-eight hours.&lt;/li&gt;
&lt;li&gt;Meetings should be easy to kill.&lt;/li&gt;
&lt;li&gt;Meetings should be manageable in size. No more than eight people, ten at stretch. Everyone in the room should be able to give their input. If more people need to know the result of the meeting, make sure you have a process for communicating it rather than bringing them in as observers, which lowers the quality of the meeting and people&apos;s ability to talk openly.&lt;/li&gt;
&lt;li&gt;Attendance at the meeting is not a badge of importance. If you aren&apos;t needed, leave, or better yet, excuse yourself ahead of time. Fewer people is almost always better.&lt;/li&gt;
&lt;li&gt;Timekeeping matters. Begin meetings on time. End them on time. Leave enough time at the end to summarize findings and action items.&lt;/li&gt;
&lt;li&gt;If you attend a meeting, attend the meeting. Multitasking doesn&apos;t work. If you are in a meeting and using your laptop or phone for something not related to the meeting, it&apos;s obvious your time is better spent elsewhere. Everyone attending a meeting should focus on the meeting, not other work. And if people have so many meetings that they can&apos;t got work done, then there is a simple solution: Prioritize and go to fewer meetings.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;When you are considering something that is fundamental to the existence of the company, you should meet everyday.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;About action:&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;If you&apos;re not sure if a course of action is right, the best thing you can do is try it out and then correct course.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Exhibit to bias for action, to cut off debate and analysis that is no longer valuable, and start moving the team to rally around the decision. But don&apos;t be a slave to a sense of urgency. Maintain flexibility until the last possible moment.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;&lt;em&gt;Communications&lt;/em&gt;&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Default to open.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/how-google-works/default-to-open.jpg&quot; alt=&quot;Default to open&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Default to open. (Illustration in the book)&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;blockquote&gt;
&lt;p&gt;A parsimonious approach to spreading information may have been successful when people were hired to work, in the Internet Century you hire people to think.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;We trust our employees with all sorts of vital information, and they honor that trust.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;No matter what a person&apos;s job is, they should be encouraged to have opinions about the business, industry, customers and partners, and different cultures.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;&lt;em&gt;It must be safe to tell the truth&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;Good news will be just as good tomorrow, but bad news will be worse. That&apos;s why you must make it safe to ask the tough questions and to tell the truth at all times, even when the truth hurts.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;&lt;em&gt;Know the details&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;If someone is in charge of a business and can&apos;t rattle off the key issues she faces in a matter of ten seconds, then she&apos;s not up to the job. A hands-off approach to leadership doesn&apos;t cut it anymore. You need to know the details.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;&lt;em&gt;Review yourself&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;Make sure you would work for yourself. If you are so bad as a manager that you as a worker would hate working for you, then you have some work to do. The best tool we have found for this is the self-review: At least once per year, write a review of your own performance, then read it and see if you would work for you. And then, share it with the people who do in fact work for you.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;Others&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;It&apos;s easier to summarize something in black and white vs in shades of gray.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;To be a thought leader, you have to have a thought.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;When you start a new position, for the first three weeks don&apos;t do anything. Listen to people, understand their issues and priorities, get to know and care about them, and earn their trust. So in fact, you are doing something: You are establishing a healthy relationship.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;&lt;em&gt;Email wisdom&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Respond quickly.&lt;/li&gt;
&lt;li&gt;When writing an email, every word matters, and useless prose doesn&apos;t. Be crisp in your delivery.&lt;/li&gt;
&lt;li&gt;Clean out your inbox constantly.&lt;/li&gt;
&lt;li&gt;Handle email in LIFO order (Last In First Out). Sometimes the older stuff gets taken care of by someone else.&lt;/li&gt;
&lt;li&gt;When you get a note with useful information, consider who else would find it useful.&lt;/li&gt;
&lt;li&gt;When you use the bcc (blind copy) feature, ask yourself why.&lt;/li&gt;
&lt;li&gt;Don&apos;t yell. If you need to yell, do it in person. It is FAR TOO EASY to do it electronically.&lt;/li&gt;
&lt;li&gt;Make it easy to follow up on requests.&lt;/li&gt;
&lt;li&gt;Help your future self search for stuff.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;h3&gt;&lt;em&gt;Innovation&lt;/em&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;em&gt;What is innovation?&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;Innovation: It&apos;s the next big thing.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;For something to be innovative it needs to offer new functionality, but it also has to be surprising. If your customers are asking for it, you aren&apos;t being innovative when you give them what they want; you are just being responsive. That&apos;s a good thing, but it&apos;s not innovative.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Think 10X, not 10%. Global scale is available to just about everyone. But too many people are stuck in the old, limited mindset.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/how-google-works/think-big.jpg&quot; alt=&quot;Think 10X, not 10 percent&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Think 10X, not 10 percent. (Illustration in the book)&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;blockquote&gt;
&lt;p&gt;Perhaps it&apos;s human nature, or just corporate nature, but most people tend to think incrementally rather than transformationally or galactically.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;We aren&apos;t trying to improve on an existing way of doing something, rather we want to start over.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;About building product&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;New ideas are never perfect right out of the chute, and you don&apos;t have time to wait until they get there. Create a product, ship it, see how it does, design and implement improvements, and push it back out. Ship and iterate. The companies that are the fastest at this process will win.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Iterate very quickly and to establish metrics that help you judge if, with each iteration, you are getting closer to success.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;&lt;em&gt;Focus on the user...&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;User trust is just as important as dollars, euros, pounds, yen, or any other currency. Product excellence is the only way for a company to be consistently successful, so our prime directive when it comes to product strategy is to focus on the user.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Users are more empowered than ever, and won&apos;t tolerate crummy products.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;We will always do what&apos;s right for the user, and we trust that our smart creatives will figure out how to make money from it. It could take a while, so sticking it out requires a lot of confidence.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;About limitations&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;When you want to spur innovation, the worst thing you can do is overfund it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;The human race built most nobly when limitations were greatest.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;About people&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;Innovative people do not need to be told to do it, they need to be allowed to do it. In other words, innovation has to evolve organically.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;If you want to hire great people and have them stay working for you, you have to let them make a lot of decisions, and you have to be run by ideas, not hierarchy. The best ideas have to win, otherwise good people don&apos;t stay.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;&lt;em&gt;Fail well&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;Any failed project should yield valuable technical, user, and market insights that can help inform the next effort.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;It’s very hard to completely fail when you think big, since you can always salvage something of value from a project with big goals.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;It helps to see failure as a road and not a wall.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Good judgment comes from experience; experience comes from bad judgment.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Management&apos;s job is not to mitigate risks or prevent failures, but to create an environment resilient enough to take on those risks and tolerate the inevitable missteps.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Some things benefit from shocks; they thrive and grow when exposed to volatility, randomness, disorder, and stressors and love adventure, risk, and uncertainty.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;&lt;em&gt;Conclusion&lt;/em&gt;&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Imagine the unimaginable.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Most companies fail because they get too comfortable doing what they have always done, making only incremental changes. And that is especially fatal today, when technology-driven change is rampant. So the question to ask isn&apos;t what will be true, but what could be true.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Any company that wants to build a new venture needs to ask itself the question: Do I go to the smart creatives, or find a way to get them to come to me?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;&lt;em&gt;Big problems are information problems&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;With enough data and the ability to crunch it, virtually any challenge facing humanity today can be solved.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Infinite data and infinite computing power create an amazing playground for the world&apos;s smart creatives to solve big problems.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;&lt;em&gt;The role of government&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;If data empirically show that a new way of doing things is better than the old way, then the role of government isn&apos;t to prevent change but to allow the disruption to occur.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;&lt;em&gt;The next smart creative&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;Given that no business wins forever, it is inevitable.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/how-google-works/the-next-smart-creative.jpg&quot; alt=&quot;The next smart creative&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;The next smart creative. (Illustration in the book)&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2&gt;50 Ideas &lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;/h2&gt;
&lt;p&gt;Just summary the highlights:&lt;/p&gt;
&lt;h4&gt;&lt;em&gt;What’s different now?&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Three converging technology platforms - Internet, mobile, and cloud - are transforming virtually every business sector.&lt;/li&gt;
&lt;li&gt;This transformation is happening at an unprecedented speed, and it is accelerating.&lt;/li&gt;
&lt;li&gt;The tools of innovation have been democratized.&lt;/li&gt;
&lt;li&gt;The balance of power has shifted from companies to customers, and expectations are skyrocketing.&lt;/li&gt;
&lt;li&gt;Individuals and small teams can have a huge impact.&lt;/li&gt;
&lt;li&gt;Product people are more valuable than business people.&lt;/li&gt;
&lt;li&gt;Most companies today are designed and run to minimize risk, not maximize speed.&lt;/li&gt;
&lt;li&gt;The only way for businesses to consistently succeed is to attract the best smart creatives and create an environment where they can thrive at scale.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;h4&gt;&lt;em&gt;Company culture&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Define your culture early.&lt;/li&gt;
&lt;li&gt;Build around small teams.&lt;/li&gt;
&lt;li&gt;Keep them crowded.&lt;/li&gt;
&lt;li&gt;Working from home kills innovation.&lt;/li&gt;
&lt;li&gt;Listen to the best ideas, not the hippos. (A hippo is the highest paid person’s opinion)&lt;/li&gt;
&lt;li&gt;Organize the company around the people whose impact is the highest.&lt;/li&gt;
&lt;li&gt;Do all re-orgs in a day.&lt;/li&gt;
&lt;li&gt;Exile knaves but fight for divas.&lt;/li&gt;
&lt;li&gt;Overwork people in a good way.&lt;/li&gt;
&lt;li&gt;Cultivate fun, even if (especially if) it comes at management’s expense.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;h4&gt;&lt;em&gt;Smart strategy, built for long-term success&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Businesses should be built on a strong set of strategic principles, not an MBA-style plan.&lt;/li&gt;
&lt;li&gt;Superior products start with unique technical insights.&lt;/li&gt;
&lt;li&gt;Optimize for growth.&lt;/li&gt;
&lt;li&gt;Know your competition, but don&apos;t copy it.&lt;/li&gt;
&lt;li&gt;Ask the hardest questions.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;h4&gt;&lt;em&gt;Hiring&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Hiring is the most important thing you do.&lt;/li&gt;
&lt;li&gt;Interviewing is the most important skill you can develop.&lt;/li&gt;
&lt;li&gt;Hire learning animals, not specialists.&lt;/li&gt;
&lt;li&gt;Check your biases at the door.&lt;/li&gt;
&lt;li&gt;Make hiring and promotion decisions by committee, based on data.&lt;/li&gt;
&lt;li&gt;Reward top performers disproportionately.&lt;/li&gt;
&lt;li&gt;Force the best people to rotate.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;h4&gt;&lt;em&gt;Making decision&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Consensus isn&apos;t about getting everyone to agree; it’s about making the best decision for the company and getting everyone to rally about it.&lt;/li&gt;
&lt;li&gt;Make all decisions with data.&lt;/li&gt;
&lt;li&gt;For the most important decisions, meet every day.&lt;/li&gt;
&lt;li&gt;You’re both right.&lt;/li&gt;
&lt;li&gt;Every meeting needs an owner.&lt;/li&gt;
&lt;li&gt;Everyone needs a coach.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;h4&gt;&lt;em&gt;Communication&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Default to open.&lt;/li&gt;
&lt;li&gt;Be an effective router.&lt;/li&gt;
&lt;li&gt;Start conversations. A leader’s job isn&apos;t to hoard information, it is to route it as quickly and efficiently as possible.&lt;/li&gt;
&lt;li&gt;Repetition doesn&apos;t spoil the prayer. When in doubt, over-communicate.&lt;/li&gt;
&lt;li&gt;Value relationships over process and hierarchy.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;h4&gt;&lt;em&gt;Innovation&lt;/em&gt;&lt;/h4&gt;
&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;The CEO should be the CIO (Chief Innovation Officer). The CIO position usually fails because it doesn&apos;t have enough power to create an innovative culture and environment. The CEO is the only person with this power.&lt;/li&gt;
&lt;li&gt;Think 10X, not 10%.&lt;/li&gt;
&lt;li&gt;Empower smart creatives over managers.&lt;/li&gt;
&lt;li&gt;Set unattainable goals and share them widely.&lt;/li&gt;
&lt;li&gt;Optimize for speed.&lt;/li&gt;
&lt;li&gt;Fail well.&lt;/li&gt;
&lt;li&gt;Imagine the unimaginable.&lt;/li&gt;
&lt;li&gt;We are technology optimists.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Related articles&lt;/h2&gt;
&lt;h3&gt;2004 Founders’ IPO Letter &lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Google is not a conventional company.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;About public ownership&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;The standard structure of public ownership may jeopardize the independence and focused objectivity that have been most important in Google’s past success and that we consider most fundamental for its future.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;As a private company, we have concentrated on the long term, and this has served us well. As a public company, we will do the same.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;In the transition to public ownership, we have set up a corporate structure that will make it harder for outside parties to take over or influence Google. This structure will also make it easier for our management team to follow the long term, innovative approach emphasized earlier.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;New investors will fully share in Google’s long term economic future but will have little ability to influence its strategic decisions through their voting rights.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;About short and long term&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;Our goal is to develop services that significantly improve the lives of as many people as possible. In pursuing this goal, we may do things that we believe have a positive impact on the world, even if the near term financial returns are not obvious.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;If opportunities arise that might cause us to sacrifice short term results but are in the best long term interest of our shareholders, we will take those opportunities.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;We will not shy away from high-risk, high-reward projects because of short term earnings pressure.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;We will optimize for the long term rather than trying to produce smooth earnings for each quarter.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;A management team distracted by a series of short term targets is as pointless as a dieter stepping on a scale every half hour.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Serving our end users is at the heart of what we do and remains our number one priority.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;Google&apos;s Larry Page on why moon shots matter &lt;sup&gt;&lt;a href=&quot;#references&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;Thousand-percent improvement requires rethinking problems entirely, exploring the edges of what&apos;s technically possible, and having a lot more fun in the process.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;If you&apos;re not doing some things that are crazy, then you&apos;re doing the wrong things.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;There are all these opportunities to make people’s lives better. Tech companies are attacking 1 percent of them. That leaves 99 percent virgin territory.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;References&lt;/h2&gt;
&lt;p&gt;I highly recommend that you read these articles in detail. There are great information in them related to the book.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.google.com/document/d/1nj-M-caLlOXbkwZW9FIz7guOr-jr2YX5Jn3c4o_y-eM/preview&quot;&gt;How Google Works: 50 Ideas&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://abc.xyz/investor/founders-letters/2004/ipo-letter.html&quot;&gt;2004 Founders&apos; IPO Letter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.wired.com/2013/01/ff-qa-larry-page/&quot;&gt;Google&apos;s Larry Page on why moon shots matter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.berkshirehathaway.com/ownman.pdf&quot;&gt;An Owner&apos;s Manual by Warren E. Buffett&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.howgoogleworks.net/&quot;&gt;howgoogleworks.net&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
</content:encoded></item><item><title>Sapiens by Harari - Enlightened and interesting viewpoint about history</title><link>https://vnqthai.com/post/sapiens/</link><guid isPermaLink="true">https://vnqthai.com/post/sapiens/</guid><description>This book discusses our history, starts from when we were living in jungles to present and predicts about our future. On that way, it states some thoughts about our planet including other species living alongside us.</description><pubDate>Tue, 22 Jan 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Sapiens by Harari draws a big and beautiful picture about our history. It tells us how small and powerless we are as individuals by the flow of time.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/sapiens-1.jpg&quot; alt=&quot;Sapiens - A Brief History of Humankind book&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Sapiens - A Brief History of Humankind, by Yuval Noah Harari. Image source: James Clear&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2&gt;Advancement&lt;/h2&gt;
&lt;p&gt;This book states a new and open view about our agricultural revolution. It discusses benefits of individuals and species. Sometimes, advantage of individuals does not mean advantage of species, and vice versa. Seeking for early advantages seems first beneficial. But after a long time (years or decades for individuals, many generations for species), those advantages would become huge disadvantages. Traps were activated, situation was accepted. There was no way to come back. That was a comfortable, easy-going and dangerous trap.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/agricultural-revolution-1.jpg&quot; alt=&quot;Agricultural revolution, the biggest trap in history&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Agricultural revolution, the biggest trap in history. Image source: Stravaganza&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3&gt;Lesson learned&lt;/h3&gt;
&lt;p&gt;Before starting an improvement, as you may it is beneficial, try to think in long term. Whether it still be beneficial after many improvement round or not, or it will change into other forms? Usually re-evaluate first approach and solution, alter it, update it, look back, look forward. Never accept situation as it is. In many cases, acceptance of current situation, procrastination and lack of re-evaluation led to disasters. With a rational mind, we human should carefully think about easy movements in long term, for avoiding paying a huge price in the future.&lt;/p&gt;
&lt;h2&gt;Organization&lt;/h2&gt;
&lt;p&gt;All humans have the same origin. Nation and ethnicity difference are just imaginations. There are many things that only exist in our mind: human right, law, company and money. Their roles are to make large groups of people pursuing common targets, instead of fighting each other. Need to note that in some cases, such &amp;quot;common&amp;quot; target is not for majority of people, but only benefit a small elite, minority group. Humans are different from other animals that we can form and organize in large communities. After millenniums, we have religion, culture, governments and banks. What make us stronger and evolve is the ability to live, work and support each other.&lt;/p&gt;
&lt;h3&gt;Myths&lt;/h3&gt;
&lt;p&gt;There are some myths - which I mean &lt;em&gt;unreal&lt;/em&gt; - should not publicly confirm or deny, even though you may know the truth. Keeping them secret and lie to the public would more beneficial for all of us. Religions, human rights and law are some of which Harari stated.&lt;/p&gt;
&lt;p&gt;Our society is built on beliefs: God, honor, nation. People are persuaded to believe that rules come from these sources, not from other people. The purpose is quite clear: to make majority of people fit into structured societies. This method applied in many aspects of life: education, media, news, and lifestyle. The common belief method was made to secure and maintain society orders. In turn, these society orders enforce and consolidate its people&apos;s mind.&lt;/p&gt;
&lt;p&gt;A &amp;quot;real&amp;quot; natural rule (for example: gravity) never collapses. But an &amp;quot;imagined&amp;quot; natural rule (for example: social orders) is more vulnerable and easier to be replaced. People fight each other for these &amp;quot;imagined&amp;quot; rules, and discuss in peace the &amp;quot;real&amp;quot; ones.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There is no God, but don&apos;t tell that to my servant, lest he murder me at night. - Voltaire&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/nietzsche-vs-god-1.jpg&quot; alt=&quot;God is dead - Nietzsche, 1883. Nietzsche is dead - God, 1900&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Image source: Fewer Lacunae&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h3&gt;Myths in economics&lt;/h3&gt;
&lt;p&gt;This idea also applies in economics. Merchandisers make you think in the way that most benefit them, not you. They use advertisement, social media and marketing tools to do this. What you think may come from someone&apos;s mind and for their interest. Not only that, they also tried and succeeded making you think that you though from inside yourself. They made you think that you are the supreme controller of your mind, your decision and your life. But you aren&apos;t. They create societies that most financial benefit them. Societies that buy the most products and services from them; and give them not only money, but also labor, page view and personal data.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/eat-at-subway.png&quot; alt=&quot;Sex!! Now that we have your attention. Eat at Subway&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Image source: Pinterest&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2&gt;Benefit-oriented&lt;/h2&gt;
&lt;p&gt;Our belief is for satisfying our needs and making us feel comfortable. We believe in things that we want to believe and can get benefit from. We do not believe in things just because of the way they are.&lt;/p&gt;
&lt;p&gt;There is a close relation between politics and economy. Between government, army, war, revolution and capital, money, job, food. People start a revolution or declare war when their government or companies (or both) do not satisfy their needs, or touch their money/food. People choose peace not because ethics or they love peace. Nowadays, people choose peace because cost of war is high and profit of winning is low.&lt;/p&gt;
&lt;h2&gt;Contradiction&lt;/h2&gt;
&lt;p&gt;Freedom and equality are two accepted basic human rights. But not many people know that these two rights contradicts each other. Equality is guaranteed by reducing freedom of more successful people. While maximizing freedom of everybody will bring inequality to unlucky ones. Politics history from 1789 to present full of attempts to solve this problem. And it seems not solved yet.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/freedom-vs-equality-1.jpg&quot; alt=&quot;Freedom and equality can never coexist&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Image source: Flickr&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;However, contradictions have positive points. They are motivation of improvement and source of development. They encourage people to continue thinking, re-evaluating and criticizing. When something become stable, other questions will arise. A stable mind is the source of degeneration.&lt;/p&gt;
&lt;p&gt;If you want to understand a person or country, looking at and trying to understand their internal contradictions is a good way.&lt;/p&gt;
&lt;h2&gt;Unification&lt;/h2&gt;
&lt;p&gt;Human history is a flow of unifications and separations. But starting from industrial era, unification has become the mainstream direction. Using religions, politics, and money, countries are affecting each other more than ever before. A &amp;quot;pure&amp;quot; original civilization seems no longer exist. So is &amp;quot;definitely&amp;quot; independent country. Despite of many countries are claiming so. Nowadays, there is no way to eliminate these effects without an isolation and collapse.&lt;/p&gt;
</content:encoded></item><item><title>Notes from &quot;Hints for Computer System Design&quot; by Butler W. Lampson</title><link>https://vnqthai.com/post/hints-for-computer-system-design-butler-w-lampson/</link><guid isPermaLink="true">https://vnqthai.com/post/hints-for-computer-system-design-butler-w-lampson/</guid><description>Notes and learnings from this paper</description><pubDate>Wed, 14 Nov 2018 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt;&lt;/em&gt; &lt;em&gt;This post is a reflection of my mind after reading this paper, it is not a summary or review, and should not be used for reference. But for fun is ok. Besides what mentioned here, this paper has a lot of other wonderful ideas.&lt;/em&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;blockquote&gt;
&lt;p&gt;Designing a computer system is very different from designing an algorithm.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The overall idea that I get is &lt;strong&gt;&amp;quot;simplify&amp;quot;&lt;/strong&gt;. Simplicity ensures functionality and enhance performance.&lt;/p&gt;
&lt;p&gt;Defining scope of each sub-system and their interface are the most important - and most difficult - part of system design. Try to &lt;em&gt;keep it simple and minimal&lt;/em&gt;, and &lt;strong&gt;don&apos;t generalize&lt;/strong&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Each interface is a small programming language: it defines a set of objects and the operations that can be used to manipulate the objects.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The well-known &lt;a href=&quot;https://en.wikipedia.org/wiki/KISS_principle&quot;&gt;KISS principle&lt;/a&gt; (stands for Keep It Simple, Stupid) demonstrates this idea.&lt;/p&gt;
&lt;p&gt;A simple system is faster, more accurate, and has easier-to-predict behaviors comparing to a general one. Usually, general means slower. And users have to pay for extra cost, although they do not need those extra power. However, a fast and general solution is always the best, if you can find it.&lt;/p&gt;
&lt;p&gt;If complicated functionalities are needed, try to delegate to client. Your system should provide basic functions, with wide range of usage that user can create. Rather than trying to cover all the things by yourself and make your system heavy and slow, potentially introduce many bugs, and hard to maintain.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Do one thing at a time, and do it well.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;With hard problems, &lt;strong&gt;divide and conquer&lt;/strong&gt; maybe a good approach. Transform big problem into smaller and simpler ones. &lt;strong&gt;Handle normal and worst case separately&lt;/strong&gt; may save time, instead of solving them together (over-generalize). If a simple and general solution exists, choose it.&lt;/p&gt;
&lt;p&gt;If a straightforward, brute-force solution exists, and its speed is acceptable comparing to an optimized version, or input data is relatively small, use the brute-force one.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Besides of main idea of simplify, this paper also notice about safety. System designer should &lt;strong&gt;avoid choosing a terrible way, rather than finding an optimum&lt;/strong&gt;. They also need to have clear vision among sub-systems.&lt;/p&gt;
&lt;p&gt;It also gives some advises on improving &lt;em&gt;performance&lt;/em&gt;, some of them I feel interesting (the others I don&apos;t understand):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Caching&lt;/strong&gt;. Result of time-consuming operations should be cached. Be aware of cache invalidation.&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;hints&lt;/strong&gt;. Time can be saved, and calculation can be executed before it is clearly stated. Note that hints can be wrong, and should check against &amp;quot;truths&amp;quot;. But checking correctness in many cases are faster than finding answer. Hints can be found by:
&lt;ul&gt;
&lt;li&gt;Guessing&lt;/li&gt;
&lt;li&gt;Occurred events&lt;/li&gt;
&lt;li&gt;Statistical/historical data&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Compute heavy tasks in &lt;strong&gt;background&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Some ideas to enhance fault-tolerance of a system:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;appended logs&lt;/strong&gt;. Current state can be re-produced from a series of append-only modification logs. Logs should be well-formatted.&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;transactions&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Operations should be &lt;strong&gt;idempotent&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Examples are quite old (1970s, 1980s) and maybe unfamiliar with current computing. However, basic concepts live long.&lt;/p&gt;
</content:encoded></item><item><title>Plato and a Platypus Walk into a Bar: Funny, easy to catch philosophy ideas</title><link>https://vnqthai.com/post/plato-and-a-platypus-walk-into-a-bar/</link><guid isPermaLink="true">https://vnqthai.com/post/plato-and-a-platypus-walk-into-a-bar/</guid><description>If you want to explore philosophy for the first (or maybe second) time, this book is a good places to start.</description><pubDate>Thu, 17 May 2018 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;For Asian readers, those jokes may seem not culture-fit. They would be more relevant to Western society. I did not get the point of some jokes. But the good point is Asian readers can learn philosophy and Western culture at the same time. However, knowing some basic philosophy ideas before reading would be better than knowing nothing. If you do not know anything about philosophy before, I suggest &lt;a href=&quot;https://vnqthai.com/post/sophies-world&quot;&gt;Sophie’s World&lt;/a&gt;.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/plato-and-a-platypus-walk-into-a-bar.jpeg&quot; alt=&quot;Plato and a Platypus Walk into a Bar&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Plato and a Platypus Walk into a Bar. Source: Kobo.com&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;In the language perspective, we have different understanding while reading the same word in different languages. Our brain&apos;s reactions are not the same while reading a word in one language, to the translated version of that word in another one. While reading this book, I realized that language is an important part of philosophy studying. Wanting to know more about philosophy, I will need to proficient at academic English. Wanting to learn more about some philosophers, I will have to know German. Using Vietnamese for these purposes is easy for beginning steps. But to go further, I will face a wall which is hard to overcome. And language proficiency is the key to go to next taller walls.&lt;/p&gt;
</content:encoded></item><item><title>The Three-Body Problem - beautiful imagination about ourselves</title><link>https://vnqthai.com/post/the-the-body-problem/</link><guid isPermaLink="true">https://vnqthai.com/post/the-the-body-problem/</guid><description>This is a science-fiction book. In science perspective, it is about astronomy, physics and computer science. In sociology perspective, it is about history, humanity, and challenges of our modern society. You can also sense philosophy and theology.</description><pubDate>Mon, 14 May 2018 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;As material for story telling, this book uses Eastern and Western cultures. The story is thrilling, attractive from beginning to end.&lt;/p&gt;
&lt;p&gt;Via thoughts of some individuals, this book represents breaths of a country. Via breaths of countries, it represents a civilization. Via rise and fall of civilizations, it shines and guides human&apos;s thoughts. Human&apos;s thoughts then inherit and evolve, as individual and as a whole, to reform destiny of worlds.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/the-three-body-problem-1.jpg&quot; alt=&quot;The Three-Body Problem&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;The Three-Body Problem. Image source: Medium&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;There was questions in my mind: What we can learn from the past? What we can learn from the fallen and existing civilizations? What we can learn from our current situation? Based on what we learnt, is it possible to know what we should do? Let&apos;s put our thoughts above all things, above our existence, above the world that we are in. Then what we see and imagine can give us some helps, and then to our world.&lt;/p&gt;
&lt;p&gt;The Three-Body Problem strengthen love for science. It beautify the endless curiosity of seeking secrets. It shows painful parts of human being, from physical to psychological, from science to love and life. It looks back to the past and question about present. It looks to the universe and question about our existence. In the end, I believe it questions about our direction.&lt;/p&gt;
&lt;p&gt;The story tells that science is motivation of civilization evolution. The curiosity to try, fail and explore the planet we are living and the universe we are a part of, should be kept in our generation and transferred to all our descendants. People can die, civilizations can fall. But scientific and historical knowledge must be kept, then inherited, spread and evolved. If we stop our curious mind and pleased with what we knew, what we are, we will let ourselves corrupted and terminated, no need other forces coming here to destroy us.&lt;/p&gt;
&lt;p&gt;A must read for science(-fiction) lovers.&lt;/p&gt;
</content:encoded></item><item><title>Overview of blockchain and bitcoin</title><link>https://vnqthai.com/post/overview-of-blockchain-and-bitcoin/</link><guid isPermaLink="true">https://vnqthai.com/post/overview-of-blockchain-and-bitcoin/</guid><description>High-level understandings about blockchain technology and bitcoin, its most famous implementation.</description><pubDate>Thu, 04 Jan 2018 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Articles in this series use contents from many resources in the internet, whose roots are hard to trace. Majority of ideas are from secondary research.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;I also do not provide any financial information, such as which cryptocurrency to invest, when to buy or sell, or price prediction. I am only taking a look on technology and application viewpoint.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;First, let&apos;s start with what blockchain and bitcoin are.&lt;/p&gt;
&lt;h2&gt;What is it&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Blockchain is a technology&lt;/strong&gt;. It is proposed by an anonymous person/group named Satoshi Nakamoto.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Bitcoin is an application of blockchain&lt;/strong&gt;, among many others.&lt;/p&gt;
&lt;p&gt;Bitcoin&apos;s purpose is to improve current payment system. It is decentralized, persistence, anonymous, auditable...&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/overview-of-blockchain-and-bitcoin/payment-process-current-versus-bitcoin.png&quot; alt=&quot;Payment process: current vs bitcoin&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Payment process: current vs bitcoin&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;When using bitcoin, you do not need an intermediate organization to validate your account and transfer money. Everything is done inside itself. Bitcoin system is incorporated and self-operated by its participants. Everything is ready to work after you join.&lt;/p&gt;
&lt;p&gt;To achieve these goals, bitcoin has employed some techniques.&lt;/p&gt;
&lt;h2&gt;Architecture&lt;/h2&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/overview-of-blockchain-and-bitcoin/blockchains-stacked-architecture.png&quot; alt=&quot;Blockchain&apos;s stacked architecture&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Blockchain&apos;s stacked architecture&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;At the bottom of a blockchain architecture is blockchain. It acts like a data structure and works as a database. This database is stored in every full nodes in bitcoin system. On top of the blockchain is bitcoin protocol, which is &lt;a href=&quot;https://github.com/bitcoin/bitcoin&quot;&gt;bitcoin core project&lt;/a&gt;. With that protocol, coin (bitcoin, specifically) is created and transferred.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Difference between token and coin:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tokens&lt;/strong&gt; are used to bind physical to digital world. Token can bind money (in case of coin), a company&apos;s share, a physical product, a song, an idea... anything.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Coin&lt;/strong&gt; (any kind of it: bitcoin, ether, litecoin...) is a special token, which is used like money.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;On the top of bitcoin are applications like wallets, exchange platform, merchants accepting bitcoin... We usually interact with applications at this level while not interacting with lower stuffs.&lt;/p&gt;
&lt;p&gt;There are many other types of coin systems (altcoins), which also have similar architecture like bitcoin.&lt;/p&gt;
&lt;p&gt;Ethereum has another story, with different philosophy, design and algorithm. Ethereum is platform, Ether is cryptocurrency developed based on that platform. It has many useful application which I will research about.&lt;/p&gt;
&lt;p&gt;That is overall architecture. Let&apos;s go to detailed design of bitcoin.&lt;/p&gt;
&lt;h2&gt;Design&lt;/h2&gt;
&lt;h3&gt;Coin&lt;/h3&gt;
&lt;p&gt;Any digital currency must solve double spending problem.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Double spending&lt;/strong&gt; is when a digital currency is replicated and spent more than once.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;This problem becomes harder on a decentralized environment, without any central authority. To avoid it, every smallest piece of coins are traced from their creation, through every transaction, to recent status. Any coin is &lt;strong&gt;authenticated&lt;/strong&gt; before spending.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/overview-of-blockchain-and-bitcoin/coin-1.png&quot; alt=&quot;Coin flow&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Coin flow&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;After joining this flow, a coin have to be an output of a transaction before becoming input of another one. Total number of output is always less than or equal to number of input. Coin can just be transferred from transaction to transaction, cannot be validly replicated. Origin of every coins are traceable. Mining is the only way to create coins from nothing.&lt;/p&gt;
&lt;p&gt;In case there are many transactions using the same output, the first transaction with earliest timestamp will take effect, others will be discarded.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Many output&lt;/strong&gt; is when someone transfer money to more than one address.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Many input&lt;/strong&gt; is when amount required for a transaction is not enough and need to be gathered from many transactions, of the same source address.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Unspent transaction output (UTXO)&lt;/strong&gt; is output amount which is not spent in any transaction. In other words, that amount is not used as input of any transaction.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Transaction fee&lt;/strong&gt; is the difference between total input and total output. Which is paid to miners for validating a transaction.&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;Transaction&lt;/h3&gt;
&lt;p&gt;Every transaction includes sender address, receiver address, bitcoin amount (input-output), signature of sender, and other ton of things. They are chained together by input-output mechanism. Output of previous transaction is input of next one. If someone modifies amount of a transaction, he/she must modify all transactions subsequent to that one, every one of them. And must somehow make whole network accept that modification. This is theoretical impossible.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/overview-of-blockchain-and-bitcoin/bitcoin-transaction-1.png&quot; alt=&quot;Bitcoin transaction&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Bitcoin transaction&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Every address (address is a public key) has a private key to prove ownership of that address. Sender provides transaction with that private key to &lt;strong&gt;authorize&lt;/strong&gt; a transaction. This private key is used to sign information attached with transaction. If owner lost that private key, or it is stolen, everything stored in that address will be lost forever, non-refundable.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/overview-of-blockchain-and-bitcoin/authorized-coin-1.png&quot; alt=&quot;Signed data&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Signed data&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Not only addresses (public keys), and transfer amount, private key is used to sign many information related to transaction: previous transaction id, output index number, amount... If someone modify a transaction, he/she not only need to modify all subsequent transactions, but also need private key of everybody receiving that coin. Getting private key of that large amount of people, who is anonymous, is extremely hard, needs huge effort, and somehow impossible.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Coinbase transaction&lt;/strong&gt; is the first transaction in all blocks (transaction 0). It is the only place where bitcoins are created from nothing, as reward for validating transactions, putting them into blocks, and solving hard hashing problems. Coinbase transaction also includes fees of all transactions that are included in this block.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Rewarded bitcoins&lt;/strong&gt; starting from 50 bitcoins each block in 2009, halved every 4 years. This will limit total number of bitcoins to 21 millions.&lt;/p&gt;
&lt;hr&gt;
&lt;h3&gt;Block&lt;/h3&gt;
&lt;p&gt;Block is where transactions are grouped, sealed and stored. Transactions grouped together by a mechanism called Merkle tree. Computer will hash all transactions in a block, to find Merkle root. Merkle root hash is stored in block header.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/overview-of-blockchain-and-bitcoin/bitcoin-block-1.png&quot; alt=&quot;Transactions hashed in a Merkle tree&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Transactions hashed in a Merkle tree&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;If a transaction cannot find another one to form a pair, it is hashed with itself.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/overview-of-blockchain-and-bitcoin/bitcoin-merkle-hash-1.png&quot; alt=&quot;Hash transactions&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Hash transactions&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Merkle root&lt;/strong&gt; is the final hash, after hashing every transactions in a block.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;To save storage, some blocks may not store all transactions, but keep only intermediate hashed results. Reducing storage by skipping transactions like this will decrease security of whole system. Because these lightweight node cannot verify transactions and therefore vulnerable to attacks.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/overview-of-blockchain-and-bitcoin/bitcoin-block-2.png&quot; alt=&quot;After pruning transactions 0-2 from block&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;After pruning transactions 0-2 from block&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;If any transaction in block is altered, Merkel root must be updated. If Merkle root of a block is updated, that block&apos;s data is updated. Hence that block must be re-hashed, which process we call proof-of-work.&lt;/p&gt;
&lt;h3&gt;Proof-of-work&lt;/h3&gt;
&lt;p&gt;After having all required data to store in block header, block is ready for calculating block hash.&lt;/p&gt;
&lt;p&gt;Calculating block hash from block header data is super easy, a regular computer can finish that job in less than one second. What if everybody can easily rewrite blockchain, modify some blocks, insert invalid transactions, then say that the modified version is the valid one? Process of calculating block hash must be harder, cost huge amount of compute power, which will make brute force attack longer and more costly.&lt;/p&gt;
&lt;p&gt;The method used is &lt;strong&gt;target threshold&lt;/strong&gt;. Calculated block hash must be below a pre-defined threshold. This make block hash starts with some zeros. If you look into a block in bitcoin blockchain, you can see block hashes like this:&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/overview-of-blockchain-and-bitcoin/bitcoin-block-hashes-1.png&quot; alt=&quot;Block hashes&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Block hashes&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The hashing process is one-way. Nobody can find original data from hashed result. &lt;em&gt;The only way to check whether one piece of data will hash to a specific string is do hashing&lt;/em&gt;. This is brute force. Because data in block header have already specified, one way to hash to some specific string (which are below target threshold), is adding a piece of data. That piece of data is called &lt;strong&gt;nonce&lt;/strong&gt;:&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/overview-of-blockchain-and-bitcoin/bitcoin-nonce-1.png&quot; alt=&quot;Nonce as proof-of-work&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Nonce as proof-of-work&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;When changing nonce, block header data is changed, hash result will change. The process is: Add a nonce to block data -&amp;gt; hash block -&amp;gt; check if hash result is below target threshold. If so, notify network that a new block is found and built. Otherwise, try a new nonce. Repeat until finding one valid hash result, or get notification from another computer that they found before you.&lt;/p&gt;
&lt;p&gt;Block generating and hash calculating is controlled to be about 10 minutes each block. But sometimes computers in network can do that faster or slower. After every 2016 blocks (about 2 weeks), difficulty (target threshold) is adjusted up to 300% harder if the last 2016 blocks are generated faster than 2 weeks; or adjusted down to 75% easier if they are generated longer than 2 weeks. This make proof-of-work always hard enough despite of total compute power. So nobody can invest into power and gain control of bitcoin system.&lt;/p&gt;
&lt;h3&gt;Chain&lt;/h3&gt;
&lt;p&gt;After calculating block hash as proof-of-work, blocks are chained together. Every blocks (except the first one) stores previous block&apos;s hash in its header. If any transaction or block is changed, every subsequent blocks must be changed, too. So whole costly proof-of-work hashing process of every dependent blocks must be re-done. This mechanism strengthen blockchain and reinforce confirmation of transactions. If someone want to change a transaction, that person must rewrite blockchain from the block holding that transaction, and must do all hashing process faster than whole honest network combined, to form a longer chain. This is considered extremely hard if attacker does not have majority (51%) compute power.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/overview-of-blockchain-and-bitcoin/bitcoin-chain-1.png&quot; alt=&quot;Chain of blocks&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Chain of blocks&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Number of confirmations&lt;/strong&gt; is number of blocks after a transaction. The more confirmation, the more secure that transaction is. With small transactions like buying coffee, merchant only require 1 confirmation after bitcoin is transferred, to make it fast and convenience. But with larger transactions like buying a phone, merchant may ask for 6 confirmations. More confirmations, harder to rewrite blockchain and undo bitcoin transfer.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Blockchain will collapse if someone or group control 51% compute power of whole system. With that compute power, that person/group can rewrite blockchain data and insert any transaction that benefit themselves, so damage the society.&lt;/p&gt;
&lt;h3&gt;Consensus rule&lt;/h3&gt;
&lt;p&gt;What if there are many chains coexist at one time? (This usually happens)&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Consensus rule&lt;/strong&gt;: the longest chain is the honest one.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;If someone want to cheat system, that person must produce a valid (proof-of-work) chain longer than the chain that all honest people are creating, at faster speed. To do so, that person must control 51% computing power. This is called 51% attack. Currently, there is no computer system (including governments) has such computing power.&lt;/p&gt;
&lt;p&gt;But we also need to know that the 5 largest mining organizations own more than 75% of total mining capacity; and 58% of hashing power is from China. Therefore, bitcoin mining pools are monitored closely by community.&lt;/p&gt;
&lt;p&gt;Bitcoin system is created to be more profit when honestly generating blocks than cheating. Generating blocks earns bitcoin rewards, which is better than use compute power to start a race with all honest computers. But in the future, when bitcoin reward decreases (halved every 4 years), or bitcoin to USD price decreases, while number of miners are huge, then nobody can guarantee kindness will win.&lt;/p&gt;
&lt;p&gt;Because of those design principals, number of transactions growth and bitcoin price booming, bitcoin system has just uncovered a lot of limitations.&lt;/p&gt;
&lt;h2&gt;Limitations&lt;/h2&gt;
&lt;h3&gt;1. Time&lt;/h3&gt;
&lt;p&gt;Bitcoin blocks size are limited to 1MB. This rule limits number of transactions can be stored in each block. Blocks are added to blockchain every 10 minutes. So this allows only 7 transactions added to bitcoin blockchain every second.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/overview-of-blockchain-and-bitcoin/bitcoin-speed-1.png&quot; alt=&quot;Number of bitcoin transactions per second, compared to Visa&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Number of bitcoin transactions per second, compared to Visa&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;But that&apos;s not the only story about speed. Some transactions, like transfer bitcoin for buying a phone, requires 6 confirmations to be valid. 6 confirmations requirement means that after transaction is added to a block, confirmed, broadcasted to network, there must be at least 6 subsequent blocks added to blockchain after that block. This requirement restricts possibility that an attacker can change transaction after receiving product. The more confirmations, the more secure (hard to alter) transaction is. Now maybe you see the problem. To get that kind of transaction trustworthy confirmed, buyer must wait at least 60 minutes to buy a phone. But that is the happiest case. When bitcoin price is increasing, if transaction fee buyer added to transaction is not attractive enough, miners would not add that transaction into blocks soon. Then waiting days for the first confirmation is usual. Transferring money, then pay high fee or wait for some days? What do you choose? That maybe not convenience enough for any financing system.&lt;/p&gt;
&lt;p&gt;There were some tries to increase block size. The most famous one is Bitcoin Cash, which increased block size from 1MB to 8MB. That was a hard fork. But increasing block size also increase delay in block broadcasting. That&apos;s why bitcoin developer team did not agree with the 8MB proposal. Increasing block size can improve transaction handling speed (more transactions stored in blocks), but slow down block broadcasting, leading to multiple branches existing in blockchain at every moment. Then take time to correct, waste many blocks in not-longest chains. Increasing block size is a tradeoff.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Hard fork&lt;/strong&gt; is is a method for developers to update bitcoin’s software.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Decreasing difficulty of hashing algorithm may increase hashing (in other words: mining, validation, confirmation) speed, but will decrease system&apos;s security.&lt;/p&gt;
&lt;p&gt;When bitcoin price is increasing nowadays (20 times from beginning of the year), 1MB every 10 minutes is not enough for storing huge amount of transactions. That’s why bitcoin transfers are taking too much time, and expensive.&lt;/p&gt;
&lt;h3&gt;2. Cost&lt;/h3&gt;
&lt;p&gt;For those 7 transactions/second, bitcoin is already estimated to use 35 times as much energy as Visa. If you brought bitcoin’s transaction volume up to Visa’s it would be using as much electricity as the rest of the world put together. Because bitcoin system consumes tremendous compute power, billion dollars of electricity and network bandwidth, storage capacity, it becomes not as cheap as planned. Miners want to make their money payback and profitable, in the form of transaction fee (while rewarding bitcoin is halving every 4 years and only equal to 1/4 of the first days). So mining investors are always attracted by high-fee transactions.&lt;/p&gt;
&lt;p&gt;Let&apos;s look back to the first far days, when transactions only cost a small portion, some percents of a bitcoin. But recently, that &amp;quot;small portion&amp;quot; worth about $20 to $50. Which has not cheap anymore. If I want to transfer a small amount of bitcoin, which worth about $2 to my friend, and do not accept to pay tens of dollars for fee, my transaction would wait for days in prioritized-by-fee queue to be confirmed. My friend has no way to receive that money until that transaction is confirmed, 2 days later.&lt;/p&gt;
&lt;p&gt;More people are joining, more transactions are generated. Along with increment of bitcoin price, transaction processing time and cost are increasing too. This makes people harder to do normal financing activities. This is a paradox.&lt;/p&gt;
&lt;h3&gt;3. Privacy&lt;/h3&gt;
&lt;p&gt;Bitcoin originally promotes privacy, since it is not possible to know who is behind an address by just reading it. But blockchain system is &lt;strong&gt;not transactional private&lt;/strong&gt;. Values of all transactions and balances are publicly visible. Give anyone an address, he/she can get all transaction in and out of that address from the beginning of time, and that address&apos;s balance. If I transferred bitcoin to a friend, then I know his bitcoin address, so I can see all his transactions, and his balance. Solution for this problem is using one-off addresses. But it is not easy for normal people to use such an annoying method. Because lastly, all your coins should me transferred to some few addresses. It does not make sense if today I have 1000 addresses, next year I will have 5000 ones.&lt;/p&gt;
&lt;p&gt;Another privacy leaking is user’s transactions can be linked to reveal user’s information. Your financial status can be linked to your identity. If you want to hide, you should hide your payments and income also. But bitcoin is not transactional private. So you should keep your address private (!), or one-off.&lt;/p&gt;
&lt;p&gt;Bitcoin employs peer-to-peer network, on top of the internet. Every communication in bitcoin system goes through the internet, which use IP addresses. And IP addresses are linked to real-world addresses, by Internet Service Provider. Knowing an IP, everybody can easily query for location of that IP. Knowing real-world address to personal identity is not a long way. So bitcoin users need to hide IP. How? Using Virtual Private Network, or Tor. I am thinking about teaching my non-tech girl friend using VPN...&lt;/p&gt;
&lt;p&gt;But in this real world, many  people are making transactions with the same address frequently. I know a lot of my friends, who are software engineers, using only 1 or 2 bitcoin addresses for trading online. After sending them some coins, I can query transaction history of their address, and I know how many money they are having. Asking people to use multiple bitcoin address is just like convincing them to change bank account after each activity. That does not make sense at all.&lt;/p&gt;
&lt;h3&gt;4. Security&lt;/h3&gt;
&lt;p&gt;Everybody must keep their private key(s) secret, as secure as ATM card PIN. If they lose those keys to bad people, they will lose all things protected by them. People are relying on single-point encryption, the  private keys,  rather than a more sophisticated mechanism that might involve.&lt;/p&gt;
&lt;p&gt;If people lost their house&apos;s door key, worthy properties in their house may gone away. But they can get money back by insurance. If people want to transfer a big amount of money to someone, they have to sign in some pieces of paper. If someone steal your money, they can be caught by police. These methods exists to keep people safe. These methods do not exist in bitcoin world. You have to protect yourself, with all risks acknowledged.&lt;/p&gt;
&lt;p&gt;Bitcoin private key is hard/impossible to remember. They are just sequence of meaningless characters like: &lt;em&gt;e9873d79c6d87dc0fb6a...&lt;/em&gt; Can you remember it? Mini private keys exist, but they do not help much. Not only impossible to remember, but another problem to private key is how to keep them secret, and able to find when needed. There are several ways: online, offline, printed copy... Online: you must trust the online service. Offline: save it in some hard drive, but must keep that computer virus-free and protect its login password. Printed copy: keeping it more secret than your house&apos;s key. Hence, bitcoin keys are harder to keep than physical keys. There are people who printed private key to paper, cut that paper into pieces and kept in multiple bank vaults.&lt;/p&gt;
&lt;p&gt;What if you have many one-off addresses (along with many private keys), one for each transaction? How to manage these addresses and private keys, keeping them all secret? This is where wallet software take place. But you have to put all your bitcoins into trust of the software. Not only the software, how about malware, virus, trojan, hardware failure... There were people whose bitcoin accounts drained because their email had been hacked and their password was stolen. They were stunned to have no recourse.&lt;/p&gt;
&lt;p&gt;If everybody have to do all above things to protect their anonymity and security, the usability of bitcoin would severely decrease.&lt;/p&gt;
&lt;h3&gt;5. Usability&lt;/h3&gt;
&lt;p&gt;Bitcoin is easy for people to use, but very hard for them to be protected. Best practice is a long list. Researchers are working on finding new ways to attack and protect blockchain, while keeping it convenience. In the meantime, people are trading bitcoins, try to keep balance between usability and other benefits.&lt;/p&gt;
&lt;h3&gt;6. Storage&lt;/h3&gt;
&lt;p&gt;At the beginning days, bitcoin was expected to only use waste storages, which are very cheap. But recent years while bitcoin price is booming, people are putting their money into bitcoin. Transactions occurs every second. Storage is becoming big and expensive. Moore law has not worked at the same pace like bitcoin&apos;s growth. Not only that, in bitcoin world, all miners must download whole chain, which is now &lt;strong&gt;150GB&lt;/strong&gt;. And it is &lt;a href=&quot;https://blockchain.info/charts/blocks-size?timespan=all&quot;&gt;growing&lt;/a&gt;.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/overview-of-blockchain-and-bitcoin/bitcoin-size-1.png&quot; alt=&quot;Bitcoin blockchain size until January 2018&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Bitcoin blockchain size until January 2018&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;With 1MB per block for every 10 minutes, bitcoin blockchain uses 52.5 GB a year. Assume that blocks increase 25% annually, so the chain will be 52.5 * 1.25^10 ~ 3TB after 10 years.&lt;/p&gt;
&lt;p&gt;Before 2014, bitcoin blockchain size was only 20MB, which is tiny, nearly free, and can be stored in any personal computer. But nowadays, it is big enough to be carefully considered. Total number of storage bitcoin system using would be million times bigger when more people are joining, and the chain is cloning everywhere in the world.&lt;/p&gt;
&lt;p&gt;People can use lightweight node to save disk storage, but that will decrease security of system as a whole and make it more vulnerable to attacks. People are recommended to use full node, with full blockchain downloaded to support decentralized system&apos;s security. So, bitcoin is not cheap any more.&lt;/p&gt;
&lt;h3&gt;7. Scalability&lt;/h3&gt;
&lt;p&gt;Combining other problems of bitcoin, we got this big one. Storage is increasing to infinity, people are waiting days for transaction confirmation if they don&apos;t want to put tens of dollars into transaction fee... These roadblocks are slowing down bitcoin on the way to be widely accepted.&lt;/p&gt;
&lt;p&gt;There were some proposals. One of which is increasing block size from 1MB to 8MB (as mentioned above). Or periodically removing old transactions, only store balance of non-empty addresses in a distributed database. Sharding hashing process: not all nodes validate all transactions but assign to a subset of nodes. This method will sacrifices security for benefits of scalability. With sharding, bitcoin will be more vulnerable to 51% attack, because now attacker only need to control half of subset instead of whole network.&lt;/p&gt;
&lt;p&gt;More proposals are in research and applying to improve bitcoin security and scalability. If you have an idea, please put it at &lt;a href=&quot;https://github.com/bitcoin/bips#readme&quot;&gt;Bitcoin Improvement Proposals&lt;/a&gt;. If a proposal is not approved by bitcoin development team, it can be implemented by separate team, which will form a hard fork, then create a new coin &amp;quot;branch&amp;quot;: Bitcoin Cash, Bitcoin Gold, Super Bitcoin... Or that separate team will give birth to a fully new cryptocurrency. There are thousands of them: &lt;a href=&quot;https://coinmarketcap.com/&quot;&gt;Cryptocurrency Market Capitalizations&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;8. Vulnerability&lt;/h3&gt;
&lt;p&gt;Bitcoin is vulnerable to news. When good news or bad news occur, especially from government, bitcoin price go up or down very quickly. If a government ban bitcoin usage, it will fall. If blockchain technology is in consideration of governments, it will rise. Bitcoin to USD price is dominated by news, not law of supply and demand. And because bitcoin does not represent any physical or real asset, it only exist in the internet and in human&apos;s mind, so it is vulnerable.&lt;/p&gt;
&lt;p&gt;When price decreases, it is tremendous. Let&apos;s see what happened when Mt. Gox exchange went down:&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/overview-of-blockchain-and-bitcoin/latest-transactions-at-mt-gox.png&quot; alt=&quot;Latest transactions at Mt. Gox&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Latest transactions at Mt. Gox&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Bitcoin system as a whole is also vulnerable to security attacks. If an attack succeeds, nothing is returned. Everything go to somewhere, but nobody know where it is.&lt;/p&gt;
&lt;p&gt;Those limitations must be fixed, if bitcoin want to compete with current financing system, other cryptocurrencies and move to next milestone.&lt;/p&gt;
&lt;h2&gt;Threats&lt;/h2&gt;
&lt;p&gt;Bitcoin protocol is not stable yet, its version is now just &lt;em&gt;0.15.1&lt;/em&gt;. The first stable version usually starts at 1. Bitcoin developers say that &lt;em&gt;&amp;quot;Bitcoin is an &lt;strong&gt;experimental&lt;/strong&gt; digital currency...&amp;quot;&lt;/em&gt; Bitcoin price is going up nowadays, people are putting their money into it. They should know that in case of security leak, or technological failure, their assets may disappear.&lt;/p&gt;
&lt;p&gt;For being able to trade at cryptocurrency exchange platform, people must give bitcoins to them, immediately give up their ownership. They own only a &lt;strong&gt;non-contractual&lt;/strong&gt; IOU (I Owe You). If something unexpected happen, they will lose everything they deposited. IOU does not have any legal constraint. When Mt. Gox was hacked, traders lost $400mil bitcoin (which is several billions now).Mt. Gox just bankrupted, closed. Nobody can found their money back. This year, similar situation happened to Youbit, a South Korean cryptocurrency exchange. They lost 17% total assets after being hacked, and cannot make anything of it returned.&lt;/p&gt;
&lt;p&gt;Although blockchain itself has never been hacked successfully, but applications and services around it have. Someone may say that blockchain is secure. It is. But attackers usually intend to hack people and applications, because doing so is easier and cheaper than attacking blockchain. So you must trust services you are using. Chose them very carefully.&lt;/p&gt;
&lt;h3&gt;Bitcoin wealth distribution&lt;/h3&gt;
&lt;p&gt;A big minus point to bitcoin community is its wealth distribution. Small number of holders are owning majority of market. This is because great mining rewards paid out in early days to a few people. In that time, constructing a block get 50BTC reward. Very few miners joined the game. Those people at that time, now have assets which worth billions of dollars.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/overview-of-blockchain-and-bitcoin/bitcoin-distribution-1.png&quot; alt=&quot;Distribution of bitcoin wealth&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Distribution of bitcoin wealth&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Cryptocurrency wealth distribution is not transparent. Owners and their transactions are hidden to public. That is not good for small traders. When whales do something, everybody affected. When these whales cooperate, they can drive direction of market without restrictions.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/overview-of-blockchain-and-bitcoin/bitcoin-distribution-2.png&quot; alt=&quot;95% are owned by about 4%; 1% control half the entire market&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;95% bitcoin are owned by about 4%; 1% control half the entire market&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Whales&lt;/strong&gt; are holders of large amounts of bitcoin.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Real life have similar wealth distribution model but with more control and restrictions. Big shareholders and managers of a company must public their buying/selling deals. In stock market, if someone use internal information for trading; or use many accounts (of one or many people) to manipulate stock price, that person can be arrested. These activities are illegal in real world. But in cryptocurrency exchanges, these illegal-in-real-world methods are not considered carefully, they are still valid, and there is nothing out there to protect small traders. People must aware and protect themselves.&lt;/p&gt;
&lt;p&gt;Trade at your own risk.&lt;/p&gt;
&lt;h2&gt;Protect yourself&lt;/h2&gt;
&lt;p&gt;Cryptocurrency world is unsafe, but there are several methods that people can use to protect their money. Although these methods are not easy to adapt, but helpful at the moment. Some of them are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Choose service provider carefully&lt;/strong&gt;. You totally depend on them. All your assets are in their wallet. If they are hacked, or they intentionally steal your money, or just accidents, you have no way to get your money back. An apologize from service provider is all what you get. Similar to applications and wallet softwares.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Keep only small portion&lt;/strong&gt; of asset on computer/mobile for daily use. If that computer is hacked, or mobile phone is lost, remaining money still safe elsewhere.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Backup&lt;/strong&gt; wallet regularly, and encrypt it. If losing computer or getting hard drive failure, data is still recoverable. There was a person who threw hard drive, which stores hundred-million-dollar bitcoin, to garbage. He is trying to get government acceptance to find that drive in city landfills.&lt;/li&gt;
&lt;li&gt;Remember to &lt;strong&gt;encrypt&lt;/strong&gt;. Without encryption, anyone has data can get money. Make sure to &lt;strong&gt;remember strong, hard-to-remember passwords&lt;/strong&gt;, even after years without using. If you lose that password, you will lose everything. Someone printed that password, split it, and keep in vaults.&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;cold storage&lt;/strong&gt;. It is a computer which is reseted to manufacturer configuration, always disconnected from network, and only store sensitive information. You can use it like this: create a transaction on online computer, copy that transaction to a USB, put that USB to cold storage, sign transaction, put USB back to online computer, and proceed transaction.&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;hardware wallet&lt;/strong&gt;. These devices only have one functionality: signing transactions. They are safe to virus because no software can be installed on them. But keeping them like keeping physical keys.&lt;/li&gt;
&lt;li&gt;Have a &lt;strong&gt;backup plan for family&lt;/strong&gt;, in case of death or disability. In real world, law can help. But in cryptocurrency world, without private key, your relatives cannot do anything. Your asset will still there forever. But nobody can access it, forever.&lt;/li&gt;
&lt;li&gt;Get &lt;strong&gt;updated&lt;/strong&gt; with your softwares. Newer versions fix security problems. Bitcoin environment is not stable, there are many things to examine, and improvements are announced regularly.&lt;/li&gt;
&lt;li&gt;Get updated with &lt;strong&gt;news&lt;/strong&gt;. Cryptocurrency world is vulnerable to news.&lt;/li&gt;
&lt;li&gt;Get updated with new new methods and techniques. Bitcoin and blockchain are now researched by many organizations.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Not only bitcoin&lt;/h2&gt;
&lt;p&gt;Many people think bitcoin is the only application of blockchain, but it is not. Cryptocurrency is one of thousands application that blockchain can bring. Let&apos;s take a look, and see what blockchain can do:&lt;/p&gt;
&lt;p&gt;The most famous one is &lt;strong&gt;smart contract&lt;/strong&gt;. Every rules are put clearly inside source code. Any modification related to contract is recorded in blockchain, publicly visible and irreversible. Contract is coded, run by computer, so it cannot be cheated (assumes code is correct). That kind of contract forces participants to comply, without intermediate organization - like government, or law. Rules in contract are self-executed, fast, and trustworthy. Examples are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When a car drive onto a space, it can automatically purchase that parking slot.&lt;/li&gt;
&lt;li&gt;A licensed song is delivered to blockchain. If someone want to listen or remix it, they have to pay a specified amount. Payment conditions are coded and executed right after action occurred.&lt;/li&gt;
&lt;li&gt;When a package arrived, system will automatically send 1BTC to merchant, and 0.1 BTC to shipper.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Another application is &lt;strong&gt;supply chain&lt;/strong&gt;. Blockchain can be used to track position and status of containers all around the world, using IoT (Internet of Things). Not only containers, it can be used to verify origin of products, checking status of packages, and customs services.&lt;/p&gt;
&lt;p&gt;Blockchain can be used in &lt;strong&gt;healthcare&lt;/strong&gt;. Health records are stored in blockchain, accessible everywhere, synchronized. It becomes the single source of truth. It is public, but anonymous. Health data can only accessed by patient and doctor. Anonymous data in blockchain can be used for medical researches.&lt;/p&gt;
&lt;p&gt;Blockchain can be used by government for &lt;strong&gt;citizen records&lt;/strong&gt;; or in schools as &lt;strong&gt;student scoreboards&lt;/strong&gt;. It can be used for &lt;strong&gt;reputation system&lt;/strong&gt; of people (for small loans), products, or services.&lt;/p&gt;
&lt;p&gt;Data in blockchain is responsive, updated in real time. It is open, but keeps anonymity. It is useful for small startups and large enterprises. The most imaginative mind cannot think what people can do with these data.&lt;/p&gt;
&lt;p&gt;Blockchain is not only digital coin, it can be any kind of digital asset, or any digital representation of any physical asset.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Real world maps into blockchain\
Blockchain represents real world&lt;/p&gt;
&lt;hr&gt;
&lt;h2&gt;What is next&lt;/h2&gt;
&lt;p&gt;Blockchain has grown to version 2.0, 3.0. Besides bitcoin, thousands of cryptocurrencies are in market, each solve some specific problems. There are many blockchain frameworks are published to the society, some are in development. Bringing huge number of applications, solving several real-world problems, making our lives easier. Some limitations of blockchain first version have been solved, leading to new era of technology.&lt;/p&gt;
&lt;!-- Part 2: [Ethererum and smart contract](/ethereum) --&gt;</content:encoded></item><item><title>Lần đầu thấy trăng - khi cơ hội không đồng đều và cái nhìn về giáo dục</title><link>https://vnqthai.com/post/lan-dau-thay-trang/</link><guid isPermaLink="true">https://vnqthai.com/post/lan-dau-thay-trang/</guid><description>Từ sau những trang sách của Nam Cao một thời làm tôi mê mẩn, “Lần đầu thấy trăng” đã mô tả chân thực đời sống ở một làng quê Việt Nam, nơi những giá trị đảo lộn và con người bị buộc phải tha hoá.</description><pubDate>Tue, 14 Nov 2017 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Giọng văn châm biếm, đầy nước mắt và bi ai, sách nói về những người đã vì trường lớp mà mù chữ, phải làm mọi thứ để mưu sinh. Cuộc đời của họ sẽ không như vậy, nếu như chúng ta có một hệ thống giáo dục tốt hơn, nhân văn hơn, và hướng đến từng cá thể hơn.&lt;/p&gt;
&lt;p&gt;Tôi chưa thấy được hy vọng hay tia sáng nào trong cuộc đời của những con người trong góc nhỏ này, nơi bi kịch chất chồng và số phận trôi nổi. Những người đức độ, tài năng, đáng được tôn kính nhất thì lại có cuộc sống bi đát nhất. Những kẻ kém tài, làm mọi thủ đoạn đê hèn, thì bản thân và gia đình được sống đầy đủ, được xã hội xum xuê. Sách nói về giáo dục, về số phận thảm thương của nghề giáo, nghề đáng lẽ ra phải được trân trọng và đền đáp xứng đáng, lại phải chịu cảnh sống tận cùng nghèo khó, gia đình bất hạnh… Đó là nghịch lý, cũng là bi kịch cho bất kỳ xã hội nào, đã để điều đó diễn ra.&lt;/p&gt;
&lt;p&gt;Người chăm lo học sinh từ giỏi đến yếu nhất, thì hay bị trễ bài, không được giáo viên dạy giỏi. Họ còn phải đối mặt với nguy cơ bị đuổi khỏi ngành vì thành tích của nhà trường, của địa phương. Còn người dạy theo đúng chương trình, chỉ dạy học sinh đã giỏi sẵn giỏi hơn nữa, trong khi bỏ mặc học sinh yếu, sống chết mặc chúng, thì được đi thi, được giải thưởng… Đạo đức nghề giáo được đặt ở đâu trong tình cảnh đó? Tương lai của những học sinh bị bỏ lại sau thành tích của giáo viên sẽ ra sao? Chính bệnh thành tích trong giáo dục đã ép buộc nhà giáo phải trở nên vô lương, và học sinh kém phải ra đường.&lt;/p&gt;
&lt;p&gt;Những người truyền dạy kiến thức, và lối sống, đạo đức cho học trò, bị buộc phải gian manh để tồn tại trong ngôi trường mà họ dạy học. Tôi tự hỏi một khi trở nên như thế, đã làm những chuyện như thế, thì họ có còn đủ phẩm chất và năng lực để dạy, để cho học trò tôn trọng và noi theo? Còn những ai không tự biến mình thành một phần của hệ thống, sẽ bị loại ra khỏi hệ thống. Người tốt, chính trực bị loại khỏi ngành giáo dục, trong khi người biết gian xảo thì được đề bạt, để rồi họ lại truyền đạt, đào tạo thế hệ tương lai. Nghề giáo bị buộc trở thành nghề để kiếm tiền, để tồn tại, hơn là nghề cao quý, để ươm những mầm xanh. Làm sao cao quý cho được, khi những người trong ngành còn phải tranh đấu với cuộc sống và tranh đấu với nhau? Rồi họ đang từng ngày từng giờ biến đổi xa rời bản chất của nghề giáo.&lt;/p&gt;
&lt;p&gt;Khi mà số phận đen đuổi của học sinh không được cải thiện nhờ giáo dục mà còn bị nền giáo dục đó tước đi cơ hội bước vào xã hội. Rồi những đứa trẻ không biết chữ, dần rơi vào đáy không thấy đường ra. Tôi tự hỏi là vì chúng không có khả năng, hay vì những người dạy chữ cho chúng không có khả năng, hoặc vì những người đã đào tạo ra thầy giáo cho chúng không có khả năng? Vì sao chúng phải trả giá cuộc đời mình, vì sai lầm của những người ở tít trên cao vời vợi? Bao nhiêu học sinh bất hạnh và gia đình họ đã phải hy sinh tương lai, cuộc đời của mình để tô diểm cho những tờ giấy khen của giáo viên, những bằng khen của nhà trường, và bảng thành tích của giáo dục địa phương?&lt;/p&gt;
&lt;p&gt;Phổ cập giáo dục là chương trình nhân đạo, nhưng làm bằng mọi cách là bất nhân. Tôi nhớ báo chí từng viết có học sinh lên lớp Sáu không biết đánh vần tên mình, rồi em bị trả về cấp Một… Học sinh ấy lên lớp Năm bằng cách nào, chỉ bị trả về khi đã qua trường khác? Và có bao nhiêu đứa trẻ như em không được báo chí nhắc đến, và bao nhiêu người như em cầm tấm bằng cấp Một rồi bỏ học, mù chữ?&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/lan-dau-thay-trang-1.jpg&quot; alt=&quot;Lần đầu thấy trăng&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Lần đầu thấy trăng, Võ Diệu Thanh. Nguồn: Nhà xuất bản Phụ Nữ&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Nhìn rộng ra, những vấn đề rất lớn mà ta bắt gặp, không chỉ xuất hiện trong giáo dục mà trong mọi mặt của đời sống, như nghề y, nghề quản lý… Chúng không thể được giải quyết chỉ bằng loại bỏ những triệu chứng đang từng ngày xảy ra nhiều hơn, nghiêm trọng hơn, mà cần phải truy căn nguyên cội rễ. Con người không có lỗi, cái có lỗi là cái hoàn cảnh đã làm cho họ phải lỗi lầm. Nếu muốn họ không bị tha hoá, biến chất, ta cần phải thay đổi hoàn cảnh xã hội mà trong đó họ đã được đào tạo, lớn lên. Chỉ có như vậy, những con người với số phận bi ai, mà tôi đang thấy đầy rẫy trong xã hội bây giờ, mới không lặp lại ở thế hệ tương lai. Để con cháu chúng ta có thể vui vẻ mà sống, không phải chịu đời khổ đau vì những lỗi lầm không phải của chúng gây ra.&lt;/p&gt;
&lt;p&gt;Xã hội vốn không công bằng, nhưng mọi phận đời đều đáng được nhắc đến như nhau.&lt;/p&gt;
&lt;p&gt;Cảm ơn cô Võ Diệu Thanh. Những dòng trong truyện này của cô một ngày nào đó nên được đưa vào sách giáo khoa, không chỉ để dạy cho học sinh, mà còn để dạy những người sẽ dạy học sinh.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;Trích sách:&lt;/em&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Từ hồi trước chưa từng nghĩ tới nhục. À vô tình nó có xài tới một lần. Thầy Mãi biểu tôi đọc bài. Tôi không thuộc. Duy nhất bữa đó thằng Dị, con Hậu thuộc bài. Ông thầy đánh vô tay tôi một roi. Thấy muốn độn thổ. Dù tôi trước giờ đã bị đánh không biết bao nhiêu roi. Sao tôi không thấy xấu hổ với ba mươi lăm đứa khác cùng lớp, mấy trăm đứa khác cùng trường mà chỉ câu mâu với mỗi thằng Dị, con Hậu. Thằng Dị con Hậu là những đứa ngang với tôi. Nó hơn tôi dù chỉ một cái cười cũng là điều nhục. Trong khi nhóm ba đứa chúng tôi thua mấy chục đứa kia là điều rất bình thường.&lt;/p&gt;
&lt;p&gt;Thầy Độ nói rất rất nhiều người nghĩ như vậy, làm như vậy. Ví dụ như nước mình nghèo hơn nước khác họ thấy bình thường. Người ta làm được những công trình siêu mơ ước họ cũng không để bụng xấu hổ. Nhưng hễ những người trong xóm cất một cái nhà đẹp, sắm một chiếc xe mới họ thấy nhục, phải cày xới để có tiền sắm cho kỳ hơn. Cho dẫu việc làm đó có khiến cho đất nước này nghèo hơn hiện tại hay là nghèo nhất thế giới cũng không nhằm nhe gì. Nhục của quốc gia là nhục của mấy chục triệu người chớ đâu phải của riêng ta. Và gần hết mấy chục triệu người đều nghĩ vậy.&lt;/p&gt;
&lt;p&gt;Ông còn kể chuyện má thầy Minh. Bán cá lở kẽ tay nuôi thầy đi học. Về không còn chỗ dạy phải đi tuốt trong núi. Chừng xin được về xứ thì bà già chỉ còn lại bộ xương. Vay tạm trị bệnh cho bà mẹ. Nghèo nên cưới vợ không đàng hoàng. Con vợ cũng bỏ.&lt;/p&gt;
&lt;p&gt;Thầy giáo Minh hiền lành lắm, rất thích nghề dạy học. Người mẹ bán cá lở tay chân để nuôi thầy đi học.&lt;/p&gt;
&lt;p&gt;Thằng Đực, đáng lẽ nằm trong danh sách của cô Tài Ba. Nhưng rồi cô kéo nó vào góc lớp nói nhỏ:&lt;/p&gt;
&lt;p&gt;- Em nói với thầy hiệu trưởng em thích học lớp thầy Minh.&lt;/p&gt;
&lt;p&gt;- Em không thích lớp thầy Minh. Ổng bắt học bài thấy ông bà ông vải. Mà em không thích học.&lt;/p&gt;
&lt;p&gt;- Cô cũng bắt học bài vậy.&lt;/p&gt;
&lt;p&gt;- Nhưng em không thích học thầy, em thích học cô. Giống như em không thích ba, thích má hà.&lt;/p&gt;
&lt;p&gt;- Em học thầy cô cho em mười ngàn.&lt;/p&gt;
&lt;p&gt;- Hông.&lt;/p&gt;
&lt;p&gt;- Hai chục.&lt;/p&gt;
&lt;p&gt;- Hông.&lt;/p&gt;
&lt;p&gt;- Em hông nghe lời cô, khi vô lớp cô đánh em tơi bời luôn&lt;/p&gt;
&lt;p&gt;- Hông sợ. Cô đánh sao dữ bằng ba em. Cô yếu xìu.&lt;/p&gt;
&lt;p&gt;- Cô méc ba em. Không học bài, méc, không viết bài méc, xé tập bạn, méc, đón đường bạn chia phe đánh lộn méc.&lt;/p&gt;
&lt;p&gt;- Thôi, thôi. Tôi khoái học thầy Minh.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Rồi sau đó, với sự quậy phá của thằng Đực, và sự can thiệp của cô Tài Ba, thầy Minh bị đuổi khỏi ngành, mẹ thầy chết.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Cô Đẹp rất thông minh. Rốt cuộc học trò cô cũng không được hưởng hương thơm từ trí tuệ của cô bao nhiêu.&lt;/p&gt;
&lt;p&gt;Người ta đòi bằng cấp thì cô mua bằng cấp, người ta đòi chất lượng thì cô phù phép chất lượng. Khi mà người ta không đủ sức để đánh giá con người bằng quá trình, bằng hiệu quả mà chỉ bằng cách bung ra những cái khuôn, thì những người như cô còn đất để tung hoành. Cô biết uốn mình cho vừa khuôn. Nếu không vừa cô dùng bơm để thổi, dùng rác rến để chèn. Mặc kệ là xương mình có gãy, là lương tâm mình có bị móp méo, vặn vẹo. Cô tiến hoá tài ba giữa cái thời bằng cấp và khuôn khổ.&lt;/p&gt;
&lt;p&gt;Kiểu dạy qua loa của thầy cô trên lớp là hợp với quy định. Họ đuổi theo những kiến thức cao siêu đâu đó. Họ nghiên cứu tâm lý học trò trên sách vở, trên giáo trình một cách nhuần nhuyễn. Khi cần thuyết trình họ nói thao thao bất tuyệt. Khi đứng giảng bài đọc vanh vách những khái niệm đã ăn sâu vào đầu óc họ từ năm này qua tháng kia. Giống như một tín đồ ngoan đạo thuộc làu làu kinh kệ. Nhưng chữ vô di chẳng đọng lại chút gì trong lòng.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;...&lt;/p&gt;
</content:encoded></item><item><title>The Google Story – impressions about an innovative, technology-driven company</title><link>https://vnqthai.com/post/the-google-story/</link><guid isPermaLink="true">https://vnqthai.com/post/the-google-story/</guid><description>This book tells an valuable and interesting story about Google’s first 10-year history. I learnt from their story, as same as from history.</description><pubDate>Mon, 30 Oct 2017 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Google started from an Ph.D. thesis, in 10 yearns, has grown to an Internet giant, which affects billion people’s daily life. There are many aspect of the story that I was curious.&lt;/p&gt;
&lt;h2&gt;Vision&lt;/h2&gt;
&lt;p&gt;I impressed, loved the vision of Google&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A perfect search engine will process and understand all the information in the world.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;They stated it, and worked well to achieve it.&lt;/p&gt;
&lt;p&gt;Sometimes, maybe they did not achieved it fully. This possibly is one of the reasons why Page and Brin said they was not satisfied and Google does not meet their expectation. That goes further to what Google is trying to do:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;“The ultimate search engine,” says Pages, “would understand exactly what you mean and give back exactly what you want.”&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Investment&lt;/h2&gt;
&lt;p&gt;Technology alone is not enough. New-born companies need capital. And the way that Google, in their first days, sought for investments while keeping long-term vision, attracted me. They planned to seek for investments from multiple investors, instead of only one solely, because they believe that might risk control in their company. But not much capital firms agree with such a thing. They want to take control, influence in the company where their money is put in. But in the end, both firms chose to split the investment, fifty percent each. Google might walk away if they did not agree. To do so, Google Guys had to convince investors about their vision, and their ability. So that investors can trustworthy give control of the company into their hand. Nobody want to put money to someone they do not trust, or just trust without control. But this is not impossible. If you and what you are doing can be used to convince them. This is rarely happen, but possible, as in the case of Google.&lt;/p&gt;
&lt;p&gt;At some important moments, words from right people can make huge difference, which are more persuasive than all the things you presented. Entrepreneurs need strong relationships.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/the-google-story-1.jpg&quot; alt=&quot;The Google story&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;The Google story. Source: Amazon.com&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2&gt;Execution&lt;/h2&gt;
&lt;p&gt;In case you are just technologist, it is recommended to have somebody who master at business administration to help running your company. Hence you can focus on what you are good at: product and user. Investors will help with consulting and coaching. They do not want their money to go in wrong direction. And what they give your company is not just but more worthy than money.&lt;/p&gt;
&lt;p&gt;Building good product is fundamental, but not enough. You need to work with partners to boost your business to larger scale, instead of depending only on organic users. This will also help you earning big packages, and relationships.&lt;/p&gt;
&lt;p&gt;There are many aspect to deal in a new-born and ambitious business. Good product, along with talented team, is just the fist step. Then problems will occur. You will have to find a way to sell your “best” product. Although it is not bad, but finding people want to buy it is a different story, requiring different skills. You will have to manage your company. You will have to scale but not burn all cash that investors put in. You will need to deal with big corporations and newcomers copying your product. You should register your patents. And you will find more source of money and gifted people.&lt;/p&gt;
&lt;p&gt;Risk does not mean just losing money, or user, but maybe the whole business. Taking risk is a part of the game. It is unavoidable, so do not try to avoid it, but cleverly taking it.&lt;/p&gt;
&lt;h2&gt;Environment&lt;/h2&gt;
&lt;p&gt;Looking in that small world in Silicon Valley and top tech companies, there are things that people grew up and graduated from developing country, like where I am from, Vietnam, not recognized. A person should change mindset or being outstanding in order to be a part of it. They operates at a different level of knowledge, management skills, working styles and environment. Different kinds of education creates different kind of people and society. If you don’t like the way you educated, the way your society currently is, and want to change, you need to update what you were taught, deeply from inside. If you would like to be a part of it, you should find some way to participate in the lifestyle, the way of thinking and the way of working. Natural intelligence, to me, is equally for human kind. But as we can see, current result of nations and communities are different. That is because of the way people living, cooperating, and teaching each other. Silicon Valley cannot be copied from outside in, it should be be done inside out. Not top down, but bottom up.&lt;/p&gt;
&lt;h2&gt;Culture&lt;/h2&gt;
&lt;p&gt;What I like most about Google after reading this book? That is “20 percent of time.” Employees have 20 percent of their paid time, which means one day a week, to do whatever they want. This can be pooled. So they can spend a whole month in anything. They can chase ideas, researches, to please themselves but not their bosses. A tech company can benefit from its employees doing what they are deeply care about. They are better, and then the company will get more. In Google some ideas was funded and brought profit. Google is operated like university campus, where two founders came from.&lt;/p&gt;
&lt;p&gt;The second thing is free meals. I heart this before but was totally surprised. I though that just free meals from food providers around, like McDonald’s or something alike. But Google did it differently. They seriously hired chefs, with stock options, to do all the planning, cooking and presentation. They considered organic ingredients and really care about their employees’ health. That is like a restaurant inside the company. And that is impressive.&lt;/p&gt;
&lt;p&gt;One quote from the book that summarize the story of Google:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Youth + freedom + transparency + new model + the general public’s benefit + belief in trust = The Miracle of Google&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In my words: &lt;em&gt;“Follow the people and money will follow you.”&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;More imagination&lt;/h2&gt;
&lt;p&gt;It is my dream to imagine whole computer system in my brain, to illustrate its workflow mechanism inside my brain, to know all the things of the system, with just one imagination. I am trying with systems I am working on at my current company. And I would like to do that with a system at scale like the Google search engine, software and hardware. After that, I want to be able to imagine the mechanism, the workflow, the principal of bigger things, like universe and philosophical existence.&lt;/p&gt;
</content:encoded></item><item><title>Who Am I? And If So, How Many?: Answering life’s questions via self cognition</title><link>https://vnqthai.com/post/who-am-i-and-if-so-how-many/</link><guid isPermaLink="true">https://vnqthai.com/post/who-am-i-and-if-so-how-many/</guid><description>This book opens the path to self cognition. Not only mind, but also body. Not only philosophy, but also psychology and biology. And then, it drives questions toward the famous one: “What is happiness, and how to get there?” Reading it, you will find yourself walking on a useful, exciting and worth-discovering trait.</description><pubDate>Tue, 17 Oct 2017 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;The author does not represent specific ideas of any school or people, but multiple achievements in many sectors. And what perspective is right, what is wrong? What is the most persuasible? I think that is not his intention. He only wants to give us a multi-perspective point of view.&lt;/p&gt;
&lt;h2&gt;Diverse point of views&lt;/h2&gt;
&lt;p&gt;When studying science, considering in many perspectives is important. Any point of view seams to be reasonable in this perspective possibly seeming reasonable in the opposite perspective also. At that time, you might think: “Believing totally, and stop continuing from the first point of view is impatient and somehow stupid.” Then you would know that if two philosophers with definitely opposite/anti-each-other opinions are equally smart and respectful. And in many cases, they are both reasonable, too.&lt;/p&gt;
&lt;p&gt;If you find something which is reasonable, acceptable and sounds good, that is great. But such finding should not stop you from finding different ideas, should not stop you in your path to truths. You need to study supporting, similar, and opposite ideas to strengthen your thoughts, to correct your doubts, and to justify your conclusion. Truth is not unique, it survives.&lt;/p&gt;
&lt;p&gt;More generally, looking at other sciences, for example in this book is psychology and biology, is recommended. To many questions, philosophy alone is one-sided. Philosophy should not and never is the single source of truth.&lt;/p&gt;
&lt;p&gt;Stopping thinking, concreting ideas is a dead end. Philosophy itself has not ended.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/who-am-i-1.jpg&quot; alt=&quot;Who am I? And if so, how many?&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Who Am I? And If So, How Many? by Richard David Precht. Source: Scribe Publications&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2&gt;Note from the book&lt;/h2&gt;
&lt;p&gt;You think &lt;em&gt;“To be is to do”&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Or &lt;em&gt;“To do is to be”&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Oh, that might be &lt;em&gt;“Do be do be do”&lt;/em&gt;&lt;/p&gt;
</content:encoded></item><item><title>The Thorn Birds – a story about unavoidable destiny</title><link>https://vnqthai.com/post/the-thorn-birds/</link><guid isPermaLink="true">https://vnqthai.com/post/the-thorn-birds/</guid><description>I read this book based on a friend’s recommendation. And it did worth the time.</description><pubDate>Thu, 11 May 2017 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;Tragedy&lt;/h2&gt;
&lt;p&gt;This book is a tragedy. Love can totally destroy people but they cannot do anything to avoid or change. What is destroying they is very powerful: destiny, or God. The tragedy is not only happen with one couple, it happened to 3 generations: grandmother, mother, and daughter. Year after year, decade after decade, every people experienced hurt, but tragedies did not have an end. People loved much, was hurt much; people loved less, hurt less; people who tried to fight against destiny, hurt more. They wanted to change, but God always won.&lt;/p&gt;
&lt;p&gt;I wonder many times: “How can these people live their life with all their pains? How can they stand with all the events that happened?” This book has a lot of strong woman. I feel so weak comparing to them.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Spoiler:&lt;/em&gt; There is a bright spot at the end of the book is happily at the end, the daughter found her true love and happiness.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/the-thorn-birds-1.jpg&quot; alt=&quot;The thorn birds&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;The Thorn Birds by Colleen McCullough. Image source: Amazon.com&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2&gt;Dreams&lt;/h2&gt;
&lt;p&gt;This story is about love, chasing dreams, and the fight against God. A man usually has desires. And these desires may kill that man’s love, and the person they love too. When a man goes out for dreams, he is leaving his woman behind, with all the pains, broken heart, and loneliness. Men can think about staying at home, for their lover’s satisfaction. But actually they should not, because they will day-by-day thinking about their dreams, about what they did not do. And that, in turn, will break the relationship. This is an unavoidable situation. People can try their best; things can come good or bad. And at the final end, destiny will win them all. This is one of a few stories, which I did not find any solution for the people.&lt;/p&gt;
&lt;h2&gt;Description&lt;/h2&gt;
&lt;p&gt;This book, like &lt;a href=&quot;https://vnqthai.com/gone-with-the-wind&quot;&gt;Gone with the wind&lt;/a&gt;, described thought of woman in specific, and human in general, very well. They helped me much in understanding what are in woman’s minds, that are the special points of their though compared to man, what is the flow of thoughts in their brain… In man’s point of view, woman is hard to understand, in every circumstances. And if a men want to understand woman around him, I suggest these books.&lt;/p&gt;
&lt;p&gt;Description techniques is impressive and extremely beautiful. I can imagine large fields in Australia, flowers, animals, buildings, life styles… as they appear in front of me. While going near to the end, I read slower and slower. I was afraid that it will terminate and I would have to stop reading.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;I did not understand the intention, the idea of Colleen McCullough when writing this book. What did she want to state? Was her intention is just that human cannot win God, or life is suffer and being a human is painful? I am sure that I missed something deep in the novel and re-read will be a must.&lt;/p&gt;
</content:encoded></item><item><title>Experiments when reading The Art of Computer Programming</title><link>https://vnqthai.com/post/experiments-when-reading-taocp/</link><guid isPermaLink="true">https://vnqthai.com/post/experiments-when-reading-taocp/</guid><description>On the way of reading this series, I figure out some points that may help in digesting.</description><pubDate>Tue, 04 Apr 2017 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Think beyond&lt;/strong&gt; what is written. The text is concise. Perhaps the author did it this way to encourage reader thinking.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Skim when needed&lt;/strong&gt;, and get back when necessary.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It is probably preferable, for motivation, to &lt;em&gt;skim over this section lightly at first&lt;/em&gt;, and (after seeing numerous applications of the techniques in future chapters) &lt;em&gt;return to it later for more intensive study&lt;/em&gt;. If too much time is spent studying this material when first reading the book, a person might never get on to the computer programming topics!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
</content:encoded></item><item><title>The Art of Computer Programming – a new beginning</title><link>https://vnqthai.com/post/taocp-a-new-beginning/</link><guid isPermaLink="true">https://vnqthai.com/post/taocp-a-new-beginning/</guid><description>After a while my mind thinking about algorithms and the in-depth computer mechanisms, I decided to begin studying in this section.</description><pubDate>Mon, 03 Apr 2017 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Based on some online courses, and references on the Internet, I believe that this set of books is a good point to start studying &lt;strong&gt;computer science&lt;/strong&gt;. &lt;em&gt;(2018 update: I was wrong)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;However, I will face a lot of difficulties: this study will not help me much in short time; I will not have opportunities to use these knowledges in applicable works until I master; the investment of time is huge but I will not get explicit return in years, I still have to work, while contributing in deep learning. Despite of all of these reasons, I also decided to do. I always question about basic principles behind technologies. I don’t want to be somebody only use someone else’s result blindly. The road ahead is long and hard, but I want to experience. The biggest benefit in short term is the fun of making my brain working in pressure, and through its limit. Nothing satisfy me more than the feeling of today I am better than yesterday, and I will not stop.&lt;/p&gt;
&lt;p&gt;I studied algorithms at high school. When I was in college, I studied more about software engineering. At that time, I was thinking engineering is the practical part, and algorithms are old-fashioned. But after 10 years studying and working as an engineer, I also feel that I like science more.&lt;/p&gt;
&lt;h2&gt;About&lt;/h2&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/taocp-2.jpg&quot; alt=&quot;The Art of Computer Programming series&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;The Art of Computer Programming series by Donald E. Knuth. Source: Vec.com&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;This set of books is a monograph written by &lt;em&gt;Donald E. Knuth&lt;/em&gt;. He attracted me when declaring the purpose of his work as:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Differs from that taken in most contemporary books about computer programming. I am not trying to teach the reader how to use somebody else’s software. I am concerned rather with teaching people how to write better softwares themselves.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And to deal with fast-moving computing industry, Knuth wrote:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;My new goal has been to concentrate all “classic” techniques that are likely to remain important for many more decades. I am trying to emphasize concepts that are timeless.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I did not expect anything else.&lt;/p&gt;
&lt;h2&gt;How I will read&lt;/h2&gt;
&lt;p&gt;This is the first time I read &lt;em&gt;The Art of Computer Programming&lt;/em&gt;. And surely I will &lt;strong&gt;read again many times&lt;/strong&gt;. Therefore, to keep it suitable with my current level and background, make it maximum valuable for me, and make me most pleasure and joyful while reading, I decided to:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;With time:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Have time limit to everything: read a chapter, a section, do exercises.&lt;/li&gt;
&lt;li&gt;Determine if a section is should-read at specific time, based on what I will gain. Remember I will not read only once, and will not read exactly from begin to end.&lt;/li&gt;
&lt;li&gt;Following regular progress is not required.&lt;/li&gt;
&lt;li&gt;If a section is decided to read, read thoroughly.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;With exercises:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Don’t try to solve all the exercises.&lt;/li&gt;
&lt;li&gt;Don’t try to fulling understand all the deep mathematical issues.&lt;/li&gt;
&lt;li&gt;But it is recommended to read through and notice about their existence.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;With interesting problems:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If I choose to solve a problem, and see that it is interesting, I will write to describe its solution.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While reading this series, I have noted my experiments. You can find them at &lt;a href=&quot;https://vnqthai.com/post/experiments-when-reading-taocp&quot;&gt;Experiments when reading The Art of Computer Programming&lt;/a&gt;&lt;/p&gt;
</content:encoded></item><item><title>Death Note – A good manga for practicing rational thinking</title><link>https://vnqthai.com/post/death-note/</link><guid isPermaLink="true">https://vnqthai.com/post/death-note/</guid><description>I tried this manga as a material to keep my brain working after an online course. And it did not disappointed me.</description><pubDate>Thu, 23 Mar 2017 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;When I was reading, I tried to think like the characters, tried to understand their arguments and evidences. I put myself into their situation, of both sides. And by trying to thinking like that, I intended to practice my brain logical thinking and study from the characters.&lt;/p&gt;
&lt;p&gt;Some actions that I think characters used to drive them to success:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Get other people’s  help.&lt;/li&gt;
&lt;li&gt;Gain as much information, knowledge as possible.&lt;/li&gt;
&lt;li&gt;Hide information to enemy. Provide false information.&lt;/li&gt;
&lt;li&gt;Find patterns among events. Finding patters is a good starting point. After finding something, you will have information to get further.&lt;/li&gt;
&lt;li&gt;If information stream is stuck, try to action to make information appear: make enemy action, make allies action…&lt;/li&gt;
&lt;li&gt;If yourself need to take action, try to hide as much information as possible in your actions.&lt;/li&gt;
&lt;li&gt;Give assumptions. And try to confirm or negate it.&lt;/li&gt;
&lt;li&gt;Predict what could happen future, guess that would the enemy do, and get ready for them.&lt;/li&gt;
&lt;li&gt;Thinking about thinking about thinking. Planning about a plan about a plan.&lt;/li&gt;
&lt;li&gt;Keep mind calm in every situations. Minimize effect of feelings.&lt;/li&gt;
&lt;li&gt;Never think that you are right. Never think that you win.&lt;/li&gt;
&lt;li&gt;Behave in the way that you feel most comfortable while not disturbing others.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Characters in this manga have some specific ways to keep them concentrate that I think might be helpful:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Eat sweet foods to provide energy to your brain. But keep thinking while/after eating in order to not get fat.&lt;/li&gt;
&lt;li&gt;Be in any style you feel most comfortable: squat, sit in the floor…&lt;/li&gt;
&lt;li&gt;Do anything that make your mind feel most relaxing, productive: eat, play toys, walk…&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These are personalized behaviors. Do not try if you do not feel definitely comfortable with them.&lt;/p&gt;
&lt;p&gt;The manga also taught me to put aside feelings when trying to solve hard problems. Feelings can make you think in a personal, inappropriate, and wrong way. Feelings can make you find evidences to prove what you feel, but not finding conclusion from strong evidences. These are two opposite processes. Feelings sometimes help somebody finding correct answers of some problems. But with really hard problems at most of the time, it will drive people far wrong away. Feelings are different from intuition.&lt;/p&gt;
&lt;p&gt;Every important thing need a detail plan, with predefined alternatives to make it go to success. The result is defined before combat begin. That is the power of planning. But do not underestimate the meaning of execution. Bad execution can destroy good plan. And good execution can contribute to not-so-good plan.&lt;/p&gt;
&lt;p&gt;Somebody think this manga is a story about combat. But I think this manga is about ideals, philosophy, intelligence, and how to think.&lt;/p&gt;
&lt;p&gt;A recommend manga for anybody who are interested in blowing your mind. For those extremely intelligence, this manga is for relaxing.&lt;/p&gt;
&lt;p&gt;If you think you are not smart enough, keep practicing. Brain is trainable, intelligence is gainable.&lt;/p&gt;
</content:encoded></item><item><title>The Code Book – technical history of secrecy</title><link>https://vnqthai.com/post/the-code-book/</link><guid isPermaLink="true">https://vnqthai.com/post/the-code-book/</guid><description>I scanned this book couple years ago, when I was strolling in a bookstore. It was so attractive that I spent 4 hours looking throughout it, as I remember. But I did not buy. Until a reprint last year, I bough one version and begin reading fully. It was not disappoint my curiosity.</description><pubDate>Mon, 30 Jan 2017 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;Concealing messages&lt;/h2&gt;
&lt;p&gt;From the ancient of time, &lt;strong&gt;concealing message&lt;/strong&gt; is a critical survival factor of people, armies and organizations. People wrote letter by a type of ink that only readable after heated; they wrote on someone’s head and wait for their hair to grow to hide information; they wrote on a piece of wood and wax it; or even swallow the letter to hide it in the postman’s stomach. But this kind of secrecy has a fatal weakness: if the message is detected, the information is exposed. That is why people need &lt;strong&gt;cryptography&lt;/strong&gt; to continue hiding information, in case the message is somehow detected.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/the-code-book-1.jpg&quot; alt=&quot;The code book&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;The code book by Simon Singh. Image source: Books Come First&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2&gt;Early cryptography&lt;/h2&gt;
&lt;p&gt;Cryptography has 2 major branches: transposition and replacement. &lt;strong&gt;Transposition&lt;/strong&gt; is re-ordering characters in the message. &lt;strong&gt;Replacement&lt;/strong&gt; is converting one character to another. With replacement, people can use the same character set as the original message or introduce a whole new set.&lt;/p&gt;
&lt;p&gt;Character replacement cryptography is strong and worked for centuries until it was broken by &lt;strong&gt;frequency analysis&lt;/strong&gt;. This method analyzes documents of original message’s language (if known) to determine the frequency of its characters, or consecutive sequence of characters. Based on this result, and frequency of encrypted message’s characters, people can form a one-to-one mapping. This method is based on probability, its accuracy would reduce if message is short (less than 100 characters). Frequency analysis works but it would  be harder if people use following tricks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Remove all white spaces&lt;/em&gt; to make language analysis more difficult. For example with English, a character has two white spaces before and after it, that character would be “A” or “I”.&lt;/li&gt;
&lt;li&gt;Use &lt;em&gt;null characters&lt;/em&gt;: add characters which have no meaning.&lt;/li&gt;
&lt;li&gt;Use &lt;em&gt;special character for specific meaning&lt;/em&gt;. For example: ∆ character for indicating the previous character is duplicated.&lt;/li&gt;
&lt;li&gt;Intentionally write &lt;em&gt;incorrect-spelling words&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Use &lt;em&gt;word encryption&lt;/em&gt; (encode): encode one word by another word or a special character. This trick can also be broken by guessing from context.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After centuries, these kinds of cryptography were broken by language analyzing. They also became easier to be broken if one character is decrypted correctly, later characters can be decrypted one after another, faster and faster. So we need a stronger encryption.&lt;/p&gt;
&lt;h2&gt;Multiple mapping tables&lt;/h2&gt;
&lt;p&gt;This method instead of using only one, it uses &lt;strong&gt;multiple mapping tables&lt;/strong&gt; and switch among them for every character. For example: use table 8 for encrypting first character, table 5 for second character, table 37 for third character and so on. Which table is used for which position is determined by a predefined key. The same character that is placed at different position in the message will be encrypted by different characters. This make this method somehow invulnerable for language analyzing.&lt;/p&gt;
&lt;p&gt;Although this method is more secure, but it is harder to use and take longer time for encryption and decryption. That’s why it is not as commonly used as single mapping table, which is less secure.&lt;/p&gt;
&lt;p&gt;This method is strong. But it, in turn, is broken if someone (1) Find character groups’ repetitions, then can guess the length of the key. (2) After guessing the length of the key, we can use frequency analysis.&lt;/p&gt;
&lt;p&gt;There are some tricks for making this method stronger:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;em&gt;long key&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Use a &lt;em&gt;book or a paragraph in a book as the key&lt;/em&gt;. You can also use a song, a letter, or invent a whole new document, and agree it with the receiver. Because the key is very long, therefore encryption overcomes finding repetition method. If the length of the key is as same as the message’s, encrypted message is very strong.&lt;/li&gt;
&lt;li&gt;Use a &lt;em&gt;random meaningless character sequence as the key&lt;/em&gt;. This will helpful defend against language analysis and guesses. However, this will make the key harder to remember, or must write it somewhere to transfer to the receiver.&lt;/li&gt;
&lt;li&gt;To improve the meaningless approach, people used &lt;em&gt;one-time keys&lt;/em&gt;, which were written in a thick notebook and agreed between sender and receiver. This will help if: (1) One message is broken and the key used for encrypting that message is discovered, enemy cannot use that key for other messages. (2) If 2 encrypted messages – which were encrypted by the same key – are captured, they cannot be used as references for breaking. One-time key approach has disadvantages: the physical notebook can be stolen and copied; and high quality randomness is hard to produce. So it is only used in top-secret and expensive channels, until today.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Do not use the same key to encrypt too many messages or a message which is too long&lt;/em&gt;. You will give breaker many clues. However, this is hard to achieve, because in the past, a key is intended to be used as many as possible.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;From handwork to a machinery: Enigma&lt;/h2&gt;
&lt;p&gt;Using paper and pen is slow and error-prone. Many of these methods are broken. People need a faster, more accurate, and secure method. That’s why Enigma was born. The design of Enigma machine is complicated, it is made from many parts, and there are several tricks to improve possible keys and security. It is not necessary if I describe all the design of Enigma in this article.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/enigma-1.jpg&quot; alt=&quot;Enigma machine&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Enigma machine. Image source: Wikipedia&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;A &lt;strong&gt;security system&lt;/strong&gt; not only includes cryptography method, but also infrastructure, equipments and people to operate. Enigma is strong, but like any other security systems, it was broken by cooperation of countries, intelligence, scientists, philologists and mathematicians.&lt;/p&gt;
&lt;p&gt;Some lessons I derived from the broken of Enigma:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Increase the number of possibility of keys.&lt;/li&gt;
&lt;li&gt;Avoid repetition. Repetition is enemy of secrecy.&lt;/li&gt;
&lt;li&gt;Avoid language patterns (big repetition of popular words, document formats…) Patterns are also enemy of secrecy. They are clues for breakers.&lt;/li&gt;
&lt;li&gt;Customize security system occasionally to give more difficulties to breakers.&lt;/li&gt;
&lt;li&gt;Do not use any material to keep keys. Keeping it in mind is better, but harder.&lt;/li&gt;
&lt;li&gt;Minimize the role of human. Enigma machine itself was very strong. But the system that operated around it was not. People found clues for breaking Enigma mostly from human mistakes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Use local language&lt;/h2&gt;
&lt;p&gt;Encryption is only hide information in a known language. Security is increased very much if using a language that enemy don’t know, or a language that very little people know. People will also need some enhancements to fix weaknesses of that language, and make it close to describe every words in their language. Somebody can invent a whole new language, if have enough time, money and craziness.&lt;/p&gt;
&lt;h2&gt;Computer era&lt;/h2&gt;
&lt;p&gt;After years using machines for encryption, decryption and breaking, these machines’s design were updated and their power grew fast. That leaded to the birth of another machine – computer. While previous machines can only solve one specific problem, computers are &lt;strong&gt;faster&lt;/strong&gt; and can be &lt;strong&gt;programmed&lt;/strong&gt; to solve multiple problems. Breaker can brute force the key set to find the correct key. In turn, encryptors tried to use computer power to enhance complication and strength of encryption.&lt;/p&gt;
&lt;p&gt;One major different of computer compare to previous machines is: it represents data in digital form of &lt;strong&gt;0/1 bits&lt;/strong&gt;. Then original message, encrypted message, and the key are in the form of bits. There are many encryption methods invented for computer, which are too long to describe here.&lt;/p&gt;
&lt;p&gt;Computer is powerful, flexible, but delivering the key from sender to receiver is costly and insecure, that may become the weakest factor in the system. People have to think about resolving this. If they success, computing encryption is applicable in commercial and in daily life, not only in government and military as before. People believed that such a solution does not exist. But after several years many people’s effort, some of them are mathematicians, a solution for key agreeing was published.  This is an evidence of perseverance, faith and knowledge will pay off, no matter what the society think.&lt;/p&gt;
&lt;p&gt;The first solution was a big success at that time. However, it need improvement. The process of agreeing encryption key requires communication between sender and receiver. What if the sender want to send a message but receiver is sleeping? Does she have to wait? Researchers introduced &lt;strong&gt;asymmetric cryptography&lt;/strong&gt;, or public-key cryptography. Then after years of cooperation, trials and errors, people invented RSA. With RSA, security will be improved significantly, if the public key used to encrypt message is big enough, about 10^300. Until a faster way for prime factorization is found, &lt;strong&gt;RSA&lt;/strong&gt; stays secure. But nobody can predict future.&lt;/p&gt;
&lt;p&gt;Later, people continued researching, and they published a software, called &lt;strong&gt;PGP&lt;/strong&gt; (Pretty Good Privacy). This software increase the speed, usability and add digital signature into RSA. Using PGP, people can encrypt their message and add digital signature into it easily and fast. This software is made for every people. At the time of this book is written, if all computers in the world cooperate, it will take billion years to break just one message encrypted by PGP.&lt;/p&gt;
&lt;p&gt;An interesting thing is that if you programmed a strong cryptography software, do not deliver it on the Internet. Some nations, including United States, treats strong cryptography software as weapon, because it is difficult for them to break it. Therefore, you will be arrested because of exporting a dangerous weapon.&lt;/p&gt;
&lt;p&gt;Another significant advantage of digital data is it can represent anything, not only text and numbers, but also image, audio and video. Using a computer, someone can encrypt their phone calls, as same as encrypting their message.&lt;/p&gt;
&lt;p&gt;In the future, superpower computer systems can simply use brute force to find the correct key. Nobody can be confident if currently there are some of these computers out there or not.&lt;/p&gt;
&lt;p&gt;Computing technology introduced new threats to secrecy beside cryptography, including:&lt;/p&gt;
&lt;h3&gt;Tempest attack&lt;/h3&gt;
&lt;p&gt;If you use a strong encryption method like RSA or a tool like PGP, you are also vulnerable for leaking your private data. When you are typing something on your keyboard, or when your computer’s CPU are processing, electromagnetic waves are produced and get into the air. Some people can use devices to collect those waves and analyze it, give them information about what you are typing, what your CPU is processing. Your private data is leaked before it is encrypted. To prevent this, you can equip your room with devices to prevent electromagnetic waves from getting outside. But in United States, government permission is required for buying those devices. Because it restricts the capability of government.&lt;/p&gt;
&lt;h3&gt;Cybersecurity&lt;/h3&gt;
&lt;p&gt;When people use computer to encrypt, and network to transfer their data, virus, malware, and many types of cyber attacks are threatening privacy. The cryptography algorithm is secure, but the system around it is not. In the scope of this article, you only need to know that if a cryptography cannot be broken, others factors like computer, network, human error will be the target.&lt;/p&gt;
&lt;h2&gt;Quantum technology&lt;/h2&gt;
&lt;p&gt;Currently, mathematicians did not find a faster way to do prime factorization (but did they? Who know). So RSA stays secure. If the algorithm is not breakable, people need more powerful computers to do the job. And they are developing one, &lt;strong&gt;quantum computer&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;In turn, physicians and mathematicians are researching a method to apply quantum technology, which will create the strongest cryptography in history. They published and theoretically proved that it is unbreakable. Some experiments with new method succeed within short distance. In the future, quantum cryptography will be practical.&lt;/p&gt;
&lt;p&gt;The race never ends.&lt;/p&gt;
&lt;h2&gt;Quotes from this book&lt;/h2&gt;
&lt;p&gt;In this book, there are some quotes that I think interesting:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Keeping the key is more important than keeping the cryptography mechanism. – Kerchhoffs&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;A cryptography which is not strong enough is more dangerous than not encrypting at all.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Cryptography inventors are always thinking about the worst case, that there are world-level plots to break their cryptography.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;Quotes from myself&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;If you broke someone’s encryption, try your best to keep that secret, don’t let anybody know that you broke it. So you can digest information from other messages.&lt;/li&gt;
&lt;li&gt;Never think that your encryption is secure. It can be broken already by someone. Trust something which is not strong will result in totally defeat. Nothing is strong.&lt;/li&gt;
&lt;li&gt;Be aware of supercomputers, and networks of computers, they can brute force anything. Who know a giant computer system is operating somewhere, or somebody can order all computers in the world to do some job?&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;The Code Book is an interesting book about information hiding, the continuous race between security system creators and breakers, between cryptography inventor and governments. It describes tools, machines, technologies and algorithms used in cryptography systems. It honors people with knowledge, logical thinking, mistakes, intuition, passion, and silent sacrifice.&lt;/p&gt;
</content:encoded></item><item><title>Gone With the Wind – when the world is up-side-down and reactions</title><link>https://vnqthai.com/post/gone-with-the-wind/</link><guid isPermaLink="true">https://vnqthai.com/post/gone-with-the-wind/</guid><description>A well-written book that far above my capacity to sense and evaluate.</description><pubDate>Sat, 28 Jan 2017 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Scenery, lifestyle is described lively. The thinking, concerns and point of view of people are detail. Farms, horse wagons, houses, foods, parties exist in front of me. I am like a spirit flying around to see people living. My imagination was triggered at its most active mode. Surely I will read this book again.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/gone-with-the-wind-1.jpg&quot; alt=&quot;Gone with the wind&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Gone with the wind by Margaret Mitchell. Image source: Publishers Weekly&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;em&gt;(Warning: spoiler ahead)&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;Description&lt;/h2&gt;
&lt;p&gt;This book is split into 3 parts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Pre-war: &lt;strong&gt;wealth&lt;/strong&gt; with talks, parties, farms, horses and love stories. Gentlemen discussed about the coming war. They were strongly confident in victory. Ladies didn’t care.&lt;/li&gt;
&lt;li&gt;Mid-war: the &lt;strong&gt;falling&lt;/strong&gt; of the society, diseases, captured and death gentlemen. Confederate States was up-side-down. Men were died, women were left lonely. But they kept faith in their justice, their culture, and the love to their land. People gathered to achieve what they believe, but failed.&lt;/li&gt;
&lt;li&gt;Post-war: &lt;strong&gt;reconstruction&lt;/strong&gt; from starveling and conflicts: conflicts between the the old and the new, among groups of people, among people who loving and are loved. People who were on the top now in the bottom. People who were in the bottom now aware their rights. Outsiders came to the top. Scarlett was very strong to take care of her family. But that definitely changed her life. She was blowed by the wind.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The author also had strong understanding of woman psychology, from a baby to an old lady. Woman’s needs, cares, rivalry were well described. A lot of thoughts that I was unable imagine that exist now came to real in Margaret’s words, they are so real that I cannot decline. Scarlett is one of the best described character I have ever read.&lt;/p&gt;
&lt;h2&gt;Love&lt;/h2&gt;
&lt;p&gt;This book is about love and hurt. I appreciate Rhett’s silent love to Scarlett and Melanie’s faithful love for Ashley. Melanie is the strongest woman in the novel, I think.&lt;/p&gt;
&lt;p&gt;Scarlett was an attractive, sweet rose. The more beautiful the rose is, the sharper thorn it has. She was a horrible fire which injured any man who intended to touch, damaged, destroyed who succeed. Her husbands are injured most and one were indirectly killed. Rhett though that he can control that sacred fire, but he failed and his love for Scarlett was vanished.&lt;/p&gt;
&lt;p&gt;I realize loving someone but marry another will hurt oneself, the person loved, and the person married. Do not know who are actually loved, or know too late, will result in pains. The later, the more pain. Loves in this book are complicated and they are only disclosed in the last chapter. Scarlett though she loved Ashley, but married three others then definitely hurt all of them. Scarlett loved Rhett but only realize after continuously erased his love for her. Throughout the book, she though she loved Ashley. But if there was a time Ashley told her that he loves her, Scarlett would stop thinking that she love him anymore. Ashley loved his wife but quietly chased Scarlett and only discovered his love for Melanie before her death.&lt;/p&gt;
&lt;p&gt;It is not easy to figure out real love, for whom, and how much. Life is complicated, love is the most complicated factor. Love is not a game, so is marriage. Don’t play with fire or you will burn everything to nothing. Or play with care if you can.&lt;/p&gt;
&lt;h2&gt;Flexibility&lt;/h2&gt;
&lt;p&gt;Everybody have their viewpoint, and in a perspective, they are all right. Do not judge other people’s thinking based on your experiment but should on theirs. Before reading this book, I thought that the Confederate States are absolutely wrong because they protect the slavery. I evaluated that period based on this century’s standards. Everything has its own history. Everything has bright side and dark side. Everything has its arguments. Judging from outside is alway easier. Research, listen, and negotiate are more difficult but alternatives to resolve conflicts. But they are not always help.&lt;/p&gt;
&lt;p&gt;History proved that violence works. Not the right side will win, but the stronger. The Southern army fought well, but lost. The Southern army is confident, but lost. The Southern society lack of practical mind, and they were loser. Be the winner to protect your belief and drive the flow of history to your side. If you lost, your faith and society will disappear along with your army. Protecting things will be easier with victory. Therefore try your best to win.&lt;/p&gt;
&lt;p&gt;But if defeat is coming to clear, what should people react? This book appreciate people who have strength and are flexible enough to overcome difficulties. In a rapidly changing world, there are always alternatives for one to keep their living, care their relatives, and thrive. Ashley was not the man who didn’t dare enough. &lt;em&gt;“He is only not flexible enough, tried to apply principles of non-existing society to current one. – said Rhett”&lt;/em&gt;. And he totally failed.&lt;/p&gt;
&lt;p&gt;“Gone with the wind” is a skill. Foreseeing the flow of history is a skill. Choose the right side to stand and change when required is a skill.  The book described people who are damaged by the tornado of history, and people who followed its wind. Life moves on. History moves on. What currently existing will disappear in the next couple years. What not existing now will be the dominating factor. &lt;em&gt;“Raise the flag, and you are sinked, or hide the flag, and you are alive. What is your choice? Is there other answers?”&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Going with the wind with a wise mind will return. But if going with the wind blindly, you will lose all: wealth, honor, and trust. But what is “wise”, that is based on each individual, family, and the society that they belong to. On the way to victory, everybody should be equipped with wealth, relationships, flexible mind, knowledge, and love.&lt;/p&gt;
&lt;p&gt;Don’t forget, instead of judging other choices, it would be better to make your choices right.&lt;/p&gt;
&lt;h2&gt;The future&lt;/h2&gt;
&lt;p&gt;The novel made me to think about this question: “Is it appropriate to stably follow my ideals at huge costs. Or should I be flexible in doing required actions to seek for wealth and happiness of my caring people?&lt;/p&gt;
&lt;p&gt;I think of my girlfriend.&lt;/p&gt;
</content:encoded></item><item><title>&quot;Right&quot; – Vietnamese &quot;Đúng việc&quot; - lessons about life</title><link>https://vnqthai.com/post/dung-viec/</link><guid isPermaLink="true">https://vnqthai.com/post/dung-viec/</guid><description>A book that I read in a non-stop manner. Words in it tell stories about exactly what I am thinking and agreeing, and extends my  knowledge. The author – Mr. Giản Tư Trung – told his ideas, in a calmer and more organized than if I do it myself.</description><pubDate>Mon, 09 Jan 2017 00:00:00 GMT</pubDate><content:encoded>&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/dung-viec-1.png&quot; alt=&quot;Đúng việc&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Đúng việc by Giản Tư Trung. Source: giantutrung.vn&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;A book that are quite difficult to quote for me. If I want to share something, that is nearly quoting the whole book. It is difficult to rewrite what I favorite, what I fully agree from the book in my style. Because my ideas are almost the same, but my writing is not that good.&lt;/p&gt;
&lt;p&gt;A book sometimes make me to reflect myself, correct my thinkings. It also give me extra motivation to strive for truth, follow what are right. The road is long and difficult, but I feel that it is meaningful and deserved.&lt;/p&gt;
&lt;p&gt;A book teach me about ways to organize chaotic ideas in mind into sentences and paragraphs, into a way that readers may feel more comfortable.&lt;/p&gt;
&lt;p&gt;A book that I want to read again in the future.&lt;/p&gt;
</content:encoded></item><item><title>Gone Girl and perception on shared life</title><link>https://vnqthai.com/post/gone-girl/</link><guid isPermaLink="true">https://vnqthai.com/post/gone-girl/</guid><description>A New-York-city white-collar married couple suddenly lost their job because of economic crisis and computing trend. The husband’s mother had cancer and hey decided to move to Midwestern. Problems occurs from this time and the wife disappeared just before the 5th wedding anniversary.</description><pubDate>Sun, 18 Dec 2016 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Gone Girl story is told by two interleaving flows: viewpoints of the wife – Amy, and the husband – Nick.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/gone-girl-1.jpg&quot; alt=&quot;Gone girl&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Gone girl by Gillian Flynn.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;This book discloses different aspect of the story after each part. There are 3 of them.&lt;/p&gt;
&lt;h2&gt;Part I&lt;/h2&gt;
&lt;h3&gt;Naturally and generally: Human are different&lt;/h3&gt;
&lt;p&gt;There are differences among every people in the world, and these differences are wider between woman and man. Woman need attention and care, man need respect and admiration. Care from other people is very important to women, while some men think this is small and they do not pay enough attention. Some actions that man think small are very important to woman. This is a big problem in every serious relationship.&lt;/p&gt;
&lt;p&gt;Concerns of this person might or might not be other person’s concerns. Priority in life, set of values are different also. So never judge other people’s values and concerns based on yours. Human is diverge and unique in general. Differences are natural.&lt;/p&gt;
&lt;p&gt;But talking is always easy, and reality is hard to accomplish, especially with who you care: your lover, your husband, wife or children – who you want to be better at every aspect of their living. And inappropriate judging and expectations are where problems come from.&lt;/p&gt;
&lt;h3&gt;Problem solving approach&lt;/h3&gt;
&lt;p&gt;The way of solving a problem is more important than the problem itself.&lt;/p&gt;
&lt;p&gt;Some people choose to temporary hide their personal though for common sense in living, for saving relationships. They believe that talking about disagreements later on would be better than saying it immediately. The urgent task is calming both down.&lt;/p&gt;
&lt;p&gt;Other people apply principles on their family life, after discussion for agreement from their partner. But life change from time to time, and it’s forceful to persist these principles. Multiple times in daily life, somebody will feel uncomfortable to follow, but because of the agreement, they are forced to not telling. This is bad. Trying to understand and being sympathy would be better. But better is always more difficult. And hard work pays off. The question is: How hard you can try? How difficult you can overcome?&lt;/p&gt;
&lt;h3&gt;Career&lt;/h3&gt;
&lt;p&gt;Both people need their own professional life and independence on career path to help their relationship better. Dependence on whatever is not good. Economically or mentally depends on your partner is even worse. Love is more consistent between two confident and successful people.&lt;/p&gt;
&lt;p&gt;Be best at  job, then compromising or choosing between job and personal life are not needed. Hold control of business as much as possible is the key for family happiness. However, choosing is necessary sometimes, but nothing beside you can force you, that is totally a personal choice. So work hard and minimize unwelcome effects of business to personal life. If you are not good at work, your career would affect your personal life, or even destroy it.&lt;/p&gt;
&lt;p&gt;This comes to a dilemma: If I try hard, invest more time at work and studying to be best and independent, how can I pay enough time to maintain a relationship? How to balance? How to keep career not in turn destroy personal life? These are good questions.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/work-life-balance-1.jpg&quot; alt=&quot;Work-life balance&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Work-life balance. Image source: African Leadership magazine&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2&gt;Part II&lt;/h2&gt;
&lt;h3&gt;Adaptation&lt;/h3&gt;
&lt;p&gt;Changing personality to satisfy partner’s need is not good. But what if each personality is not fitted with the other? How can you two do? Accept or change? Good questions.&lt;/p&gt;
&lt;p&gt;If you become another person who is not actually you – a person with different characteristic, a person with personalities that you partner expect but not who you truly are – then at a specific time in the future, you will return back to who you naturally are, who you were before. This time surely will come. This is when problems begin. You partner might be not love you anymore.&lt;/p&gt;
&lt;p&gt;Be yourself, whatever, always, even if your partner doesn’t like. Don’t become who else because other person want you to do so. Never permit your lover to love somebody who is not actually you. He/she will not love you, in the future, if you do so.&lt;/p&gt;
&lt;p&gt;But if you realize something is not good, change it. Remember that change must come from you, not anyone else. Everything come from inside out is more persistent than outside in.&lt;/p&gt;
&lt;h3&gt;Basic standards&lt;/h3&gt;
&lt;p&gt;There are standards of each person, many of them are basic: which was built when people grew up, sensed and felt when they were a child and enforced when they went to school; which were taught by their parents and relatives. These standards are very hard to change, because they defines who people basically are, and differentiate each person among the others.&lt;/p&gt;
&lt;p&gt;That’s why people usually should live their life together with common basic standards. This is also told by parents to their children as a criteria for choosing partners. And why it is good to have a partner with similar childhood and development environment.&lt;/p&gt;
&lt;p&gt;That is hurt, but that is also reality. And sometimes reality wins.&lt;/p&gt;
&lt;h2&gt;Part III&lt;/h2&gt;
&lt;p&gt;This part, as my opinion, is just closing of what was opened in the first 2 parts.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;This book gave me many knowledge about woman and man and how they live their life together. A open-minded book.&lt;/p&gt;
</content:encoded></item><item><title>Never conclude after first reading - what I learned from Sophie’s World</title><link>https://vnqthai.com/post/sophies-world/</link><guid isPermaLink="true">https://vnqthai.com/post/sophies-world/</guid><description>This book by Jostein Gaarder is an mind-blowing book about the history of philosophy.  It approaches by a different way: a story of 15-year-old Norwegian girl.</description><pubDate>Wed, 14 Dec 2016 00:00:00 GMT</pubDate><content:encoded>&lt;ul&gt;
&lt;li&gt;&lt;em&gt;“Do we actually exist?”&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;“Are time and space exist, or they just exist in human’s mind?”&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;“Do we see the world as-is, or they are just images in our brain?”&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Those questions and more are asked during the book, and some philosopher try to answer them, while Sophie is learning philosophy from 4000 years ago until today.&lt;/p&gt;
&lt;figure&gt;
  &lt;img src=&quot;https://vnqthai.com/images/sophies-world.jpg&quot; alt=&quot;Sophie&apos;s world&quot; loading=&quot;lazy&quot;&gt;
  &lt;figcaption&gt;Sophie’s world by Jostein Gaarder. Image source: Amazon.com&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;Following Sophie’s footprint through multiple philosophers’ though, I told myself to keep in mind “Even if everything looks clear, I should never conclude fast.” In other words, “Never lose sense of wonder.” When reading about  philosopher A, I had a feeling that philosopher A is reasonable. Most of the time I would conclude that philosopher A is right, and other people who against A is wrong. But after a few chapters, I read about other philosophers who do not agree with A, partially or completely. I had a feeling that these philosophers are reasonable, too.&lt;/p&gt;
&lt;p&gt;Multiple times I thought that keeping an open mind, never concluding at first time, and researching similar and opposite opinions are needed while studying philosophy. I remind myself not to try to find a “absolutely right” answer. Usually such answer does not exist. And what are right, what are wrong depends on circumstance and history. Keeping a “perfect” mindset while reading philosophy might harm knowledge exploration. Philosophy is a journey of thinking, so keep brain thinking as much as possible. Conclude what is right or wrong might close this process. That is not good, is it?&lt;/p&gt;
&lt;p&gt;Whenever I wonder if an idea is right, I try to calm down my heed and keep reading. Someone’s mind will be improving from time to time, as long as they keep studying. If my idea at a specific time is wrong, that is  normal. Just keep discovering knowledge. Strict myself, easy others, and keep learning.&lt;/p&gt;
&lt;p&gt;Philosophy is a hard trip, but after finding out something (right or wrong, who knows), I had a good mood of knowing more. I am climbing up the rabbit fur.&lt;/p&gt;
&lt;p&gt;This book is highly recommended for young girls and boys, and people who are new to and interested in philosophy. It is easy to read, easy to adapt, and funny.&lt;/p&gt;
&lt;p&gt;Happy reading!&lt;/p&gt;
</content:encoded></item></channel></rss>