Scott Hanselman

VB.NET and C# - Duplication of Effort?

January 17, '06 Comments [11] Posted in Ruby | Tools
Sponsored By

Patrick Hynds recently used a military analogy to contrast C# and VB.NET and their growing and increasingly obvious similarities. (I've always thought that the differences were just skins over IL myself.) Rocky Lhotka extended the analogy brilliantly:

The problem we have today, in my opinion, is that C# is a flying tank and VB is a heavily armored attack plane.

Microsoft did wonderful things when creating .NET and these two languages - simply wonderful. But the end result is that no sane person would purchase either a tank or an A-10 [ed: a plane] now, because both features can be had in a single product. Well, actually two products that are virtually identical except for their heritage.

Of course both hold baggage from history. For instance, C# clings to the obsolete concept of case-sensitivity, and VB clings to the equally obsolete idea of line continuation characters.

Unfortunately the idea of creating a whole new language where the focus is on the compiler doing more work and the programmer doing less just isn't in the cards. It doesn't seem like there's any meaningful language innovation going on, nor has there been for many, many years... [Rockford Lhotka]

Personally at this point, I don't see a reason for us to have two languages other than we always have. It started with C++/MFC versus VB1/2/3 in the early 90s and we'll never come back together. Some folks think that this is good because humans crave choice. Others think it's just wasting time and effort as we design language and development tools twice.

There seems there's always a need to have vanilla out there to balance out chocolate. Take a look at Billy Hollis' Tongue-in-Cheek "History of BASIC" and "History of C." Personally, I'll write in any language that makes me productive. VB.NET, Ruby, C#, Zulu, Amharic or Spanish. It's all just a way for us to express our intent to the machine.

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

Z's first all-nighter

January 17, '06 Comments [2] Posted in Z | Diabetes | Speaking | Movies | Gaming
Sponsored By

It's 5:31am and Z just now went to sleep. We suspect caffeine drank (by Mom) unsuspectingly earlier, but who knows. So, I'm listening to Chris Sells on .NET Rocks and here's a random collection of links of other things I'm reading this morning.

P.S. And here's some fresh Z photos just for good measure.

CIMG4318 (Large)  CIMG4286 (Medium) CIMG4342 (Large)

Now playing: .NET Rocks - Chris Sells on Model-Driven Development

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

First Person Shooters on the PSP

January 16, '06 Comments [2] Posted in Reviews | Z | Gaming
Sponsored By

Z is fast asleep on my lap, and I'm trying to find a PSP 1st-person shooter that doesn't totally suck. Of course, I bought my PSP as a TV and Portable Media Center, not a gaming system. But, when you've got a kid asleep on your lap at 3am, somehow you find yourself wanting to blow 15 min with a game now and again. Maybe that's just me.

Here's the three I've got.

  • Codedarms1Coded Arms - I got this at the same time I bought the PSP. There were few games around an a hacker-themed 1st-person seemed like a no brainer. It's got gorgeous graphics, seriously. Detailed and beautiful. The first level is amazing. However, all subsequent levels are the same level. Never since Mario Bros. (Not Super Mario, people, just Mario Bros.) have I seen a game with such similar levels. I got bored after level 3 and feel asleep. It's a shame because the theme had such potential. You hack from level to level and get upgrades while fighting viruses. Sigh. For sale: $15 or buy me lunch a few times.
  • Starwars1Star Wars: BattleFront II - Got this for Christmas, it was on my wish list. It was a great Xbox game, how couldn't it be a great portable game? Well, let's start with an unspeakably obscure control schema that makes virtual no good use of the single analog stick and quite lousy use of the shape buttons. The guys I'm trying to shoot are always just above or just below my view. I literally can't get past the second Hoth level. Folks on the boards insist that this is a great game with some really great spaceship levels, but I'm too much of a putz to get that far. I've almost given up on this game. As I write this, I'm wondering if I was too harsh; I may try again for a few minutes. Seriously, though, it's got Castle Wolfenstein quality graphics (Not Castle Wolfenstein 3D from your 286, I mean Castle Wolfenstein from your C64. Achtung!)
  • Socom1SOCOM: Fireteam Bravo - I received a gift card from Cingular for $30 as a rebate and promptly squashed it on this game. Now THIS is a game. It's like Splinter Cell + Hitman + Rainbow Six. Many times while playing I thought I was, for a moment, playing one of these games. It's that broad in it's appeal. Some missions have you not shooting anyone, instead collecting digital photos of conversations between spies. Others have you sneaking into a compound to rescue the VP of Chile, while still others are more battlefield focused. That's just the single player game. What's amazing to me is that it supports online wi-fi multiplayer (via a poorman's Xbox Live that is specific to this game) with a headphone attachment. On a freaking PSP. Now THAT'S 2006 baby. The single player is well done, with excellent pre-rendered cut scenes with missions in locations like Chile and Morocco. And, get this, the folks in the cut scenes and the folks you fight actually speak the local language. I like that they recorded many minutes of Spanish and Arabic and included subtitles. It did give you the sense of traveling around the globe to different locations - and the maps are HUGE. It's not as pretty as Metal Gear: ACID (an almost un-playable, but truly gorgeous game) but it's tight. The controls are clean and feel natural after a few minutes (even though having a single analog stick ISN'T very natural.) You're graded on mundane things like accuracy to more "soft" skills like teamwork.

If you really want to know what the "Halo 2" killer addictive game is on the PSP, experience Hot Shots Golf for yourself. I love the single player career game. If I see you around and you've got a PSP with Hot Shots, let's play an ad-hoc multiplayer game, eh?

Now playing: Freshlyground - Human Angels

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

NUnit/Watir/Ruby Test Integration

January 14, '06 Comments [2] Posted in ASP.NET | Ruby | Watir | NUnit
Sponsored By

Travis Illig took my NUnit/Watir integration POC and ran screaming down the street with it and has released his code on CodeProject. There are also some other integration projects in a similar vein going on that I'll post about later.

Travis' solution is clever in it's use of attributes. It does everything automatically that I did manually with resource extraction. The easiest way to grok it is to look at a sample NUnit test you'd write:

using System;

using NUnit.Framework;

using RTE = Foo.RubyTestExecutor;

 

namespace Foo.Test

{

    [TestFixture]

    public class RubyTestExecutor

    {

        [Test(Description="Verifies you may run standard NUnit-only tests.")]

        public void NUnitOnly_NoRubyAttrib()

        {

            Assert.IsTrue(true, "This NUnit-only test should always pass.");

        }

 

        [RubyTest("Foo.Test.Scripts.RubyTest.rb", "test_Valid")]

        [Test(Description="Verifies a valid Ruby test will execute.")]

        public void RubyTest_Valid()

        {

            RTE.ExecuteTest();

        }

 

        [WatirTest("Foo.Test.Scripts.WatirTest.rb", "test_Valid")]

        [Test(Description="Verifies a valid WATIR test will execute.")]

        public void WatirTest_Valid()

        {

            RTE.ExecuteTest();

        }

 

        [RubySupportFile("Foo.Test.Scripts.supportfile.txt",

            "supportfile.txt")]

        [RubySupportFile("Foo.Test.Scripts.SubFolder1.supportfile1.txt",

            @"SubFolder1\supportfile1.txt")]

        [RubyTest("Foo.Test.Scripts.RubyTest.rb",

            "test_RubySupportFile")]

        [Test(Description="Verifies Ruby support files can be extracted.")]

        public void RubySupportFile_Valid()

        {

            RTE.ExecuteTest();

        }

    }

}

It's the ExecuteTest() of course that does all the heavy lifting by walking the call stack looking for Attributes and acting on them. Check out his article and get involved.

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

Clicking a JavaScript Dialog using Watir

January 14, '06 Comments [2] Posted in Ruby | Watir | Javascript
Sponsored By

There will soon be an easy way to click and generally deal with JavaScript Dialogs with Watir (Web Application Testing in Ruby, pronounced "WATER"). It's always been possible, but the team is working on ways to make it easier. Until that day comes, we use the old way. Mark Cain posted sample code recently on the Wtr-General Mailing List. I'd been meaning to post my code that fires up another Ruby "thread," but his is arguably simpler if not slightly brute force. Thanks Mark!

#Put this method in your script:

def startClicker( button , waitTime = 3)
   w = WinClicker.new
   longName = $ie.dir.gsub("/" , "\\" )
   shortName = w.getShortFileName(longName)
   c = "start ruby #{shortName}\\watir\\clickJSDialog.rb #{button}
#{waitTime} "
   puts "Starting #{c}"
   w.winsystem(c)
   w=nil
 end

#Then call it right before you click the button (or whatever) that
causes the javascript popup to display:

startClicker("OK" , 3)
$ie.button("Submit").click

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.