jamie.shortbet.org

Shortbet.org development diary, plus general tech rumblings.

Monday, 28 July 2008

NHibernate

I've been taking a bit of a look at NHibernate at work - it was always something I've intended on trying out, and so far I'm impressed. Once I got the hang of the mapping files and collections/sets/bags, I find it very quick to add a new "entities". And having such lightweight POCOs is a real treat after using DataSets / EF classes. Got me thinking to how easily I could rewrite some old software (specifically remoting based distributed WinForms apps) to use such lightweight objects (we used DataSets at the time, heaven help us). For me, it is fantastic to have a data-object which is just that - a lightweight container for a piece of data, although with full support for lazy loading of navigation properties. So far, very impressed with NHib (and the wonderful community around it).

Late to tha Party

Yep, several years too late, but I just picked up a 80Gb iPod Classic. I've survived this long without one, but using a shuffle for the past 2 weeks was somewhat unbearable for me. I primarily listen to music during 3 activities - going to sleep, jogging and weight training (kickboxing / muay thai is definitely a sport you need to be ears-free for however). The shuffle is fine for a random workout mix of music (albeit very limited in size), but sometimes you-just-wanna-know-what-the-song-is-called. Not having a screen is a major usability problem (especially given the price of the shuffle - I didn't pay for mine, was given it second hand). Also trying to listen to a podcast in more than one chunk is difficult, and shuffle won't remember the last play position!

So, the iPod Classic - in a word, excellent. I've already stuffed about 10gigs of music on it, and with a nice silicone case and armband it becomes everything the shuffle wasn't. Dedicated playlists depending on the kind of workout I'm doing are a godsend. The only problem I have is that my earbuds (Creative something-or-others that came free with my Dell XPS) don't cope to well to sweat, so I'll need a pair of wraparound sport ones. I've also converted a ton of videos for use on it - the 2.5" screen is actually very watchable; currently plouging through The Wire Series 2 and The Corner (told you I was late to the party!).

Friday, 11 July 2008

Holiday / Vacation / Annual Leave

Bit of a straw poll coming up : How much Annual Leave (vacation/holiday) entitlement do you get each year in your job - do you take it all, and do you have any trouble taking it? Was speaking to an American friend who gets 10 days a year, but is "advised" not to take it all. That was quite surprising to me - in the UK we have a legal minimum of 4 weeks per year, but everywhere I've ever worked you get (going on my current job)

5 weeks (25 days)
Public holidays (8 days this year)
Ability to buy an extra 5 days

And things such as an extra day per year of service. We are pretty much advised that we take all of our holiday, as it can't be carried forward. Even senior managers generally take all their holidays.

How does that compare with your country? Is the UK an anomaly or the norm?

Thursday, 10 July 2008

Meme du Jour

Seeing as this is doing the rounds, thought I'd fill it out!

How old were you when you started programming?


4 or 5 years old. Wasn't much more than outputting text on my Grandfathers BBC Micro, but it was programming!

How did you get started in programming?

When I was young, I spent a lot of time at my Grandparents house, and my Grandfather had a BBC Micro. I used to play a few games on it (Castle Quest, The Hobbit), and often wondered how the games were made. Luckily, the BBC had a built in version of Basic, which was quite easy to use, so I spent some time just filling the screen with text, changing colours etc. This continued on and off throughout my childhood.

What was your first language?

BBC Basic

What was the first real program you wrote?

Something which said

"Hello, type in your name :" and then filled the screen with your name in lots of colours. I was only 5 at the time, so I think it was acceptable!

What languages have you used since you started programming?

Basic, C, C++, Java, C#, Python, Vb.Net, Ruby, Javascript. I've tried pretty much everything along the way, but those are the ones that stick.

What was your first professional programming gig?

Right out of University, I started working part time for a small local startup. Of course, when we finish Uni, we all think we know a lot, but within a few days I realised how little I knew! The learning curve was immense, but I went from very junior know-nothing part-time guy to Senior Programmer in under 3 years, and saw the company grow from 3 people to about 18.

If you knew then what you know now, would you have started programming?

Absolutely.

If there is one thing you learned along the way that you would tell new developers, what would it be?

Learn about Unit Testing, TDD, Mocking and all that stuff. It's far easier to learn about it at the beginning!

Also write as many programs as you can, try and do something every week in your spare time. The best way to learn is to do.

Monday, 7 July 2008

ot: Games

Not related to anything really, but over the past week I've picked up Age of Empires 1 (and expansion), AoE2 (and expansion) and AoE3 (and expansions). AoE was the first game I really played online (and indeed, I was involved with www.heavengames.com as a youngster), so it's brought back a lot of memories for me!

One thing I don't like is that I play these games on a laptop, and I've never found a good portable mousemat (something I could use on the sofa would be ideal). Using an old book for now, but it's far from ideal!

Thursday, 26 June 2008

MVC - one thing I don't like

In one of my views, I have the following;


Welcome, <%= ViewData.RepHolderIdentity.ReputationHolder.Participant.FullName %>


However, this isn't compile-time checked. It is strongly typed (and intellisense works), but it won't give me a compiler error if I type
change in structure or properties

Welcome, <%= ViewData.RepHolderIdentity.ThisDoesntExist.Participant.FullName %>


This is a bit of a pain, as it means any structure or property changes in our EDM (which, admittedly will be rare, once we hit a certain point in development) might break our views. More unit tests required on my end I think!

Edit: Of course, once I posted this, I found this. Still somewhat annoying that a workaround is required, but I'm happy enough.

Thursday, 12 June 2008

Entity Framework Bugs

I've just found what appears to be a bug in the latest version of the Entity Framework- I was adding some documentation Properties to an Entity (the summary property, in case you are interested), and saved my model. It was all fine until I closed and re-opened the model (or, indeed, anyone else opened the model) - at which point it complained about "Expecting end tag </NavigationProperty>", invalid tags and the like. Inspecting the XML revealed the following:


<NavigationProperty >
<Documentation>
<Summary>Standing, 0-100</Summary></Documentation></Property>me="Bank" Relationship="shortbetModel.FK_Bank_Participant" FromRole="Participant" ToRole="Bank" />
<NavigationProperty Name="BankAccount" Relationship="shortbetModel.FK_BankAccount_Participant" FromRole="Participant" ToRole="BankAccount" />
<NavigationProperty Name="ReputationHolder" Relationship="shortbetModel.FK_ReputationHolder_Participant" FromRole="Participant" ToRole="ReputationHolder" />
<NavigationProperty Name="Store" Relationship="shortbetModel.FK_Store_Participant" FromRole="Participant" ToRole="Store" />
<NavigationProperty Name="Address" Relationship="shortbetModel.ParticipantAddress" FromRole="Participant" ToRole="Address" />
</EntityType>


Which, as I'm sure you can tell, isn't valid. I can only imagine how much of a mess it would of left if I'd been adding Documentation Properties to more than 1 Entity! Be careful if you're using it.