Monday, September 16, 2013

List View Threshold in SharePoint

It's been a few years I have started working with SharePoint and lists, libraries, user groups and etc.. are now seems like much interesting from the internal way they are handled. Never faced a situation where 5000+ list items are involved in the days of training and now it seems like the best times where I get to know the performance management is important and other considerations are much valuable when it comes to the development.

SharePoint has this interesting feature that actually saves the database servers being loaded with heavy queries on list items and it is called list view threshold. By default it is set to 5000 for normal users and 20000 for users with administrative privileges. This can be set to any value at anytime and also disable and allow any load to be put on the db server, which is equivalent to breaking the fence around the house and asking people to come in thousands.

Sunday, September 15, 2013

NDepend for Developers to Write Quality Code

Writing code is easy. But writing quality code is not that easy. Naming conventions, variables and constants defining, right use of the enums, class member visibility and many more things exists for the developer to be concerned with. In fact, you can save your customer as well as destroy him depending on the code you write sometimes. There are unit tests and load tests that Visual Studio provides inbuilt which you can asses the accuracy and speed of the code you write. Of course there are some best practices which should be followed but when you are a day before the code freeze, it is sometimes not likely to happen. 

I have tried out StyleCop which is a style analysis tool that works at the code level and FxCop which is a static analysis tool that works on the level of managed assembly. They give a lot of support for the developer to write some quality code. But what I am going to describe in the rest of article is a tool that do many times of work than any of these does. 

I got a message on LinkedIn from Patrick Smacchia, who is the CEO and Lead Developer of NDepend with an amazing gift. It's a free professional license for NDepend. I tried the tool for a few weeks and found some interesting features in it that could save my time and improve my code quality. So I used it to evaluate one of the projects I did about an year back. In a way I was really happy that I have recorded only 51 rules violations in a project with 232 classes when I was just 1 year experienced.