Tuesday, March 8, 2011

ReSharper: remove unused references.

Today I was cleaning up unused references in a Visual Studio solution. Thanks to ReSharper it was not as tedious as I fought at first. Another great feature provided by this tool saved me a couple of minutes (or maybe hours):  http://www.jetbrains.com/resharper/features/navigation_search.html#Find_ReferencedDependent_Code.
To use it select the referenced assembly in the solution browser and choose "Find Code Dependent on Module" from the context menu. If the assembly isn't used anywhere in the current project ReSharper will show a message box saying: "Code dependent on module XXXXXXX was not found". In this case you can remove this reference safely.

Friday, March 4, 2011

SQL or NoSQL: The Hybrid.

It seems like a coexistence of SQL and NoSQL worlds is possible now. The folks from DeNA succeeded in creating a hybrid of both approaches. The MySQL plugin HandlerSocket turns the InnoDB engine into a NoSQL database. HandlerSocket allows to benefit from mature RDBMS storage engines and the lightweight NoSQL protocol that abandons the SQL processing. The results are very promising: with 750,000 queries per second the HandlerSocket achieves a considerably better throughput than the standard MySQL (105,000 qps).
For details on this benchmark and more information about HandlerSocket see Yoshinori Matsunobu's blog: http://yoshinorimatsunobu.blogspot.com/2010/10/using-mysql-as-nosql-story-for.html.
And last but not least: HandlerSocket ist open source. You can grab the code from github: https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL.

Tuesday, March 1, 2011

Magic GUIDs, ReSharper and more...

Here are some tricks I discovered today:


  • Magic GUIDs: Creating unit tests in Visual Studio is quite easy when you are doing it 'the right way'. But sometimes when I want to write tests first and create a new project for them I mistakenly choose the class library project type instead of a unit test project. However these are two different project types so when I try to run my tests from the class library project the Visual Studio won't find them. Fortunately you can convert an existing visual studio class library project to unit tests project: http://blog.drorhelper.com/2008/12/how-to-convert-net-class-library-to-ms.html
  • ReSharper: There is a great new feature in ReSharper 5.0 called value tracking.
  • Another nice ReSharper feature useful when you want to restructure you code: Move code elements up and down: [Ctrl]+[Alt]+[Shift]+[Up|Down]. You can move single lines but also entire methods.
  • Sourcemaking: A website with lots of stuff about design pattern, antipatterns and refactoring: http://sourcemaking.com/