Sunday, 13 January 2013

PaaS offerings and AppHarbor

This may sound a little obvious, but writing the code for web apps is often the easy part for developers - because that's what developers are good at. I believe developers should be free to focus on writing the code and adding business value. In reality, the developers often get involved with the headaches that come from deploying, load balancing, scaling and monitoring the apps. But with more and more Platform as a Service (PaaS) offerings popping up, it seems like our lives as developers are beginning to get a little easier.

Our technical director at work (Adam Bird) made me aware of AppHarbor.com around 12 months ago. Adam likes Ruby and had been using Heroku, which was a big hit with Ruby developers because it was an easy-to-use PaaS offering. AppHarbor has been called the 'Heroku for .Net'. It runs on Amazon's AWS infrastructure and is designed to take the pain out of quickly and safely deploying, scaling and managing any .NET web application. Appharbour also offers an impressive add-on feature catalog, allowing developers to easily integrate and configure a wide array of database, queuing, monitoring, indexing and email services with their applications.

Integration with AppHarbor can be achieved using various repository hosting services (e.g. BitBucket, GitHub and Codeplex). Developers can use Git, Mercurial or TFS when deploying code to AppHarbor; integrating deployment in the developer's workflow by letting developers use the tools they love.

My experiences

I've been really impressed with what AppHarbor are offering and was surprised at how easy (and low cost) it was to get an application I had running on an virtual machine elsewhere ported over. One of the biggest selling points for me is integration with GitHub and BitBucket. If you are migrating apps over you need to bear in mind certain limitations too (see below). AppHarbor offer a free tier for you to play around with, and a lot of the add-ons do too. I'd strongly recommend you give it a try.

I've listed what I liked most below, followed by some potential issues/warnings I came across.

Likes...

  • Low start-up costs
  • Your first deploy can take just a manner of minutes
  • Automatically deploy code from GitHub (or any of the other supported repository hosting services)
  • Support for compiling and running project tests; if the tests fail the app isn't deployed
  • Reverting to a previous app version is easily achieved through the control panel
  • Ability to integrate popular application monitoring add-ons (like New Relic) very easily

Potential issues/warnings...

  • If you are sharing forms auth cookies across apps hosted elsewhere you'll need to implement your own version of form auth and not rely on the .Net libraries (see AppHarbor blog)
  • File system access should be avoided due to the way Appharbor scales your app - put files in a shared data store
  • AppHarbor building and running tests is not going to work for larger projects with complicated tests
  • During my time playing around I've had a handful of intermittent yellow screens of death appear whilst using their control panel (not my own app) - which has made me question their stability

Tuesday, 16 October 2012

My standard .gitignore file for .Net projects

Thumbs.db
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*.vssscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.cache
*.ilk
*.log
[Dd]ebug*/
*.lib
*.sbr
obj/
[Rr]elease/
[Dd]eploy/
_ReSharper*/
[Tt]est[Rr]esult*/
[Tt]est-[Rr]esult*/
[Tt]emp/
[Pp]rerelease/
[Ll]ogs/
UpgradeLog*.XML
_UpgradeReport_Files/
bin
!SharedLibs/NUnit-*/bin/
!SharedLibs/NUnit-*/bin/net-*/*.exe

Saturday, 13 October 2012

So, what's your team's bus factor?

5whys.com is a site I've been enjoying recently and anyone interested in team leadership should check it out. I've just been reading one of Roy's posts about something called 'Bus factor'.

Bus factor: An irreverent measurement of concentration of information in a single person, or very few people. The bus factor is the total number of key developers who would need to be incapacitated, as by getting hit by a bus, to send the project into such disarray that it would not be able to proceed.

My team's daily stand ups, pair programming and the willingness for team members to share their knowledge means we certainly have a bus factor > 1. So, what's your teams bus factor?

Tolerance and the Equal constraint in NUnit tests

Those pesky tests that fail every once and a while because something took slightly longer than usual. Sure you could just run them again and they probably pass a second time round. There is another simple way to avoid this, the NUnit Within modifier for the Equal constraint.

[Test]
public void CreationDateTimeIsSetOnConstruction()
{
   var timeObject= new TimeClass();
   
   Assert.That(timeObject.CreationDateTime, Is.EqualTo(DateTime.Now)
         .Within(new TimeSpan(2000)));
}

Monday, 17 September 2012

Questions to ask when reviewing a design

Found a post over on the 37signals site where Jason F. lists 'Quesions I ask when reviewing a design'. Might come in handy for some upcoming UI work we've got planned :)

Sunday, 29 July 2012

The Clean Coder

I don't read many tech books, at least not as many as I should do. However, I've just finished 'The Clean Coder - A Code of Conduct for Professional Programmers' by legendary software expert Robert C. Martin (Uncle Bob) and really enjoyed it.

Uncle Bob uses his vast experience in the industry to define what he thinks makes a professional software craftsman. He covers how to deal with conflict, impossible schedules, unreasonable managers and mounting pressure. He also explores time management, working environments and how best to get into the flow of coding. Bob makes some bold statements that many won't agree with, including about how much time outside of work professionals should be putting into their craft, but agree or not Bob always has some compelling arguments.

What I liked most about this book is Bob's honesty about the experiences he draws upon in his career. Even the brilliant Uncle Bob has made some big mistakes but is happy to retell these stories and highlight what he's learnt from his experiences. Bob's writing style makes it easy to follow and I'd recommend this to any software developers or managers looking for their next tech fix.


Thursday, 26 July 2012

Internet Explorer is killing the internet (and me)

As any professional web developer knows, cross-browser testing is one of those day to day mundane tasks that's required for most web UI work. You've spent time creating beautiful UI mock ups with that creative mind of yours, transferred that to HTML and it looks good. Chrome and Firefox is pixel perfect. Then it's that moment you've been putting off - what does it look like in IE? Boom. You're spending the rest of the day, turning that beautiful HTML and CSS into a shambolic hack before it finally resembles what you intended it to.


OVER 10 YEARS AGO!

OVER 10 YEARS AGO!

OVER 10 YEARS AGO!

OVER 10 YEARS AGO!

OVER 10 YEARS AGO!

OVER 10 YEARS AGO!

OVER 10 YEARS AGO!


...when we laughed our socks off to Monsters inc and Apple introduced us to the iPod; Microsoft gave birth to Internet Explorer 6. It's still to this day stifling the creativity and wasting the time of web developers across the globe. If you find yourself in the unlucky position where a decent percentage of your target audience is still living in the past on IE 6 (or 7 or 8) you're hands are often tied. It requires a bold business decision to say no to IE6 support. Some people, projects and companies are doing this - in some interesting ways too (IE7 tax). Even Microsoft are fed up and have created their own IE6 count down site to encourage people to upgrade. But this act of redemption is too little too late. Saying that, the site is fairly interesting. It displays the stats of IE6 usage around the world. Surprisingly, China being the worst offenders still. Here's an article I found that outlines the reasons why China still favours IE6.



Rant over.

Monday, 23 July 2012

Visual Studio can work with HTML afterall

Fix Visual Studio’s crappy HTML formatting and automatic addition of id when pasting

Some nice chap called Tim just told me how to solve those two annoying things that Visual Studio does when I'm editing HTML. What two things? You know, the weird thing with the line breaks and opening tags and the one where it insists on adding an ID to every element you paste in the HTML.

Thanks Timmy!






Continuous Integration and Jenkins

I found this old draft post hanging around on blogger and it reminded me to a time long ago before CI servers were a part of my dev life, so I decided to post it...


Jenkins (formerly Hudson) is an open source continuous integration server and assists the development team by allowing us to easily integrate changes into our software projects from our source control with confidence. Jenkins can be automated to build, test and deploy any type of software automagically. Jenkins doesn't require bucket loads of learning before you start using it and it's very easy to set up. It's also super extensible and caters for a wide variety of programming languages/testing frameworks etc and there are a lot of plugins available - and I mean a lot.


Feedback is key. If Jenkins has any problems building, testing or deploying any projects it can alert the development team in a number of ways (e.g. through a GUI, email, twitter and many more). So as soon as the build or any tests fail we get alerted and the team react to fix those changes - it's never broken for long.


As you can imagine, once we made the effort to set up our software projects in Jenkins, it has improved our 'quality of dev life' dramatically. Automating the building, unit testing, integration testing and deployment straight to our staging environment for every check-in means we are more confident, less stressed and a lot more productive. Once happy with our staging environment we can one click an application release to live. So our application users are getting newer features faster than ever. Ignoring IDEs and source control, I'd argue a CI server is probably the next most fundamental tool in a developers tool belt.


Jenkins! How did we ever live without you?!