Posts

Showing posts from September, 2011

Code annotations for making parallel programming painless

Many years CPUs were improving performance by increasing clock rate until they reached ceiling of frequency for semiconductor devices. As humanity is far from inventing good alternative, vendors choose another strategy – freeze frequency, but put few cores in a single CPU. Today you can’t already surprise anyone by phone with dual-core CPU. Theoretically, increasing number of cores can proportionally increase performance, but achieving this goal lies totally on us – on software developers. To get advantages of few cores, we need to design software in such a way that it will execute in parallel and effectively use all of available cores. What does it mean on practice? If you are web-developer or developer of multi-user service – you are lucky. All (or almost all) job of paralleling processing of requests will catch web-server and database management system. But if you process a large amount of data at your own or create that web-servers and DBMSs, problem of parallelism will worry...

Encapsulate Collection in C#

Today I was reading a great book by  Martin Fowler  " Refactoring: Improving the Design of Existing Code ". This is a good chance for me to organize in my head and improve knowledge of good practices in coding. Even more, all code samples in the book are in Java, so I can note some interesting differences between .NET and Java. Reading about pattern  Encapsulate Field  I was pretty proud for C# as it has 2 features I like very much: properties in common and auto-properties particularly, which turns about 10 lines of encapsulation for single field using methods (as in Java) to only one auto-property line. Then I moved to chapter  Encapsulate Collection . And it suddenly made me to meditate...