Tuesday 23 August 2011

Evil Linq!

I love Linq. Most of the time it helps us do some clever stuff in an elegant, fluent way. Recently though, I have come to dread seeing certain kinds of Linq statements.

The biggest problem I have with Linq, is that it encourages you to write sloppy code, with no error handling at all. This is fine in theory as we 'should' just let exceptions propagate, but in the real world, where you have users editing the content, I have seen many a site go down because someone didn't check for null when getting something out of the repository.

The other issue with Linq is readability and a painful debugging experience. If you use ReSharper like me, you will often get suggestions to covert loops to Linq queries. Fine in theory, but if you have 3,4 or even 5 clauses to it, it quickly becomes painful to read. Combine this with the fact that you can't execute lambdas in the immediate window ( seriously Microsoft - wtf?) and you are in a world of hurt.

Linq makes stuff ugly sometimes, don't do everything resharper tells you kids!

Monday 22 August 2011

Hiring senior developers

Finding good developers is hard.

I don't know about the US, but there seems to be a genuine skills shortage in London. I have seen technical tests and interviewed literally hundreads of people over the last few years and only a handful were good enough for a job.

There were several people who passed the online technical test, but when faced with a technical phone interview, the large gaps in their knowledge quickly become apparent. Of the few that make it through to a face to face interview,  a lot seem to have, how shall I put it, poor communication skills. I'm not talking about the standard interview nerves everyone gets either. I am talking about a genuine inability to articulate them selves. If you can't speak technical to me, the chances of you explaining issues to a pm or client are minimal.

Harsh, but true.

Tuesday 24 May 2011

A Very Simple Hello World iphone app

So here is the simplest program you can create for an iphone using xcode (the IDE) and objective c. The all time classic that is hello world!

Step 1 - Download Xcode:

Go to the apple dev centre, register and download the latest version of xcode.

Step 2 - Open Xcode:

Launch Xcode, found under /Developer/Applications/. You will presented with a window like the one below. Select Create a new Xcode project.

Image and video hosting by TinyPic

Step 3 - Create the project:

The next window will present options for the various different types of projects you can create. Select "View based application". You will be prompted for a location to save the project and a name, call it "HelloWorld". Anywhere is fine, but I don't recommend putting it under the /Developer/ folder as apple have tendency to wipe that folder when you upgrade xcode.
Image and video hosting by TinyPic

Step 4 - Select the Simulator:

You should now have your "solution" open, with all the appropriate files pre-setup for you to launch your application in the simulator. Notice the drop down in the top left of the IDE, this lets you determine how you launch your app - via the simulator or onto your phone. Make sure Simulator is selected.

Image and video hosting by TinyPic


Step 5 - Open Interface Builder:

Ok, now we will actually modify our code to show "Hello world". If you look in the solution explorer ( on the left) and navigate to the /Resources/ folder. Double click on MainWindow.xib (pronounced nib files). This will launch a program called "Interface Builder". It should open at least 3 windows:

  1.  Library - a list of all components you can use on your interface
  2. Controller Window - The view which we will we modify - it represents the screen.
  3. Attributes Inspector Window- Used to alter properties of items on your interface ( fonts etc)
Select the Library and scroll down the list of components and select Label. Drag it onto the controller window like below. 

Image and video hosting by TinyPic

Click on the label that you have just dragged onto the controller. Select The Attributes Inspector Window and change the text property to "Hello World". Save the File by pressing cmd + s.



Step 6 - Launch Your App:

If we navigate back into Xcode and select the "build and run" option in the middle of the IDE, it will now launch your app in the simulator. If you select the breakpoints button ( just to the left), it will put you in debug mode and you can debug just like good old visual studio.

Image and video hosting by TinyPic

Ta, da! Hope someone finds that useful.