Increasing productivity with Visual Studio 2005

Here are some steps to increase your productivity by improving the speed of your IDE. Here are the tips:

Startup improvements:

  • Disable "Start Page".
    Tools | Options | Environment | Startup, Change ‘At startup setting’ to ‘Show empty environment’.
    Disable splash screen.
  • Open the properties of Visual Studio 2005 shortcut. Add the parameter /nosplash to the target.
    For example: "C:\Program Files\Microsoft Visual Studio 2005\Common7\IDE\devenv.exe" /nosplash
  • Close all unnecessary panels/tabs to prevent them from appearing when the IDE loads.

Then optimize your environment itself:

  • Install Visual Studio 2005 SP1
    Turn off animation.
    Tools | Options | Environment, uncheck ‘Animate environment tools’.
  • Disable Navigation Bar when you don’t use it. Otherwise, VS keeps refreshing it.
    When using ReSharper, use CTRL-F12 instead.
    Tools | Options | Text Editor | C#, uncheck ‘Navigation bar’.
  • Turn off Track Changes.
    This will reduce overhead and speeds up IDE response.
    Tools | Options | Text Editor, uncheck ‘Track changes’.
  • Turn off Track Active item.
    This will turn off jumping in the explorer whenever you select different files in different projects.
    Tools | Options | Projects and Solutions, uncheck Track ‘Active Item in Solution Explorer’.
  • Turn off AutoToolboxPopulate.
    There is an option in VS 2005 that will cause VS to automatically populate the toolbox with any controls you compile as part of your solution. This is a useful feature when developing controls since it updates them when you build, but it can cause VS to end up taking a long time in some circumstances.
    Tools | Options | Windows Forms Designer, set ‘AutoToolboxPopulate’ to False.

My Visual Studio starts this morning in less then 5 seconds… Including loading Resharper.

Update: Thank you for inspiring ‘.NET tip of the day‘ and sorry for not noticing you at the first time.

Issue while programmatically inserting Media Items

Sitecore has described how to create media items by yourself on SDN a while ago. Some how this code was broken while uploading JPG-files larger then 100kb. As I’m currently working on the location fo our customer and they’ve got a lot of network overhead(they are using Novell all over the place…) and the exception told me that the Uploaded file was closed, I decided to check the limits configured in our Web.config.

The httpRuntime Element has a lot of settings which influence the way they are connected to the end-user. I’ve played a little with the maxRequestLength and executionTimeOut. But unfortunetely it didn’t work. Digging in my memory about the specific problem, I remembert that JPG is like, every image format, block based. This might could have something to do with the issue.
There’s a requestLengthDiskThreshold in the httpRuntime. The default size is extremely low(256bytes!). After changing this value to 1kb(1024), it worked again like a charm.

So when you have some issues uploading. Try to add the requestLengthDiskThreshold-parameter to your web.config! I’ll ask the Sitecore Documentation team to add this to the page mentioned above.

My Geeky Interests: Functional programming

A while ago I needed a Lexer and Yacc for .NET. Looking at the class-structure of Sitecore, I found out it was just another LR parsing algorithm. So I contacted Jakob and his first reply was:

Oh man, Alex, you just hit my pet, favorite, geeky interest – compilers.
The Sitecore Query language uses a hand written compiler.

[…]

I find that if you have a good tokenizer and an EBNF, it is fairly simple to write a compiler. I guess that is why it can be automated.

–Jakob

Well today S. Somasegar hit my geeky interest: functional programming! Actually it isn’t that far from compilers as compile algorithms can easily be written in functional languages such as Haskell and F#. I’ve worked with a Haskell-variant for a while, called Clean. Although I didn’t enjoyed it at that time, it is was an amazing learning method for me. I often hear that I’m really good at writing readable code(thank you for the compliments :)), I’ve learned that while writing functions in Clean…

Now back to the news and to start directly: F# becomes a full part of the .NET family, including full support in Visual Studio 2008(as add-on). There are already a lot of sites on the web about this amazing language:

I hardly can’t wait to write my collection classes and extensions in F#. It will be amazing fast and easy comparing it to the effort of time you’ve to spent these days on collections and ugly patterns such as ‘yield returns’. And what about lambda expressions? Using them everywhere in your code. Starting to think about it, can’t wait to program against Sitecore using F#. Larger data collections? So what! F# is, like any other programming language, used to work with infinite lists… One of the coolest aspects is as well that Microsoft can provide a functional programming language to schools and universities. This means that the door behind Haskell can finally be closed.
So clap your hands for Don Syme and all those other contributors to the project.

Definitely a related subject: Parallel programming. There’s a lot of stuff going on with PLINQ(Parallel Language Integrated Query) and Microsoft has also published a lot of information on their Parallel Framework Toolkit. For information, watch Joe Duffy’s blog, read the MSDNMag Okt2007 article on Multi-core optimizing or watch this video on Channel 9.

Gotta sleep now, or maybe setup a new blogpost :).

Legally separating content – The goals

This is post 1 out of 4 about one of my new projects. At a local government organization I’m currently working on a new solution which is all about separating and sharing content. I thought this might become interesting as lots of you guys will struggle with similar questions and problems during your projects.

So what is general the idea? For one of our customers we’ve build an intranet-site which was delivered by the end of 2006. This intranet site was targeting the internal customer, every internal employee who’s working on a daily base inside the building of the customer.
This organization has also a group of important ‘information workers’ who don’t have a desk inside the building. They’ve received a notebook to perform their daily work. There’s also an important details on these persons. They are politician. They are elected by the start of 2007 and they will work for 4 years on one or more specific tasks. Most of these politicians have some relation with the internal organization. For example, they share documents, ideas, plans, agenda’s, etc.
There are also some main differences. In general, the politicians decide what the regular inside worker should perform. Not on a low level base, but strictly high level. On the other side, the internal worker facilitates the normal civilian. This implicates that:

  • A politician shouldn’t know anything about the daily operations in the company
  • But an inside worker shouldn’t be interested in the way a politician operates

For example, when the politicians decide something about IT or even schedule a meeting about IT, they are not allowed to use the internal organization as a source. At the same time, an internal worker is not allowed to influence the decision. The agenda’s and even news bulletins should be separated.

The internal organization has an amount of people who manage the intranet. These people include the direct assistants of the politicians(they are internal and used to operate in-between). And as 90% of the content won’t be separated all content goes in 1 CMS installation.

All these requirements together including some additional infrastructure requirements make it quite a challenging project. The next week you can expect 3 more entries about this task. First one will be about the way we’ve implemented it in the client(in a real Sitecore/Office 2007-way) the other 2 are more in-depth stories. Hopefully you guys will enjoy the reading. Please share your ideas and comment with me so I will be able to explain all the unclear stuff.

For now: have a nice weekend!

Typo3, Joomla and Umbraco progress

Yesterday evening I’ve been involved in the monthly Umbraco chats. It was all about packaging and extensibility yesterday. Being in such a chatsessions, gives you a good sight on the current progress of a project like Umbraco. The chatlog will be published later today on Umbraco.org.
In the session, Niels Hartvig and other contributors discussed the possibilities of the new package repository(am I allowed to place link here?) and the possibility to couple styles to it.
It seems that Niels is organizing the whole community around Umbraco to get ready for further (more advanced) Umbraco releases(3.1 /  4.0).

This morning I continued my way trough the Open Source CMS’s and found this set of slides about Typo3 5.0. The guys are definitelly innovative! Altough I’m still not happy with their TypoScript, they work at least on better and improved versions of their framework.
Hopefully v5 won’t be that over-engineered as v4 is. You can get the first snapshots of version 5 on the v5 dev-trac site.

Joomla seems to be at the final stage of their v1.5 version. They’ve just released 1.5 RC3 under the codename ‘Takriban’(sounds like?!). An excellent piece of work as this third release candidate is released on 10 weeks after the release of RC1.
For everyone who’s interested in Joomla, I do recommend to read trough the Development Cycle so you get to know more about the lifecycle and Q&A-policies a Joomla releases goes trough.

Have fun playing with :).

Some useful xUnit.NET links

Last Tuesday, I mentioned the brand new testing framework xUnit.NET. Today some additional links for those guys who aren’t persuaded yet, colleague fanatics and any other:

Just found that XUnit without sourcecode, including cmdline runner is compressed just around the 40 kb. Exracted, the 2(!!) necessary libraries have the total weight of 62,5 kb. Just nunit.framework.dll alone is even heavier(68kb)!

xUnit.NET Fanatic

I’m very fanatic when it comes to test driven development (TDD). Too often people are writing complex applications without testing it proper. It happens to me as well. This has in general 3 reasons:

  1. Sometimes I’m just lazy. Laziness is a general developer disease which occurs a lot.
  2. No buddy to review my testresults. Your buddy should be someone at your level, someone who can review your work in a functional way, but he also has to speak on the same technical level. If not, eXtreme Programming becomes useless as you won’t be able to supply each other feedback.
  3. Don’t know where to start. This one is the most important reason. A lot of programmers don’t know where to start with simplistic unit testing, mocking, etc. I’ve had the same problems. I’m glad that Visual Studio, TestDriven.Net and ReSharper have integrated test functionality these days.

Back to my title: xUnit.NET. A new Unit-test framework. Another one?  Yes! Written by the mister James Newkirk, a NUnit veteran. He was responsible for NUnit v2 and learned a lot from the design mistakes they’ve made. A couple weeks ago he announced this new test-framework.
I’m working and reading with/about it for 2 weeks now and I’ve to say, I’m impressed! The framework is designed to fit exactly in the .NET Framework, it has support for Generic, Nullable types, etc and it’s even more simplistic. For example, they’ve limited the amount of possible attributes, the framework uses constructors and IDisposable instead of SetUp and TearDown.
The Assert object is 50% smaller. It has less unreadable methods and overloads. Personally I’m extremely happy with the ExceptedException replacement. In this case viewed with anonymous delegates:

Assert.Throws<InvalidOperationException>(delegate { operation(); });  // .NET 2.0      
Assert.Throws<InvalidOperationException>(() => operation());  // .NET 3.5

Everybody who is interested should visit, read carefully and follow the updates on the following pages:

All above together: I’m a xUnit.NET fanatic from now on. Expect more on this topic later!

Enough at this late Tuesday evening.
But remember… It not just about the tool… 😉

Topic of the week: Publishing aliases

I want to pay some special attention to the Publishing Aliases topic on SDN5-Forum. Jennifer Chance, properly a wonderfull lady employed at an unknown Sitecore partner, has asked how she could publish Aliases. By clicking on publish these days, none of the related items will be touched. Of course this approach won’t case any performence issues as the system is doing what you’re asking, but how intuitive is such an approach?

When you’ve got any ideas about this, please feel free to post a reply on the thread and it properly becomes a nice discussion and product enhancement.