Microsoft Surface or Sink?

Well, in the end it was a bit of a disappointment I suppose. Microsoft have announced a tablet computer in two flavours – ARM and Intel, in two form factors, with an integrated keyboard and stylus support. As a lot of commentators are saying it does raise a few more questions than it answers in some ways – not least how is this going to play with the hardware manufacturers that are Microsoft’s usual bedfellows?

As a point-in-time view though you have to say that Microsoft simply didn’t have any alternative. They have a semi-successful hardware business already, they have been shown the way by Apple with the iPad and the enormous sales potential. They are releasing a new operating system version with intrinsic pad support which also is backwards compatible with the existing desktop software. Microsoft and Apple agree with the rest of the world that there is a huge market in tablet computing and there is plenty of space for everyone.

The remaining questions are will it work and where will we be in a year’s time? Some of those versions mooted of the Surface may not. But is this seemingly scattergun approach to seeing what works going to be successful? I’m looking forward to seeing it more out of interest than anything else but with this profusion of interfaces – keyboard, stylus, touch, will that work? How will that work? We’ll only know when we get one in our hands.

However in the meantime it’s nice that wiki is already disambiguating the old Surface from the new one.

Feature Complete

The amount of actual merging of Rosegarden for Windows that has gone on in the last couple of weeks has been minimal as I’ve been implementing the final features for Friendlier 1.0 Beta.  And jazzing up the website and thinking about how I’m going to sell this thing.  You’ll find out more soon but suffice to say Friendlier will not only be pleasing on the eye, but also pleasing on the pocket.  You’ll also get some great benefits for being an early adopter.  More details to follow soon on pricing and availability but I’m pleased to say that Friendlier is now feature complete for V1.0.

In the meantime I’m thinking more seriously about Git following this article from El Reg.  Version control integration is going to be a core part of Friendlier and it seems there will be no avoiding Git and GitHub going forwards.  I’m looking forward to putting those features towards V2.0.

The Key Man and Making Things Work

A couple of things have come to my attention recently.  Firstly the flawed concept that having a Key Man (or Woman) is a risk to your organisation.  Secondly that as IT people we don’t spend enough time just getting stuff working.

Hierarchies tend to want to avoid globbing knowledge in one place – they want people to share, for the assets to be equal and for everyone to have enough time to go on holiday.  No really, they do.  They want bums on seats, they want square pegs and square holes – everyone wants an easy life and for everything to be equitable.  This is because those in power are scared of vesting too much trust in one person and therefore keeping a modicom of control without having to actually learn anything or do anything themselves.  They want to trust their staff and the best way of doing this is to ensure they keep talking to each other.  Make sense doesn’t it?

So a few years ago the buzzphrase ‘key man risk‘ came about and suddenly we were all running about and trying not to learn too much, or making sure we spend enough time doing knowledge transfer so that no single person holds all the cards.

However, organisations are only as good as the individuals that are involved in them and people working in organisations are inherently lazy and inflexible.  That’s not to say they don’t do a good job but people will always have a tendency to make their life as easy as possible despite what is mandated as being good for the organisation.  This is as true for the boss as it is for the shop floor worker.  Everyone makes all the right noises but when it comes to actually addressing problems and making tough decisions to mitigate these risks everyone would much rather not make them and just leave things the way they are because it actually makes life harder to make these changes.  To reroute information or processes takes effort.

Hence all organisations will continue to suffer key man risk – it’s pretty much unavoidable.  So if it’s unavoidable is it actually a desirable situation?  After all – you have someone who can do the job, shouldn’t you be celebrating this rather than trying to obviate it?

Along with organisations that just work (any old way) don’t we want solutions that Just Work too don’t we?  So this takes us to my second thought – rather than choosing and implementing different software paradigms or methodologies to help us manage complexity, growth and the future what happened to just getting things done.  Just tackling the actual problem rather than planning our way around it.

This second thought is less well defined – it’s new and it’s raw.  I will call it Solution Oriented Programming and I will come back to this shortly.   Essentially there’s a link here between key people and getting things done – you take risks to make progress – and those risks may only be ones that you’re already carrying.

Interesting to read also on Slashdot about the possibilities of getting back to the hacker culture.  Celebrating the fact that there are people around who can actually improve processes for you very very quickly.    So indeed if you did want to eliminate that key man risk, if you did want to just get things done – perhaps you should spend a little time just listening to your local friendly neighbourhood hacker about what can be done and then act on some of those ideas?

How we do Indenting

One of the more interesting things about writing an IDE from scratch because you end up at points where you can see how other people did things and making perhaps the same decisions as them, perhaps different ones.  For example I’m just looking at indentation and bracketing in the text editor for Friendlier.

When you type in a closing brace in C++ or Java for example I would expect the formatting to work out that we’ve stepped down a level of indentation and adjust the text accordingly.  Hence you are expecting to see a closing brace and then you can write it out with a command which might look a bit like this:

insertTextCommand(fileBuffer, someText, positionOfTheText)

 And when the someText happens to be ‘}’ what can we do?  Well we can change insertTextCommand to do something clever with the FileBuffer at the position of the text – or we can write another command that will do the formatting of the closing brace afterwards.  Of course it’s useful to have a reformatting command anyway so shall we just have a generic command for reformatting a file?  Probably not as formatting is target language specific (what may be a closing brace in one language isn’t the same as one in another) so perhaps we need a generic command which can be specialised per language we’re going to support somehow?

In Friendlier we already have a generic SyntaxManager class and specialise this to (for example) CppSyntaxManager.  This handles text indentation, keyword highlighting, text completion and other functions already.  We can pass this into our reformat command and it can work out what kind of text we’re reformatting:

reformatTextCommand(fileBuffer, syntaxManager, startPosition, endPosition)

So I can then run this command right after the insertTextCommand and it will reformat the text for me and best of all I leave my working insertTextCommand unsullied.  Additionally if I don’t like the formatting that’s been automatically applied I can undo just that one command.  Oddly enough this is exactly how Visual Studio appears to work too.  I wonder if they code this in a similar way?

Things I always forget in Application Express (Apex) from Oracle v4.0.X

Firstly – How do You Copy a Page?

I always forget that you can copy a page really simply but it’s hidden away in some obscure place:

– Click on the page you want to Copy

– Click on Create -> Page as a new Copy

Oh so simple but you’d be amazed how much time I’ve wasted trying to remember this.

Secondly – Page Templates. You can’t seem to change them once they are set. At this time I can’t even remember how you assign them without doing a Page->Copy (see above).

Thirdly – How to create an Updateable Report? Again another one that’s so well hidden you think they did it deliberately. You can spend as much time clicking as you like but you have to remember this one or look it up every time:

– Create Region

– Form

– Tabular Form

Then you get the option of Update, Insert, Delete et voila you have an Updateable SQL Report.

Bottom line with Apex is this – there’s always a way of doing it but it’s so well hidden that you need to dig dig dig to find it. Also sometimes even the simplest stuff is hard to remember.

Unit Test

Today I’ve been finding out about this automated unit testing/JUnit thing that people do. Does it actually improve quality? Testing as a concept (to me, working in the industry) just seems like this sickness that is crept in for writing code twice or three times when you only want it once. Is the testing trade off worth the effort for non critical systems? I mean even with critical code there is a question of why we’re spending as much on testing as we are on development?

It of course depends on what code you’re writing and who is going to see it or its interfaces. I don’t think I’ve ever written a single interface that some other alien code will use – in that I always see both sides of the coin. If I were writing a public interface (anything web oriented) I’d be sure as dammit it worked to all tests and if it were to be maintained by other people I would put effort into constructing automated unit testing for it. However for most code I write I can see there is no point as it’s probably not going anywhere.

When you look at testing frameworks and dependency injection it is almost like test metadata is driving coding style. I think that an approach where dependencies are specified in constructors is a good way to code but this is after all only a coding approach. We will always find lots more problems passing structures into pre-existing objects rather than constructing them with those objects in the first place c.f. copy constructors being notoriously difficult to get right or say switching documents inside applications. And if you think logically about design then it follows that your objects should always be able to stand on their own with the minimum amount of dependency. Those highly coupled areas are always going to be the ones where problems exist anyway.

Isolating areas for test makes for progress and then refactoring (newish word which of course means redesigning) code to expose bugs and to fit better with the changed conceptual model ensures that things stay fixed and also code is easier to understand. So I’d argue that perhaps unit tests are just lazy ways of saying ‘need more work here’? And it’s all well and good to say ‘refactor’ but we don’t always have the time.

It’s very interesting learning about this – I can absolutely see the drive but again I just wonder why these languages are so complicated that we are forced to use complex frameworks to reverse park ourselves into good coding practices.