Wednesday, January 28, 2015

Why readonly in C#?

Make summary form following post:
http://stackoverflow.com/questions/277010/what-are-the-benefits-to-marking-a-field-as-readonly-in-c

1. Improve readability: tell how to not use in other way.
2. Nothing to do with performance
3. Immutable data structures in threading

Monday, January 26, 2015

What is real purpose of Enable Visual Studio Hosting Process?

According to MSDN:
"The Visual Studio hosting process improves debugger performance and enables new debugger features, such as partial-trust debugging and design-time expression evaluation"

In real world:
Sometimes, vshost.exe always running, and you can't even kill it from Task Manager. (After killed it, it restores automatically, need to quit Visual Studio)

Need to disable this feature/bug by following steps:
Properties of project =>
"Debug" tab =>
uncheck "Enable the Visual Studio hosting process"

How to solve in C++ upgraded project for error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ)?

Remove /Zl from Configuration Properties -> C/C++ -> All Options -> Additional Options

Friday, January 23, 2015

TDD is about Development not Design

TDD is about Development not Design

In initial design stage, need to hide unrelated detail as much as possible, cover high level scenario only.

Test Driven Design forces thinking on low level details. In this way, it is very easy to lose focus.


Try a new project to see if TDD stands for Test Driven Development, or Test Driven Design