Microsoft DevDays 2007

By mOrPhie on Wednesday 20 June 2007 15:41 - Comments are closed
Categories: life, techrelated, Views: 1.667

My graduation-company offered me to visit both days of the Microsoft DevDays in the Netherlands in exchange for giving some demos of my graduation-project. This gave me the opportunity to attend some sessions and that was a lot of fun. More than I expected, because I thought it would be a giant Microsoft commercial. Lukily, that wasn’t the case.

I attended the sessions by Scott Guthrie about silverlight. My first thought on this is: why oh why are we introducing yet another “standard”. Ok, there will be a plugin available for Safari and Firefox, yet Linux or mobile users won’t be able to browse the silverlight websites. I think these kind of developments are nice in a technology-geek kind of way, but it isn’t the most smart one, considering the compatibility problems we have with flash (or for that matter: HTML/CSS).

I also attended the sessions about Vista Development for Managed Code by Daniel Moth. That guy can talk! Going fast, but not too fast and talking about stuff that matters! I even got to know some features I didn’t know they existed at all. For example <a href=”https://winqual.microsoft.com/”>WinQual</a>. Ever had those weird boxes telling that an error had occured and it asks you to send information over to Microsoft? This is WinQual in action and not an imaginary bug server at Microsoft. It is actually very useful for developers. Go read about it. It is worth it.

I hope I can attend DevDays next year, but we’ll see. :)

FizzBuzz

By mOrPhie on Wednesday 20 June 2007 15:41 - Comments (1)
Categories: life, software engineering, techrelated, Views: 1.423

FizzBuzz is a common example to test whether someone is competent in programming. The assignment is to write a program which prints 1 to 100. For every multiple of 3 print ‘Fizz’ and for every multiple of 5 print ‘Buzz’. For every multiple of 3 _and_ 5 print ‘FizzBuzz’.

The trick is that most of the time only competent programmers know of the “modulo” operator (% in C, C++, C# and others). Silly thing is: it’s usually true! Why? No one knows…

Competent programmers should be able to com up with this under 5 minutes:


C#:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
for (int i = 1; i <= 100; i++)
{
    if (i % 3 == 0 && i % 5 == 0)
    {
        Console.WriteLine("FizBuz");
    }
    else if (i % 3 == 0) // && i % 5 != 0
    {
        Console.WriteLine("Fiz");
    }
    else if (i % 5 == 0) // && i % 3 != 0
    {
        Console.WriteLine("Buz");
    }
    else
    {
        Console.WriteLine(i);
    }
}



Now don’t rely on this example. There are other tests out there. Still, it’s quite funny to see your colleagues struggle with something so simple and finally bang their head against the table if you tell them the trick.