Around the year 2000, Microsoft developed the C# language (led by Anders Hejlsberg ). This language, along with the .NET framework had a significant strategic purpose. Microsoft would create a better language tied to Windows, driving customers to the Windows ecosystem and Microsoft products. Perhaps this was part of the notorious Embrace, extend, and extinguish Microsoft strategy (now in the past). This development came in response to Java, which has gained enormous popularity by then.
Recently I was dealing with a couple of bugs in C# regarding timeout behavior. The solutions were pretty interesting so I decided to share them. Consider these scenarios: We show a dialog to the user with some message. We close the dialog after 15 seconds. However, if the user closes the dialog manually, we have no need to close it at timeout. Start a long operation. If that operation lasts more than 5 seconds – Abort it.
A long time ago, on my first programming job I had a design problem that I couldn’t solve. This problem haunted me. The reason was that it seemed so simple, and yet I couldn’t find a good solution for it. Eventually I did a huge refactor, but instead of solving it correctly I simply changed one problem to another. Recently, years later, in a different company, I came up with that great solution I was after.