Skip to main content

Essential Developer Tools - Part 2: Microsoft patterns and practise

There is a scene in Jurassic Park where Ian Malcolm (If I remember right, he is the mathematician/chaos theorist) criticizes Jurassic Park for not earning the right to clone the dinosaurs as they just "Stood on the shoulders of those before them". Well that may be true when working with millions of years old dinosaurs, but in development standing on the shoulders of the greats makes life better for you as a developer and for your clients.

Being a Dot Net developer means that those giants include the Microsoft patterns and practices team. Well what do they do?

We talk with a large number of Microsoft customers, partners, and consultants to understand the commonly occurring scenarios and the technical challenges associated with them. Then we discover and harvest the solution patterns and engineering practices (including anti-patterns) that have proved successful in addressing these scenarios.
Once we understand the scenarios and technical challenges, we work with product and technology teams across Microsoft, industry experts, and with customers and partners, to build guidance that reflects both the current, practical state of the technology and that is also aligned with future Microsoft technology plans. Often, the underlying scenarios and solutions guidance ends up influencing future Microsoft product direction.
Most of our projects are conducted in CodePlex communities. This allows continuous input from the development community at large and keeps us honest. We call this approach, “customer connected engineering” and it ensures that what we deliver actually meets the needs of our customers. We also ship the source code to nearly everything we deliver, usually along with a license agreement that encourages source level adoption and customization.

From http://msdn2.microsoft.com/en-za/practices/bb969103(en-us).aspx

That's great for marketing but for developers it means that they produce tools, frameworks and documentation (guides, proven practices etc...). My personal favorite from them is a set of components called the Enterprise Library which provides amazing code for logging (log4net eat your heart out), database access, exception handling, cache handling, cryptography, policy management (ala AD policies in your app) and validation. It really is amazing stuff. Two nice examples are the database application block, you can connect to a database, run a query and get the result in result set and close the database all following best practices with a tool to change the connection string (cause it's not hard coded so your users may need it) all in 2 lines of code! The validation block provides attributes to decorate your classes with to enforce validation with no additional code. You can get all of that from http://msdn2.microsoft.com/en-us/library/aa480453.aspx and much more from http://msdn2.microsoft.com/en-za/practices/bb969097(en-us).aspx.

.NET Framework 3.5 - Part 1: Where you can find it?

There is the logical place on the Microsoft site but if you installed Visual Studio 2008 you have it already (including 2.0, 3.0) all in 32 and 64 bit. Now in VS 2005 this was under the Visual Studio folder in Program Files. With VS 2008 it moved to being part of the Windows SDK, so you can now find it in (assuming you installed to default locations, else modify as needed):
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages

BTW one nice feature of using this version, is that you have all 60Mb already downloaded. So when you launch it, and it says you need to download a bunch of data - well you give it a second cause it doesn't.

Essential Developer Tools - Part 1: Reflector Plugins

One of the most powerful tools in a developers kit (and an essential for CCF development) is reflector. Up until now I always assumed (incorrectly) plug-in's added other language support. That is until I stumbled on to a great codeplex site. This site lists a large number of plug-in's be them on codeplex or not.

The site is: http://www.codeplex.com/reflectoraddins

Some of the nice ones there:

  • Code Metrics
  • Code Review Tools
  • Dumping of source code to file
  • Silverlight support
  • SQL 2005 (for CLR integration) support
  • Unit and mock testing
  • BizTalk Support
  • A few diagram and charting tools
  • Powershell support (as a language)

There are a lot of other nice ones but those are really great.

BioShock pt 2

In my previous post on BioShock I commented that the VitaChambers were a big gameplay issue for me since it made it far too easy. What I didn't comment on was how they broke the story completely. Why am I the only person who can use them? I know my character is special, but if I am so special that makes me the only one who can use them, why are they scattered around rapture like candy?

Thinking more into this, the answer to a lot of gameplay issues actually would be to drop the number of VitaChambers (2 per level, maybe) and seriously drop the number of bad guys. Then enable bad guys to respawn at the VitaChambers too, unless caught by a little sister (and thus drained of adam). This opens up some nice avenues of gameplay, one it slows it down a lot to enable you to actually be tactical. It lowers the number of bad guys allowing for more distinct-ness in them. It makes little sister harvesting an interesting issue, do you kill them early to get adam or let them run around as cleanup crews for and then only kill them later.

Despite that dream which will never happen, one nice thing has happened. A patch for BioShock has been released and does support turning off VitaChambers completely. More details on the patch at http://www.2kgames.com/cultofrapture/pcpatch.html

Visual Studio 2008 Install

So I had Visual Studio 2008 beta 2 installed and got my copy of the RTM media from Ryan today, so obviously I had to do the upgrade today. However I did have Ryan warning me of his experience with it (what made it worse was he didn't even have the beta installed). So I uninstalled the beta. Popped the disk in and it told me to uninstall the beta .Net 3.5 framework. Did that, ran the setup again and it worked, perfectly.

Dunno what else to say really. Normally these things are ammo for the annoyance tag but not today! However if you are unlucky like Ryan, read his post as he is getting some lovely info from MS on the comments.

BioShock

This weekend I finished BioShock and despite the 5 star review Gamespy gave it, I fail to see this as the next level of gaming. Note: Spoilers exist below.

Ok, I am no where smart enough to realize all the things going on in regards to objectivism that the staff at Gamespy did, and oddly enough the target market for gaming (I assume is 13 to 25 year old males) consists of a large portion who wouldn't get it. Maybe this is needed as gamers get older, but it doesn't mean we get smarter ;) Anyway the story was very good except for the inconsistencies in it, for instance the way Little Sisters are immune until you have to protect one (adding one line of dialog to cover this issue, feels like that scene from Thank You For Smoking where they have to justify smoking in space). These issues appear consistently in the game and are done for the sake of gameplay, but for a game which is supposed to be for the thinking man it really shouldn't have happened.

The look of the game is amazing, it is stylized perfectly with a consistent theme across the game but with each level having it's own unique feeling. The look of the enemies is also brilliant, I mean where can you fight a giant in 1940's deep sea suit with a drill for a hand.

The gameplay is fairly straight forward for anyone who has ever played a FPS, with few new elements. The combination of abilities, skills, weapons and mods all harken directly from Deus Ex (yes, and it copied it from System Shock) but with games that brought this before they were far slower and more thinking. BioShock has no issue to send 10 maniacs of different types at you at once. What this means is all those abilities to use different ammo or abilities come down to what ever you have loaded at that point, wasting what could've been a great system. The one difference to this is late in the game you lose control over your powers and randomly switch between them (even getting ones you never had before, breaking the story again), but this allows you to see what each power does and maybe change your mind about something late in the game. More of the game should be like this, especially the point where you become a Big Daddy, which basically means the difference is a stupid round screen rather than a square one and louder foot steps. 2k take a hint from Halo or Riddick, where near the end you get a big fun point (Halo has the warthog drive and Riddick the robot romp. Riddick's is better since it is the robot who has kicked your ass all round that prison). The gameplay has two points worth noting, firstly the camera which acts like a weapon (ammo = film) but each successful shot of an enemy, turret, drone etc... increases damage you deal to that type of enemy, or makes them less effective or gives you a new ability. It basically rewards you for taking time to do more than kill, or slowly attack your prey and get that good shot before the battle. The second gameplay element is not a good one, it's the vitachambers. These respawn you when you die, with actually more health than before and no penalty. Basically it removes the main stick from running headlong into battles and dying, in other words the complete opposite of the camera. In fact the AI is about as smart as a dog, since you can easily get them to follow you to the vitachamber so it becomes spawn -> shoot -> die -> spawn -> shoot -> die spawn -> shoot -> die, etc...

The AI is in fact smarter than a dog, but being built on the UT2k3 engine I would expect it into be better. Basically they attack stupidly (no squad control or use of cover), then when hurt enough run off to a medic station. If 2k seriously had one guy full time on water effect's why didn't they have one person full time on AI?!?

Anyway it is a much better game than Quake 4 or most of the crap that is coming out of the game studios, but it doesn't raise any bars.

Malawi +0days 19hours

Johannesburg International was a bloody joke. It's so tiny and so many many people. To get into the international waiting area took over an hour and too many queues. Oddly enough if anyone had a brain about processes the bulk of it could be done on a single queue, greatly improving the overall performance of the item, anyway that will be the topic for another post soon enough.

Once on board the shaky plane, I had the usual crap airline food, and bad landing in Malawi (Blantyre to be exact, if anyone cares). So upon landing I met the new baggage carousel, namely the ground next to the terminal building (glad I didn't pack anything breakable) and the most pointless forms ever (two forms, one for customs and one for immigration, both ask the same question but you have to fill in both. PHOTOCOPIERS PEOPLE!!!).

Anyway from the airport it was off to the local ex-pat/backpackers pub for drinks, food, watching SA beat New Zealand in the cricket etc... all and all a nice evening. The fact all dogs wear a muzzle (it's law here) is a little scary the first time you see it (Silence of the Hounds?).

The humidity is another issue all together, I doubt I have sweatted this much in years. My hotel room (in the nice Mount Sosche Hotel) thankfully comes with aircon. It didn't come with water last night, due to an ongoing supply issue, but by this morning there was at least cold water. The area is really beautiful, very tropical in nature (reminds me of the north coast in Natal) and we are surrounded by mountains on all sides.

The biggest fear people seem to have when coming here is the malaria, however I have a new one. I am working for a telco here and there is the transmission station 100m from my desk. It's so powerful it kills the electronics of cars if the park too near it and here Mulder thought only UFO's could do that. The scary part is that I hope my third arm grows out the front and not the back, like a weird tail.

Oh and the bandwidth here  is killer, it's like how fast would you like to go. Telkom, you bunch of clowns, come to a real third world country to get some lessons.

Windows Vista Power Button

In Vista there is the shiny new start menu with the shiny new turn off options, and until recently I have been using the fly out menu on lock to hit sleep or hibernate or shutdown etc... Thankfully I have gotten over that through two dumb luck experiences.

Firstly my home box I have been hitting the power button since it is quick to resume and I don't really worry about things. I always just thought it was putting it into sleep, well this weekend I stumbled across a new feature in Vista (well new to me) called help. It's amazing, it's like Google for windows off line Laughing

Seriously, in the help feature I found an article on what the power button does. Basically if you have an old machine the power button puts it into sleep. However if you have a more modern it puts it into hybrid sleep. This new mode, works like both hibernate and sleep in shutdown (i.e. it does both). Then when it needs to start up again it checks to see if the memory still contains the information (i.e. sleep mode) and if it does restores damn fast from that. If it doesn't contain (say due to power loss) then it restores from the hibernate information.

The power button is the ONLY way in the Vista interface to do this!

To check if you can use this or to turn it on/off go to power options (either off the battery icon in the task try or in the control panel), click Change Plan Settings on your selected power plan, next click Change Advanced Power Settings and under sleep you will see the options (see the attachment of this post for a screen shot).

File attachments
hybridsleep.png (41.01 KB)

RegularExpressionValidator Designer Will Die

Working with Microsoft software is often a ride of highs and lows. Highs caused by a tiny feature which changes your life. These tiny features are the spark of genius from some lowly dev in Redmond which makes the magic happen (my favorite is the fact you can copy and paste the MSCRM license code into the installer and fills in all the blocks at once, not just the first block like other installers. Office 2007 has a similar good idea).

However there is the other side, the lows of the idiot. The people think about problems so much they forget how the rest of the world works/sees there item and thus makes it work in odd ways (MSCRM team bastardizing relationships in 3.0 to build certain things. Thankfully fixed in 4.0).

Today though I met another one of these issues, the RegularExpressionValidator in ASP.NET. You give it a RegEx to validate against and guess what it validates against that. Good, expected, normal. Here's the issue, leave the field blank or put only spaces in the field and BOOM! No validation! The workaround, and it is a workaround since this is supposedly by-design, is two validators per field (RegEx and Required!). I mean for heaven sake this is retarded. There is no reason why it should be like that, and if there is WHY OH WHY is there no property to make it work logically/illogically.

Let it be said that if I find you, Mr RegularExpressionValidator Designer Guy/Girl, you will pain for the torture you have caused me to go back through every field in my app and add another validator!