First Azure Worker Role

June 1, 2009 2 comments

Here are some of my findings around Microsoft’s upcoming Azure platform. I initially thought Amazon had it in the bag with EC2 but to be honest, I’m tired of running my own servers. Google’s app hosting is ok, if you like Java or Python technologies – which I do but I thought I’d try the full Visual Studio approach :)

I’m using Visual Studio 2010 Beta 1. First gotcha, I wanted to run my work role and was told I had to be running VS as administrator … boo really? Wasn’t that a freaking Vista problem. This is Windows 7 RC1 people!

image

If you’re not running SQL Express you’ll need to reconfigure the local data storage services, which have those lovely hidden options buried in a .config file. Thanks to the link for the location. (Changing Development Storage)

Get it right and you’ll get this nice little local storage window the first time you run something:

image

When your role gets running, you can load up the fabric UI to actually get control of your own Azure cloud. All this without having to actually deploy to the cloud yet. Pretty neat. Remember that a role is basically like a console application in the cloud. Here is my little default application running, the output is just like a console window:

image 

So what comes next? I’m going to try embed my Amazon Simple DB provider and S3 library into a real role and throw in some workflow for fun. Might as well push it right :) I’ll also be fetching some data from AQS. (Amazon Queue Service). I’ve read a fair bit about thread issues or at least limits on how many instances of a role can run.

Right now I believe you’re limited to 1 instance of a role which kinda sucks. You can have threads which is fine but still puts severe caps on application scale capacity.

A warning about test driven development

June 1, 2009 1 comment

Oh wow did someone really say something bad about TDD … I mean what could be bad about this latest fad ;-)

So testing your code is of course a good thing. Anything these days to help us write better code is a good thing but definitely in moderation. I’d say with all the work going into TDD and I’ll later explain my thoughts on DDD, people are once again on the search for the holy grail of software engineering. It doesn’t exist, get over it – software engineers are artisans by definition and that is because our skill is extremely creative and you can’t wrap it up in a process to make it perfect.

What bothers me with TDD is the amount of effort being placed on “passing the test”. It is one thing to make your code easier to test but a totally different thing to engineer your entire application, just so it can be tested. Is your client paying you $$ per hour to have something that can be tested or something that works?

What about dependency injection. A hot subject for allowing the injection of mock objects or testable objects into code. My question is, if you inject a mock object into a test – is the test really real? Now inversion of control has its place, like most patterns, but I warn you against thinking you’ll now have perfect code if every class is instantiated through an IoC container.

So when it comes to application architecture I urge you to use some common sense. Pick patterns that solve problems you really have. A lot of code can be tested just fine without DI. A facade is often simpler for centralized code. Here are the general rules I would suggest to keep you on track:

  1. Build an application that meets the requirements first!
  2. Make sure it performs and scales well.
  3. Make it easier to test! but not a requirement if it means major architectural changes.
  4. If you can’t automate your test, like many user interfaces – use a person, they’re called QAEs!

You don’t have to like it but too many developers forget what the point of the code is to start with. Not to pass tests but to do something cool :)

Visual Studio 2010 Beta 1

May 25, 2009 No comments yet

Yeah I guess the title sums this up. Reminds me of how ridiculous it was when VS 2008 was launched and wouldn’t run on Vista …

I tried to get this up on Windows 7 RC1 and it installed fine but when it loads the screen doesn’t paint correctly. After a few clicks I just get the frame of the IDE and nothing else … freaking joy.

I _might_ be related to running in a virtual machine but either way it should work otherwise I’ll be stuck with VS 2008 for quite some time.

edit: I knew this would come back to bite me, no point hiding it. The readme has the solution about vmware 3d acceleration issues. Turn it off and you’re good – not a great solution but still a solution. I’m not sure who is to blame for the issue.

IPhone applications and objective-c

May 19, 2009 No comments yet

So I wanted to post a little about the things I’ve found now working with Cocoa and the application I chose to target first was an iPhone application. I haven’t really had much time to dig into a native mac application yet.

Firstly lets talk a little about XCode. This great IDE comes free when you own a mac – pretty cool. Unlike Visual Studio which must be purchased if you want anything besides the free version. XCode is a great IDE, it is fast and simple enough to use. Apple has included everything you need including performance and memory profiling tools.

The extensions to support iPhone development are totally seamless so that was a nice find. Once I started getting into objective-c I thought my eyes were going to bleed :) Really, it is too old. The future is with managed languages and the thought of any form of memory management is pretty lame but right now, I have no choice. If you want an iPhone application you’re going to be using obj-c.

The language did have a couple positive points, at least what I’ve discovered so far. The way it passes around messages is a cool idea. Parameters are named when passing values to a method. (msg) – this makes for more coding but it makes it a hell of a lot easier to read the code later.

I did like Apple’s take on controller and view separation. Even using a separate tool for the interface design is a great way to keep the UI developer out the controller code. Up until Microsoft released the new ASP.NET MVC framework all views and code behind files were tied together. Unfortunately for traditional ASP.NET and WinForm development this is still true.

So right now I’m impressed and enjoying the development process. I think Microsoft could learn a few things from Apple however …. I do feel strongly that Apple need to connect the dots and that their code needs to move to a managed environment. They could adopt Ruby more rather than just supplying the API bridge.

Rails, Grails and .NET MVC

May 3, 2009 2 comments

We certainly do have a lot of choices when building applications these days! :) Here is a little insight into my latest project application choice. It might or might not work for you and it is not intended to be a guide per se since as good programmers know – pick what makes sense for your application.

I needed a new web application that was only going to be used for internal administration and so I could do something fun and not care about how it scales. Here are a couple key requirements so we can discuss over them. Firstly, I need page authentication and I have no need for a database since I’ll use SimpleDB so the DAL isn’t as important.

My initial thought was, lets just roll with Rails since in the last couple months I’ve been doing a lot of R&D using Ruby and Rails however I recently started some work on Grails and so the decisions begin.

Let me prefix first by saying I could have built this using .NET MVC and I believe that would have been the fastest way, sorry but it is – that isn’t bias for Microsoft just a fact especially since my skills lie heavily in that area … but I wanted something more fun :)

ASP.NET MVC

  • Easy to use for sure, especially if you’re already a .NET developer.
  • Tools are fantastic.
  • Authentication is as simple as using the [Authorize] decoration on your controllers.
  • Data is via an existing SimpleDB Provider I wrote.
  • Doesn’t run well on anything but IIS
  • No exposure to other technologies <- the fun part :)

Ruby on Rails

  • I think Ruby is pretty easy to learn.
  • The tools are getting better – don’t be a hero, use and IDE like NetBeans/Eclipse.
  • If you have complex database requirements activerecord is going to be painful for you.
  • I’ve found the community a bit broken with Rails, you can generally get help but not always the easiest to understand.
  • Far too many depreciated gems floating around and even the Rails wiki is out of date.
  • As for authentication, well nothing easy to find – does require more code than I’d like. Not sure what is best.
  • SimpleDB access was OK but not great, relative name spaces break when importing classes while using Amazon libraries so that wasn’t cool. Had to hard code some paths.

Grails

  • Just started R&D on this and I didn’t feel like jumping into Groovy although it is close to Ruby I’d rather learn one new thing at a time.
  • Does have the huge benefit of running on the JVM and also being able to use existing java classes.
  • Can be deployed on well established application servers, so that is great.
  • Tools are ok, new at this stage but Netbeans seems to do the job.
  • Authentication is ok, there is a good plugin but still requires far too much code for my liking compared to .NET
  • I can’t find a Grails/Groovy SimpleDB library but there is one for Java so I guess I can just use that.

and then I found ….

JRuby

  • Will allow me to keep on the learning curve with Ruby but
  • Lets me deploy in single packages and do java application containers.
  • Exposes me to more java technology.
  • Tools are pretty good and I’m using NetBeans right now.

So that kinda sealed the deal. I wanted something fun and like Ruby so JRuby lets me keep that knowledge but also I get better exposure to Java technologies. You might wonder, “If you want Java exposure why not use JSP or similiar” … right, no thanks :) Keep it simple!.

I’ll post when I’ve deployed my first working JRuby application and I plan to run it on Tomcat/Ubuntu 9x.

Why you should never buy Winzip!

March 8, 2009 1 comment

And no, not because it sux :) I like it, it works well and does handle massive numbers of files with good compression.

The story goes as follows – after using some form of Winzip since the dawn of time I decided I’d like to do my bit and buy my own license. I mean it is just $30 (or was!) and so off I went happy to have my own license.

Well that was on Winzip 10 and after some security updates, they now have version 12 out. So what is the problem? They suck, not the software – the idiots running the company. I can no longer download version 10 of the software that I OWN. If I want a download I’m forced to upgrade to version 12, which isn’t going to happen. If you can’t make money as a company, squeezing it out of existing clients is a really bad business model. This coupled with the fact I get spammed by Winzip and 3rd party crap really grinds my gears. (ref: FG) <- duh

So, I’m now going to “attempt” the same thing with WinRar – buy a license and go on my merry way. I doubt those guys will be as quick to try screw me over. As for Winzip, you guys can kiss my ass.

For mail, I’ll wait until Snow Leopard is released.

January 11, 2009 No comments yet

So as you can tell I really need a good email client. I do far too much work over email both work and private. When I posted earlier that I went back to the default Mail.app on OS X I forgot that I had seen a link for a beta of Thunderbird 3 from Mozilla.

After some searching I found the download link:

http://www.mozillamessaging.com/en-US/thunderbird/early_releases/downloads.php

Turns out this does solve most of the issues I was complaining about. There still isn’t any background sending options but it is a beta, maybe they’ll be nice and turn that on just before release … you know … who doesn’t save a few gems for the end :)

Anyway, I had for other reasons started to look at the features that will be available in Snow Leopard the next big OS update from Apple. Turns out it will have, what they’re at least calling, full Exchange 2007 support for native applications like iCal and Mail. If this really is the case and it supports offline and remote email (RPC?/or OWA) then I’ll be rocking.

So I’m using a mix of Mail and Thunderbird 3 beta and it does the job. Fingers crossed for a release soon from Apple for the OS.

OS X Email Clients … or lack of

January 8, 2009 No comments yet

These posts are for my x-fellow windows users who might have or want to switch over the using a Mac. Not everything is 100% perfect and for some reason Email software is probably the biggest missing piece of Apple’s offering.

The default Mail.app that comes with os x is Ok but that is about it. If you’re like most people you need to connect to your work exchange server and the only way to do that is via IMAP. The IMAP integration in Mail just sux, no other way to put it. It jumps off messages while reading, gets out of sync with the server and other macs and sometimes gets really slow.

So I shopped around and besides Microsoft Office 2008 … you don’t really have any great choice. Sorry. I’ve heard MS Office 2008 is fine but I really only need Entourage (Outlook) and you can’t buy that on it’s own. Open office for the Mac is just dandy for almost everything else.

Right now the best IMAP client I can find is Thunderbird from Mozilla. It is fine but not great either, not enough editing options. As I stated in another post my personal email is kept on GMail so no worries with that.

So for now this is it – not great but still, better than living in a Vista world.

Get an Apple Mac

December 10, 2008 No comments yet

That is what you want to hear right? Why else would you be reading a blog posting about switching to Macs. Like me you’re probably a hardcore, long time windows user and developer and you’re sick to death of the crap that comes out of Microsoft these days.

So again, let me keep it simple. Go get a Macbook Pro and see what that world is like. No point playing with one in a store, to really get into it you need to commit so you need to buy one. I really didn’t think I’d like OS X and would just end up installing Vista on their nice hardware but it turns out that OS X is really great – not just super stable but feature rich and far more intuitive than any Windows OS you’ve ever used.

After a day or so I maxing out my new baby I wasn’t just happy but pissed at how crappy all my machines up to this point had been. How crappy Microsoft products really are. Why can’t Microsoft make some of these really simple things work? I mean, Apple have really nailed the “it just works”.

I’m not sure what has gone wrong at Microsoft. Everything coming out of Redmond is just crap – and Vista … let’s not put lipstick on that pig. It is crap, it is built on crap and mark my words – it will probably go down in history as their biggest failure. Sure it has a couple things better than XP … wow, that really isn’t very hard. Want a concrete example of something that should just work properly? How about file copy – identical hardware – 30-45 minutes to copy 20 Gigs yet on my Mac, just 9 minutes. Basically 3x-5x faster. Everything on this machine is just better. I think Microsoft has become too big, trying to do everything and nothing well. They need to go back to basics, a few core – good products.

So you’re probably asking … but I have all these programs that run on Windows … quit ya crying, there is a program either identical and just compiled for the Mac or something, usually better that what you’ve used before. Get this, even MSN Messenger is better, from Microsoft … on a Mac. Go Figure. Everything I do development wise for .NET I use under VMWare Fusion which is fantastic, it actually integrates the guest XP into OS X and with Unity you can’t go wrong.

My next purchase is going to be a 8 Core G5 with 24″ Cinema display … I’m comitted to Apple hardware and software now for at least 5 years. We’ll see how the playing field looks after that. I do know this much. Every student I know or talk to or see or hear from these days has a Mac, more and more home users have Macs and when people like me start switching, you’ve got a land slide coming. I’ll convince a ton of people to switch :) Including you …

Silverlight Tip – Initialize!

October 20, 2008 1 comment

Wow, who said learning new stuff wasn’t fun! :) Here is another little gem I found which will change your understanding of how Silverlight applications work.

I had a little application that was working great, it even had a bunch of nifty video things taking place in the code behind. I wanted to redo my layout and so cleaned out the old code, built my new layout and then something went wrong.

I just got a blank web page with no errors, compiler error or warnings – just no Silverlight control. I checked and checked and recompiled and cleaned cache and had a beer – still nothing.

So I created a new project and test xaml page and that worked fine – then I looked at the code behind and spotted the issue. The code below is added by default and IS required – I had accidentally removed it when cleaning up, must be getting old ;-)

You must have the following in your code behind page (user control class)

public Page()
{
    InitializeComponent();
}

Pretty simple but something you can delete and not notice until nothing works :) Silly me.