Extending Visual Studio (part 1)

I love Visual Studio, always have. From the moment I wrote my first “Hello World!” in C, until becoming an expert C# developer.

With all due respect, however, there was always something missing. One user needs this, the other needs that. Of course, an IDE can’t have it all. The question is only whether an average user can extend VS to inlcude whatever is missing. This series of posts will try to fill the gaps, trying to answer this question: how to get into Visual Studio that which is missing. I will stick them all into a category named “Extending Visual Studio” for easy reference.

But before I begin, here’s a disclaimer – I am no expert in VS extensions; these posts are simply a collection of my experiences and adventures in the world of extending Visual Studio.

Before we are able to extend Visual Studio, we need the Visual Studio SDK. Install it and then continue reading!

So, you have the SDK? Great!

We’re done with technicalities, let’s create an extension!

Continue reading

Climb the curve

I’ve recently had a project in which an interesting challenge popped up.

Write a function that will round a timestamp to the closest 15min value.

Something like this:

challenge

Additional example:

For May 1 2015, 18:44:20.000 – round to May 1 2015, 18:45:00.
For May 1 2015, 18:07:30.000 – round to May 1 2015, 18:00:00.
For May 1 2015, 23:52:30.001 – round to May 2 2015, 00:00:00.

For this discussion, let’s allow the mid-points to be rounded to any (of the two) neighbouring 15min timestamps. The problem seems easy. And it is. But something strange happened.

I asked this question several people around the workplace. They were able to start with a sound idea in seconds (well, most of them). The thing that shocked me is that no two persons proposed the same solution. Every one of them had his own way.

So here are few of the first ideas:

Continue reading