Tuples are Evil and Should be Treated as Such
While working on a particular area of the a clients code (C#) I came across method with a signature similar to the following:
public Tuple<bool, decimal, decimal, decimal, int, int> CheckState(int aParameter)
At first glace you may think that there is nothing wrong with this but think about it – what does that bool actually represent? What about the second of the decimal values? Well, the developer had obviously thought about this and had added a comment above the signature – but it only specified 5 values, not the 6 that are in the Tuples definition (that’s because code comments lie).
Read moreParsing Json Dates from MVC Controller Actions in Client-Side Javascript
Recently I’ve been working on a couple of MVC projects where I was using jQuery to perform an AJAX call to a controller action which in turn returned some JSON data. This is pretty run of the mill stuff but each time I hit a problem with dates.
Dates are always a problem in development, whether it’s storing them in a database or displaying them on the screen. How do you deal with timezones and formatting between cultures? As it turns out the solution to my issue was pretty straightforward and a single line of Javascript resolved the problems.
Read moreAnother year over, what have I learned?
It’s been an interesting year all things considered, I’ve had a couple of good contracts as well as some time ‘between contracts’ (see my last post for more details on that). The time when I was not actually engaged on a contract I’ve been able to pick up some freelance work and invest some time on personal projects and watching numerous Pluralsight courses to keep my skills current. All in all it was a pretty good year.
Read moreThe Ups and Downs of being a Contractor
As with most careers being a contractor has it’s ups and downs and I have certainly had my share of both over the last couple of months.
When my last contract came to an end I entered the limbo land that is ‘between contracts’. Due to the nature of contracting many clients require someone who is immediately available, or at least within a week or so. Looking further than a couple of weeks ahead and you are probably going to be passed over for someone who can get their feet under the desk much quicker.
I had not been looking for a follow-on contract because I already had a holiday booked and, knowing that I would have minimal phone & email access for a couple of weeks, I had decided to leave that until I returned to the UK. I then gave myself a couple of weeks ‘off’ during which time I would continue work on the Xamarin implementation of my FillLPG for Android application and hit Pluralsight to keep my axe sharp and my stills current.
Read moreFixing Xamarin COMPILETODALVIK build error in VS2013
After clearing the decks of some other freelancing projects I’ve had on the go recently I’ve been able to get back to looking at my FillLPG application that I’ve decided to rewrite from scratch using Xamarin.
It was time to start working on the UI and with the new Xamarin.Forms library promising cross platform UI development I thought I’d create a quick project to compare the old approach with the new (and maybe write blog post or two about it). However, I ran into problems very quickly and thought I’d pass on my experience.
Read more