 <p>My simple answer combined with those answer is:</p> <ul> <li>Create your application/program using thread safety manner </li> <li>Avoid using public static variable in all places</li> </ul> <p>Therefore it usually fall into this habit/practice easily but it needs some time to get used to: </p> <p>program your logic (not the UI) in functional programming language such as F# or even using Scheme or Haskell. Also functional programming promotes thread safety practice while it also warns us to always code towards purity in functional programming. If you use F#, there's also clear distinction about using mutable or immutable objects such as variables. </p> <hr> <p>Since method (or simply functions) is a first class citizen in F# and Haskell, then the code you write will also have more disciplined toward less mutable state. </p> <p>Also using the lazy evaluation style that usually can be found in these functional languages, you can be sure that your program is safe fromside effects, and you'll also realize that if your code needs effects, you have to clearly define it. IF side effects are taken into considerations, then your code will be ready to take advantage of composability within components in your codes and the multicore programming.</p>