As developers, we usually have these things (file most of these under ‘duh!’):

  • well powered desktop machines. OK, mostly desktop. Maybe you’ve got a big honkin’ laptop-with-great-specs-but-called-a-desktop-replacement.
  • a need to deploy/test/mess about in another machine. You don’t want the cruft of your development machine to get in the way of the operation of your target environment.
  • the desire to test out a new tool: a beta/RC OS, a new beta of Visual Studio, a new server product (SVN), a community technology preview (CTP), or some other package that you just don’t want to push to your current Dev server. Hands up if you even have a ‘Dev’ server other than your machine?

In the last 4 years, I’ve usually run into something dev-related that I really wanted to get my hands dirty with. Yes, the shiny-object developer syndrome. The old way was to install that piece on your Dev machine. Months would go by, and you’d (theoretically) dirty up your registry, and contribute to the eventual slowdown of your Windows install. The logical solution at that point would be to format and repave your Dev machine. Looking forward, and a bit contrary to the point I was just making, I don’t get the sense that Windows 7 will succumb to the bloat and eventual slowdown. That said, it doesn’t invalidate the need & convenience of virtualization.

Free & Many Options

Enter the full on assault of free options for virtualizing operating environments. We really have an embarrassment of riches. Perhaps I am late to the party, but the freeness of the VM solutions is jolting:

My Fave Virtualization Platforms

Doubtless you know the benefits of running VMs. Lower TCO in terms of number of physical metal boxes, lower cost of electricity to power and cool, etc. For me, it’s the ability to pop (uh, Remote Desktop) into a new machine on the ‘network’ and install/configure/test whatever I am working on. The ability to mount ISOs for OS and app installation is just another kick ass speed benefit. Even better are the instances where you can download a pre-configured VM. Check out ALMWorks’ turnkey Bugzilla and Subversion virtual machines.

Sun VirtualBox

sun_virtualBox Great product here. Easy creation of virtual hard drive disks, mount ISOs, and a nice looking application overall. Its config files are all XML, and messing around with file locations is easy. The one thing about VirtualBox is that it doesn’t run VMs out of a single window, but rather opens a new window in your (in Windows anyway) taskbar. This is different from VMWare, likely due, in part, to VMware being headless.

My big want out of VirtualBox is the ability to run headless. It’s the one big feature that would allow me to adopt it as my one and only VM product on the Developer’s machine. Sun releases this product for Windows, Mac and Linux hosts, and I think they’ve done a great job. The release frequency is stunning! Keep up the good work, Sun! 8/10

VMWare Server

vmware-server I first got into VMWare Server as I was encouraged to run Windows 2003 on the job. Previously I had only used the Microsoft Virtual PC products, which were decent. The killer bit that won me over on VMWare Server was that it is HEADLESS. The machines can startup and shutdown in parallel with your host OS. Excellent feature for those who would expect those services to be up 100% of the time that your dev machine is (Dev or Test SQL Server, Active Directory services, build machine, etc). This is basically gives you the Ron Popeil method of running additional machines: set it, and forget it (curse you, 90’s infomercials).

The kicker for me today is that VMWare does NOT make Windows 7 64-bit signed drivers. Absolute killer for me during the Release Candidate of Windows 7, and still today at Win7’s release. Reading the forums and related searches, it appears there were hacks for Vista 64, but the important part here is that Microsoft REQUIRES signed drivers for 64 bit systems today, starting with windows 7. VMWare, please! Get those signed drivers out!

There’s one thing about the latest releases of VMWare Server that gets me. The 1.x versions all had built in console on the host where you defined/configured/started/stopped your VMs. It was a nice presentation with console UI elements coming in an .exe. The 2.x releases have moved to a web-based console. I much preferred the 1.x presentation.

I’m still using in on the job with Win7 32-bit, and it works well! 9/10

Microsoft Virtual PC

virtual_pc This was my first foray into VM’ing. I think XP was the modern OS at the time, and it was a great introduction to testing out changes or running other apps that I didn’t want on my machine. The kicker again here was that the system was not headless. Today, you’ll run Virtual PC 2007 on XP or Vista hosts, while Win7 has the ‘year’ moniker dropped.

The biggest one was a Toshiba voicemail/PBX management app that ONLY ran on XP machines that were NOT on a domain. What a pile of disappointment. The phone technician who installed the system had to be called out every time the company wanted to adjust the phone system (change a number, a name/label on the phone’s display, or any options on the phone system overall). It turns out he simply was running this web app on IIS on his laptop. He just needed to tweak the IP address in the app to match the customer’s phone system. One day I asked him how to DIY, and he suggested to run this web app on my machine. It was a perfect candidate for virtualization. Thanks MS Virtual PC 2004! 7/10

VMWare Server ESXi

vmware-esxi This is a free hypervisor product. Really it’s the entry-level product within the hypervisor line. It allows you to deploy multiple VMs on a machine and incur just a small performance penalty for the host OS. The licensing cost is zero. It runs a Linux kernel, and its footprint is ~32MB! Hmmm… could you install that to a USB thumbdrive? So the real benefit here is that you don’t have to worry about the license for your host, nor the overhead of the host.

My next project will be to take my 4 virtual machines and deploy them to a machine running ESXi. How cool is it that VMWare makes it free? Your only limitation at this point is the amount of RAM and disk space (hardly a limitation today at 7 cents per GB on a SATA drive). The product is a downloadable ISO. You boot into its setup app, and from then on, you use the console application to communicate with it.

Also-Ran

The new hotness is Virtual XP with Windows 7. It’s not really a multi-machine solution, and as a developer, it doesn’t do much for me. I am surprised that they are doing the ‘Remote App’ thing in Windows 7, and definitely applaud Microsoft for it! XP, however… 2003 called, and it wants its… oh, nevermind!

How have *you* leveraged virtualization as a developer?


Posted in: virtualization , windows 7 , green it , cost savings  Tags:
Actions: E-mail | Permalink | Comments (0) |
Phil posted on October 14, 2009 19:37

Paul Thurrott posted something that I had missed on Channel 9: A documentary on the evolution of Visual Studio. I took the time on a Sunday night to watch both parts (Part 1 and Part 2)

Part One

The first part was a look back at the early-mid 80's: MS-DOS, green-screen, OS/2 + IBM, and the arch of Visual Basic from version 1.0 through 5.0. One thing I did NOT know was that Alan Cooper's prototype of VB was called Tripod, and later Ruby. Cooper talks about the presentation of Tripod to Microsoft reps., "Gates-clones" as he calls them.

cooperRuby-Tripod

It was interesting to me that he scoffed "… like Microsoft would care about something like this."

Some of most interesting bits were around the culture or atmosphere at Microsoft - "pulling more all-nighters at Microsoft than I did at University" was telling. It makes sense - the stakes are much higher, and the environment more professional. It reminded me slightly of Barbarians Led By Bill Gates by Edstrom and Eller. (great read!)

Microsoft was incredibly focused on building a developer community. I feel they've done an amazing job at this, and they really are unparalleled in this respect. I've seen it first-hand at various DevDays.

They traced the evolution of Visual Basic from VB3 to VB5. One interesting part for me was the comment that "you could compile an application as an executable, which was a really big deal at the time." 

Part Two

hotjava   

The second part was a tracing of the genesis or development of C#. The impetus for the new language was due to Java. In 1996/1997, Java was the hot new kid on the block with the promise of 'write once, run anywhere' on other computing platforms.

 csharp

C# was then conceived from the lawsuit and forced failure of Microsoft's implementation of their own Java VM and Visual J++. The fact that Microsoft had the market-leading Java dev toolset at the time, and then extended further with C# is amazing.

 anders

guthrie

C# is inarguably the tool that helped win more developers over to the .NET platform from the Java space. Some great shots of the 2000 PDC with Scott Guthrie presenting. It really highlighted the war with Java in the early 2000s, and how Sun just got crushed. I say: "Thank goodness!" I loved the time-to-market and LOC graphs around Microsoft's copy of the prototypical Java app PetStore.

petstore

 

The video led into some self-criticism about some Visual Studio attributes like performance, the help system, the Ladybug defect/feature website, etc. Lots of talk about how Microsoft wants to connect with its customers, and wants to be more transparent to its customers.

Part 2 then devolved, in my mind, into a sales pitch for VS2010, Team Suite, and Azure. I guess I am not too surprised :)

Some of my favorite lines (Alan Cooper is full of them!):

  • "It (Visual Basic) a very different thing from what I had originally set it out to be. It's like sending your son to college, and he comes back graduating with honors and a sex-change." says Alan Cooper.
  • "I think Basic is a terrible language. Nothing more than FORTRAN with a dress on it. It's a language that should be dragged outside and shot." says Alan Cooper.
  • "C++ - a terrible, terrible language. An awful language… basically un-learnable… not a tool for the masses." says Alan Cooper.
  • "C# - is most of the magic of C++, with a lot of the simplicity of Visual Basic combined" says Dave Mendlen
  • "You don't have to be a genius to be an application developer." - Tim Huckaby

Overall it wasn't as much a "history" of Visual Studio as I had expected. I had expected to hear more fine-grained details about how the product was built/merged. It's definitely a worthwhile watch. Check it out for yourself!

Part 1 and Part 2 of The Visual Studio Documentary at Channel 9.


Posted in: visual studio , microsoft  Tags:
Actions: E-mail | Permalink | Comments (0) |
Phil posted on October 12, 2009 05:43

Damien Guard was nice enough to blog about changes coming to L2S in VS 2010. Rather, the changes are coming in the .NET Framework 4.0.

The whole rumor within the development community/blogs about "Linq To Sql is being unsupported, Entity Framework is the new coolness" was just plain wrong, I believe. Microsoft is too big, and has too many projects on the go. They'll gauge the momentum of both technologies. Have you heard Damien as a guest on Herding Code Episode 50? In this blog post, Damien says that the focus for Microsoft will be on EF, and that's fine. L2S is definitely not dead!

I still believe that if you're needing an ORM, and working with SQL Server, then use Linq To Sql. I've tried EF, and it worked fine. I've ended up with 4 projects using L2S, and haven't found any real need for EF.

Welcome Defect Fixes in coming in .NET 4.0 for Linq-To-Sql

For me, the most interesting changes within Damien's post are:

* Contains() with enums automatically casts to int or string depending on column type

* String.StartsWith(), EndsWith() and Contains() now correctly handles ~ in the search string (regular & compiled queries) - Here's a small defect. I've not needed to search for tildes very much, but I decided to give it a shot just in case! It's true, the behavior is just as described!

tilde-2

tilde 

 

* Now detects multiple active result sets (MARS) better - I am not the heaviest user of L2S, and definitely haven't needed to specify MARS myself. Here's the MultipleActiveResultSets defect as reported on MS Connect. It's a simple issue where the connection string property "MultipleActiveResultSets" is only picked up when CamelCased exactly as shown above. Any deviation will ignore the option!

* DeleteDatabase no longer fails with case-sensitive database servers - Interesting that this functionality even exists. I had to research this method - DataContext.DeleteDatabase(). I can't recall actually seeing it in the Intellisense method list, but indeed it's there! Most blogpost or articles that I read in that 5 minute span were talking about using this method for tear-down during "Unit Testing". I'd call that integration testing, and ill-informed as well. Unit tests should not include databases!

DeleteDatabase

* VarChar(1) now correctly maps to string and not char - This one has bitten me before. The column was called Gender. Of course it was storing M, F, T, or U for unknown. The core of the problem was that some rows were having a blank stored in this field, rather than null. StackOverflow to the rescue! http://stackoverflow.com/questions/1190328/linq-to-sql-exception-string-must-be-exactly-one-character-long. After some thought, I'd agree that storing this value as char(1) would be semantically more correct, more performant, and consume just one byte per tuple.

varchar

len zero 

* Decimal precision and scale are now emitted correctly in the DbType attributes for stored procedures & computed columns - I couldn't reproduce this defect, and perhaps I misunderstood.  I defined a decimal(18,5) attribute on the table, and L2S brought it back without any problems. Then I realized the key to this defect was probably the 'computed' bit. So I went and created a simple decimal return type. I ran the query, and still no defect.

computeddecimalsOK

Then I clued in - the defect was under the Linq To Sql Designer heading. So upon further inspection, here's the defect in the myL2S.designer.cs. The return type is calculated as decimal(0,0). Ouch! :)

  decimalzero

* Foreign key changes will be picked up when bringing tables back into the designer without a restart - This defect has hit me a few times as well. It appears as such:

  • Edit a FK in SQL Server. If you've got an open L2S file, deleting + dragging and dropping those tables back onto the L2S surface DO NOT show your FK changes.
  • Clicking the Refresh button in Server Explorer doesn't help.
  • The only solution is to close your L2S file, and re-open.

* Changing a FK for a table and re-dragging it to the designer surface will show new FK’s - this is very much related to the item above.

* Opening a DBML file no longer causes it to be checked out of source control - this has appeared to me a few times. Simply opening/viewing the L2S file creates a 'check out'. Nothing earth shattering here, and glad to see this is fixed.

* Can edit the return value type of unidentified stored procedure types - This feature is great! It's very helpful when you've got a sproc that shapes data just the exact perfect way that you'd like to show on a custom report. Perhaps you're binding to an asp:GridView or including as part of an MVC FormViewModel. The normal course of action is:

  • Create your sproc to shape your data as you like

    Sproc-To-Custom-Object

  • Drag a sproc onto the Methods section of the L2S designer.
  • Try change its return type to a class you've created solely for the purpose of binding

  • Oops, it's locked!

    locked

    The work around is a bit time-consuming. You have to:

    • open up the myL2S.designer.cs file

    • find your method marked with the attribute containing your sproc name

    • replace the default return type int with ISingleResult<T> - in my simple example here, it's ISingleResult<CustomerReport>

      modify dbml

    The frustrating bit here is that this behavior isn't predictable (to me at least). I CONSTANTLY have to go through this process to properly set the return type of 2 sprocs in one particular project. This defect fix in particular by Microsoft will be welcome!


Posted in: linq-to-sql , c# , microsoft  Tags:
Actions: E-mail | Permalink | Comments (0) |