Learning new skills

A wise man once told me and a classroom full of university students that we needed to take responsibility for our own learning.

At the time I thought that it was just his way of encouraging self motivation in our studies. We were all HND students and that bit of advice was preceded by reminding us that as HND students we should all know a little something about failure. He wasn’t trying to be mean, well not malicious, he was trying to remind us that the HND was a second chance and we shouldn’t blow it. He was also trying to be funny in his own very dry zany way.

Over the years I’ve slowly come to realise what he was really trying to tell me.

While working on a particularly challenging project written in a language I’m only still learning, on a platform I know nothing about and using an entirely new set of tools on which I’ve only been very very briefly trained, I came across a comment in a developers forum made by one of the many programming wizards that seem to frequent those forums. After giving his answer he wrote that ‘being a good developer is all about figuring stuff out. You search and experiment and ask questions or you’ll never learn anything.’ I’m summarising because I can’t find the original quote.

After I read this I thought about my time as a developer and exactly how correct this statement was. Not just in development but in working life.

My first year as a student I joined in with the other students in complaining about having been asked to do things about which I hadn’t been taught. It was an infuriating situation to be in, I didn’t feel like I was getting the support that I needed and I didn’t think it was fair. As it happens eventually taught myself what I needed to know anyway and just got on with it but all the frustration was needless and counter-productive. My second year I took a different approach and tried to be more proactive. After all this was obviously a fault with the school/teachers and I couldn’t change it so instead I was going to be more proactive and less whiney about it. Consequently my second went much smoother and I did a lot better, while it wasn’t any less stressful it was easier. My third year presented a whole new set of challenges but my attitude remained the same and I got through it alright in the end.

Now I’m here on placement and I again found myself in the position where I’m being asked to do things that I’ve not been taught and don’t feel ready for. As the work piles on and the pressure builds I was feeling increasingly under qualified and frustrated.

During a conversation with a former teacher of mine I mentioned that I didn’t know what I would have done without his help to which he replied in his uniquely ‘matter of fact’ manner. “You would have gone somewhere else.”

One of the most irritating things I hear people in the professional world says ‘I’ve not been trained on this’. It’s always annoyed me and I’ve only just come to realise why. It’s no different to a bunch of university students complaining to their teachers that they’ve not been taught something.

Taking responsibility for your own learning doesn’t mean that you should be a self starter and a go getter. It means that no one is going to hold your hand in the working world, or any world outside of high school for that matter, nor should they. Sure you might get the occasional single day training packing of questionable quality on certain things but ultimately you’re on your own in most aspects of your job and if you’re not, enjoy it because soon you will be. If you haven’t been trained, or taught, do it yourself. The resources are out there, if you can’t find them ask for help, if no one can help just figure it out yourself. You’d be surprise what you can learn by just taking a stab at it.

I look back at my first year at university and I cringe at the thought of having sat there moaning to the award leader about not having been taught MS access. All that wasted time and negativity could have been put to much better use.

Recently, I’ve been tasked to help with training some of the staff on Python. I don’t know Python or anything about it. So instead of complaining that I’ve not been trained I’m spending a that time learning it. If I need resources, I find them, if I can’t find them I find someone who can. Only a week later and I’m getting on great, I’m learning all sorts things about programming languages, so much so that I’m having a hard time picking which material to cover in my training.

So thank you Dave for your inspirational word, sorry it took so long. And thank you Trev for your help and guidance. I finally get it.

Kata2 Binary Search

I did my second Kata this morning. I thought I’d tackle the binary search problem in following with http://codekata.pragprog.com
The idea here is that you have some huge, but sorted, list and you need to find a single element within that list as efficiently as possible. As lists grow in size just traversing through the list element by element can take a really long time for higher numbers.

The binary search solution basically means you start in the middle continually divide the list in half until you find your element. For huge lists it’s excellent because it doesn’t matter where the desired element is in the list, it will always find it quickly, one drawback though it will more often than not, take several searches to locate the element. So you need to weigh the efficiency lost against the efficiency gained. 

I’m quite proud of my attempt. I’ve tested it with a list of 50,000,000 integers and it never takes more than 26 searches to find any element. It’ll support an array of any size and it should support any data type, but I’ll need to test that at a later time. This is a recursive approach as it was the approach that comes most naturally to me. I’m going to have a look at an iterative at a later time.

This was developed using TDD, kind of. I had to test this from a few different directions at once, namely efficiency and accuracy. I couldn’t work out a good way of testing for them both at the same time so I’m leaving what test code I did end up with out of this post.

 -(NSNumber*)binarySearch:(NSArray*)array forInt:(NSNumber*)anInt {  
int numberOfSearches = 1;
int min = 0;
int max = array.count;
int searchingFor = [anInt integerValue];
int indexOfGuess = [array indexOfObject:[array objectAtIndex:(max + min) / 2]];
int guess = [[array objectAtIndex:indexOfGuess] integerValue];
NSLog(@"%d searches", numberOfSearches);
while (searchingFor != guess){
if (max - min <= 2){
return [NSNumber numberWithInt:-1];
}
if (searchingFor < guess){
max = indexOfGuess;
}
if (searchingFor > guess){
min = indexOfGuess;
}
guess = [[array objectAtIndex:(max + min) / 2] integerValue];
indexOfGuess = [array indexOfObject:[array objectAtIndex:(max + min) / 2]];
numberOfSearches++;
NSLog(@"%d searches", numberOfSearches);
}
return [NSNumber numberWithInt:indexOfGuess];
}

Bruising the Ego

I’ve learned quite about managing your ego when it comes to development. Every programmer has an ego, don’t listen to what they might tell you otherwise. We all consider ourselves the poets of the computing world, thinking up beautifully elegant solutions to impossible problems.

I have a huge ego, I freely admit this. I don’t handle criticism well and I’m a sore loser. I constantly aim to blow peoples minds with my genius and when that doesn’t happen I fall into pits of self loathing and depression. It’s a constant struggle for me.

Two of my apps have received bad reviews recently. I’ve got another app that I’d written for a client that seems to have given up on me all together, bought my app and immediately reporting a bug and requesting all sorts of changes. I fixed the bug right away and then spent a month re-writing the app. Now they won’t respond to my emails, nor have they updated the app. My natural pessimism tells me that they’ve written me off all together, but I just don’t know.

Being that two people have chosen to be vocal about their dislike of my apps, demographically I know that there are a percentage of others out there that feel the same way and have just chosen not to speak up. I spent a lot of time and energy on those apps and I’m very proud of them and their success so far. These were my ideas, my creations, my products and I want everyone to love them.

Now in my defence neither of these two users appear to have read the description of the apps before purchasing, which is their mistake. And the things they’re complaining about are actually restrictions put in place by Apple, nothing to do with me. But these are still my app reviews. There is also information within the apps and on the app store that would allow a displeased customer to get in touch with me of there’s a problem. But they haven’t tried to reach me. I take some solace in knowing, from experience, that there are customers out there that just want to complain about anything that they can. You can’t please everyone right, so why don’t all those that like my apps post good reviews and make me feel better about it. I’m sat here looking at dissatisfied customers and poor reviews and I’m powerless to do anything about it.

I suppose that I could look at it as there’s being an opposing percentage of those that are very happy with my app. There is one good review as well, so that’s something.