Scott Hanselman

CodeMash 2008 Wrapup - What are you working on?

January 11, '08 Comments [18] Posted in Musings | Speaking
Sponsored By

webcamThank Goodness for Video Calls. Even though I'm at CodeMash in Ohio, I got to see the family over Skype at a sprightly 640x480 fullscreen video and Z loves it.

I hate traveling away from the family, but it is nice to be welcomed when I do travel. The folks at CodeMash have been very welcoming and they put on a very unique conference out here.

It's a cross-platform, cross-cultural, cross-language conference with a very positive vibe. The "vibe" or general feel of a conference matters more than you might think. I started out asking folks "are you a Ruby person or a .NET person?" but soon I got with the program and started asking folks "what are you working on?"

Everyone is using everything, every tool, every IDE, every platform, doing whatever they can do get the job done. Folks might do C# for their day job, but play with Scala on the side. They might work on Python for a day job but use Linq and VB for a church website.

It was such a positive attitude, it was extremely inclusive. People were encouraged to avoid talks about technologies they were already familiar with, with .NET folks checking out things like Dojo and Groovy on Grails. Never heard of these techs? You would at a conference like CodeMash or the ALT.NET Conference.

I came to hear talks and give a talk, but my goal was to meet and talk to as many people as possible. I tried just wandering around and chatting with folks, but found that after the organizers put up a "Rock Band" kiosk, that hanging out there was the best way to meet everyone! It was a gravity well, pulling in virtually the whole conference. I can't play Guitar to save my life, but I can play drums (and cowbell) on The Blue Oyster Cult's Don't Fear The Reaper. A young lady from Pakistan had never heard of ANY of the songs (I had only heard of 2, since there was no "Kool Moe Dee" option) but with some coaxing tried the drums and was soon jamming away and having a blast and we had a fine conversation about her projects. If you're putting on a conference, nothing brings a sorts of people together like a game like this.

I gave a talk on IIS7 and PHP using Mike Volodarsky's great MSDN article as a jumping off point and it went very well, although I did have one programmatic OutputCaching demo not work, so I used declarative instead and it worked great. I'll post-mortem later. You never know with these things, it could have been something as simple as not resetting IIS. I also got a chance to do about 20 minutes of "Programmer Standup Comedy" which was, happily, well-received. I'm often silly in talks, to be clear, but it's been a while since I've done standup, and while some silliness I did at the recent PNPSummit did OK, the energy of the CodeMash conference was so upbeat that I felt comfortable doing the first chunk of my talk as schtick. Conferences and their endless presentations can get dull and since this was a lunch keynote it seemed well-timed and helped wake people up.

All in all, a great time was had by all. I hope more conferences start "mashing" it up. It's no fun to be away from home, but it's much more tolerable when topics are so varied as these and the environment is positive and inclusive.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Is rooting for Visual Basic like rooting for the Red Sox?

January 10, '08 Comments [45] Posted in ASP.NET | Microsoft | Musings | VB
Sponsored By

iStock_000001491101XSmallHere in the US we have this professional Baseball team called the Boston Red Sox.

According to Wikipedia (and known to be true) "In 1918, the team won its fifth World Series, and then went into one of the longest championship droughts in baseball history."

Stated another way, for 86 years Boston fans rooted for their team. They pined for them, aching, hoping that they'd win again. That folks would give them the respect they deserved and see their team for what they are - winners.

After a few years of this suffering one may, without realizing it, begin to wallow a smidge. To enjoy it. Being an underdog can be kind of fun. If pain is fun for you.

However, after 2004, the Red Sox's curse, the "Curse of the Bambino" was broken after they won the World Series. Why is this significant? Because there is a whole generation of folks who didn't suffer rooting for the Sox. For them, the Sox have always won. It's easy to root for the Red Sox when they are winning.

Old timers don't like this. They try to remind young people that the drought, the pain, was clearly broken through the strength of their faith, but these protestations fall on deaf (young) ears.

Visual Basic programmers, historically, have tended to be a bit long suffering, patiently enduring the wrongs and difficulties of VB while being mocked by the C# folks. "VB's a toy." "VB's not performant." "VB programmers aren't real programmers."

But according to Paul Vick:

  • Visual Basic is the #1 .NET language (as reported by Forrester Research)
  • Visual Basic is the #1 downloaded and #1 registered Express Edition (topping the #2 position by 20%)
  • Visual Basic is the #1 MSDN language dev center and blog in terms of traffic

    Apparently the great VB Performance Scare of 2001 is over and people realize that VB code runs just as fast and capably as C# code. The young people don't remember the early years as VB programmers slogged on, Dim'ing and AndIfAlso'ing while others used curly braces and semi-colons while pointing and laughing. For a time, to love VB was to suffer. However, today, while VB may not be the #1 .NET language on the tip of your tongue, but it's certainly beat the Curse of the Bambino and earned the respect of the community as a first class .NET language, and apparently the most popular one as well.

    Rooting for VB isn't hard any more, just like rooting for the Sox. Rooting for C# is like rooting for the Yankees, therefore, I'm going to start rooting for the Cincinnati Reds, and for LOLCode. Both are going to go all the way.

  • If you liked this post, you might also enjoy these:

    Enjoy!

    About Scott

    Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

    facebook twitter subscribe
    About   Newsletter
    Sponsored By
    Hosting By
    Dedicated Windows Server Hosting by SherWeb

    The Weekly Source Code 12 - Back in Black Edition

    January 8, '08 Comments [21] Posted in ASP.NET | Microsoft | Source Code
    Sponsored By

    It's been a while since the last Weekly Source Code, but I have the holidays and the preponderance of baby poop as a fine formal excuse. I'm back from Paternity now and the Source Code will keep coming weekly as originally promised.

    If you're new to this, each week I post some snippets of particularly interesting (read: beautiful, ugly, clever, obscene) source and the project it came from. This started from a belief that reading source is as important (or more so) as writing it. We read computer books to become better programmers, but unless you're reading books like Programming Pearls, you ought to peruse some Open Source projects for inspiration.

    And so, Dear Reader, I present to you the twelfth in a infinite number of posts of "The Weekly Source Code." Here's some source I was reading while changing diapers.

    • Looking for applications that use WPF? They are out there and they don't always have "juicy buttons" and scream "I was written in WPF." Sometimes they are just clean, simple and functional. Witty is a Twitter (chat-esque) client written in WPF, a technology I have yet to fully grok.
      This little app has a simple Twitter Client Library that includes inside it a TinyUrl maker. (Google better buy TinyUrl or the whole web might get link rot) Sometimes it's fun to read source for the comments, but it's also cathartic to read code that you didn't write and say to yourself, "hey, this could use some refactoring." Perhaps a good time for you to offer to help an Open Source Project.
      This example is the most trivial chunk of code in Witty, but somehow it made me smile. Regardless, the MainWindow of Witty also had some interesting stuff, particularly the background fetching of data. It's definitely easier than WinForms.
      public void UpdateRelativeTime()
      {
           DateTime StatusCreatedDate = (DateTime)dateCreated;
      
          TimeSpan ts = new TimeSpan(DateTime.Now.Ticks - StatusCreatedDate.Ticks);
          double delta = ts.TotalSeconds;
      
          string relativeTime = string.Empty;
      
          if (delta == 1)
          {
              relativeTime = "a second ago";
          }
          else if (delta < 60)
          {
              relativeTime = ts.Seconds + " seconds ago";
          }
          else if (delta < 120)
          {
              relativeTime = "about a minute ago";
          }
          else if (delta < (45 * 60))
          {
              relativeTime = ts.Minutes + " minutes ago";
          }
          else if (delta < (90 * 60))
          {
              relativeTime = "about an hour ago";
          }
          else if (delta < (24 * 60 * 60))
          {
              relativeTime = "about " + ts.Hours + " hours ago";
          }
          else if (delta < (48 * 60 * 60))
          {
              relativeTime = "1 day ago";
          }
          else
          {
              relativeTime = ts.Days + " days ago";
          }
      
          RelativeTime = relativeTime;
      }
    • Folks are poking at C# 3.0 trying to get lambdas and anonymous type declarations to feel and act like Ruby hash table declarations. It'll be interesting to see if Anders is already on top of this. I wonder if he and Matz hang out? If I invented a language, I'd make a really exclusive clubhouse. ;)
      Eilon shows the difference between Dictionaries and anonymous types in his proposal:
      • This is some ugly code:
      Dictionary<string, string> values = new Dictionary<string, string>();
      values.Add("key1", "value1");
      values.Add("key2", "value2");
      values.Add("key3", "value3");
      GetHtmlLink("Click me", values);

      My proposal: Have the method accept a parameter of type object. Callers could pass in a type that has properties with the appropriate names and values. They can use C#'s object initializer syntax to save some space:

      MyParams myParams = new MyParams { Key1 = "value1", Key2 = "value2", Key3 = "value3" };
      GetHtmlLink("Click me", myParams);

      However, there was the added work of defining the MyParams type. Admittedly, it wasn't that hard with C# 3.0's automatic properties, but I hate defining types that are used in only one place. If the user can pass in an arbitrary object with properties, why not let that object be of an anonymous type? Here's the final code:

      GetHtmlLink("Click me", new { Key1 = "value1", Key2 = "value2", Key3 = "value3" });

      Woah! We went from five lines of code with dictionaries to two lines of code with object initializers (minus the type definition), to just one line of code with anonymous types!

    • Bill asks for better Dictionary Initializers, and Alex does it with lambdas in his post, giving him this clean syntax, and PhilHa weighs in with his thoughts. Bill says "Your inner Rubyist is nodding with approval."

      Dictionary<string, object> items = Hash<object>(Name => "alex", TargetType => typeof(Uri), Id => 10);
      Assert.AreEqual(10, items["Id"]);

    • If you're looking to do small GUI applications, you might take a moment to look at "Shoes" the tiny Ruby UI Tookit. Why? Well, if you're an old WinForms or new WPF guy like myself, (or an old Java guy, also like myself) it's helpful to other perspectives on what a Domain Specific Language for UI might look like. The sample source is here.
      Here are four different snippets in four different language that show a single button with a click event handler that shows a message.
      Here's the same thing in Shoes. Note that the documentation for Shoes is available as a Ransom Note. The creator never uses the acronym "GUI" in the docs or materials, but prefers to think of Shoes as a "toy." It's a pretty near toy, take a look at the 2D animation examples.
      Shoes.app {
        button("Press Me") { alert("You pressed me") }
      }
    • Rob (and lots of other folks) are exploring what UserControls look like in an ASP.NET MVC world. He says "Your UserControl can be one of two things: A granular bit of UI that renders information passed from a Controller [or] a granular bit of UI that renders information from an application-wide data source." He calls them a "Viewlet" and offers these helper methods:

      Rendering a ViewUserControl
      The
      MVC Toolkit has a nice method called “RenderUserControl()” that allows you to process your ViewUserControl and output it’s result inline:
      <%=Html.RenderUserControl(“~/UserControls/UserList.ascx”)%>

      If the ViewUserControl is typed (say ViewUserControl<MyControllerData>), then it’s ViewData object will be filled for you, and your ViewPage and rendered control will share the same data.

      If you want to be explicit about it, you can do that as well, specifying the data to pass:

      <%=Html.RenderUserControl(“~/UserControls/UserList.ascx”,ViewData.Users)%>

      Finally, if you need to set properties on the ViewUserControl, you can do that as well by passing in an anonymous type:

      <%=Html.RenderUserControl(“~/UserControls/UserList.ascx”,ViewData.Users, new {GroupID=2})%>

    Enjoy, and keep reading code!

    About Scott

    Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

    facebook twitter subscribe
    About   Newsletter
    Sponsored By
    Hosting By
    Dedicated Windows Server Hosting by SherWeb

    January 2008 PADNUG Meeting - Should you Fear MVC for ASP.NET?

    January 8, '08 Comments [10] Posted in ASP.NET MVC | Speaking
    Sponsored By

    I'll be down at the Microsoft Portland Office this evening (and you should too!) giving a talk on the new ASP.NET MVC Framework for the Portland Area .NET Users Group. I hope you are able to join us! Thanks to Rich and Team for putting this together.

    WHAT:
    January PADNUG Meeting

    WHEN:
    Tuesday 01/08/2008
    6:00pm Pizza
    6:30pm Presentation

    WHERE:
    Microsoft Portland Office located in Lincoln Tower
    10260 SW Greenburg Road
    Suite 600
    Portland, OR 97223

    TOPIC:
    Should I Fear MVC for ASP.NET?
    ASP.NET MVC provides model-view-controller (MVC) support to the existing ASP.NET 3.5 runtime, which enables developers to more easily take advantage of this design pattern. Benefits include the ability to achieve and maintain a clear separation of concerns, as well as facilitate test driven development (TDD). The ASP.NET MVC Toolkit provides HTML rendering helpers and dynamic data support for MVC.

    If you would like to get a jump on things, download the ASP.NET 3.5 Extensions from here.

    About Scott

    Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

    facebook twitter subscribe
    About   Newsletter
    Sponsored By
    Hosting By
    Dedicated Windows Server Hosting by SherWeb

    2007 Wrapup

    January 1, '08 Comments [9] Posted in Musings
    Sponsored By

    CIMG7842 2007 was a crazy year for us. The new year really hits me when I make a new folder at my house called \\server\photos\2008.

    In one crazy year I...

    • Quit my job as Chief Architect of Corillian and started work at Microsoft. Corillian had been purchased by CheckFree. Shortly after I quit CheckFree was purchased by FiServ. Oy!
    • Moved west (halfway between Portland and the Beach) and built a house with a nice home office.
    • Had a second son and we're exhausted. It's also hard to focus on work and what-not when the baby hasn't got his sleep thing down yet.
      • Anyone who goes on leave/vacation and comes back saying they are "energized and ready to get back to work" in insane. Vacation is a tease, showing you what retirement will be like. I plan on sleeping through, 24 hours a day, from age 50 to age 100, making up for my current lack of sleep.

    Here's a few blog posts of mine that didn't completely suck this last year. A greatest hits if you will. If you missed them, you might enjoy checking them out.

    You might also take a look at the complete blogging year of 2007 in a large calendar, or peruse the dynamic timeline. Also, go get on the Hanselman Blog Google Guestmap!

    Personal

    Reviews

    Technical

    Essays/Commentary

    Podcasts

    Here's to a positive new year for us all!

    About Scott

    Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

    facebook twitter subscribe
    About   Newsletter
    Sponsored By
    Hosting By
    Dedicated Windows Server Hosting by SherWeb

    Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.