What is it about mobile phone development that should attract people ? Please note that I said should and not will! I do know that there are a fair few people who develop games for mobiles and a lot of people are involved in developing applications for the iPhone, but should it attract people more and more ? Will it become a mainstream development area like Web Development or Games programming?

The main attraction that I see in development of anything for a mobile platform (which for a majority of people means mobile phones) is the condensation of content while imparting the same amount of knowledge. Let us say you run a chartered accounting business and have a website which allows your employees to perform their duties, lodge complex tax returns etc . Can you condense that quality of information onto a smart phone? Can you convey that information without confusing them ? Will you convey that information logically (one step leading to another) or intuitively (letting them search for it) ?

No longer is the term “mobile platform” constricted to smart phones. We have the iPad, the Adam and even the iPed and they have nothing to do with telephony. Applications for them can be varied and interesting. Some have even suggesting that digital mixing for DJ’s is now possible thanks to tablets like these.  Is there a case here that more technology is actually highlighting the lack of fields one can develop for now a days ?

Whatever the popular mood and whatever my own views, mobile development at the moment is at an interesting point. I do not believe that we have explored the full possibility of what we can do with it. Maybe it will lead us down the path of “Less but better information”, or maybe like so many other things that software developers have come across, we will royally screw this up. Who knows?? But one thing is for certain, I am more than eager to find out.

As a side note, I have tried reading books on the Kindle and the iPad. I did not enjoy it as much as holding a paper book in my hand. My sincerest apologies to all the trees, but this is one bad habit I will not give up.

I was writing something in python some days ago and I realised that python actually provides a neat way of handling function pointers. Or at least their version of it. Its called lambda.


>>> a = lambda x : x**x
>>> a(4)
256
>>>

So that got me thinking! In how many languages could I redefine pointers to functions/methods dynamically. So I decided to try Ruby; and lo and behold, Ruby has a another unique way. It does so, by passing around blocks.


>> def name
>> puts "Start"
>> yield 1, 2 if block_given?
>> puts "End"
>> end
=> nil
>> name { |x,y| puts "#{x} - #{y}" }
Start
1 - 2
End
=> nil

Nifty, isn’t it!

Then there is the ever beautiful C. Simple and elegant


float add(float a , float b){return a+b;}
float minus(float a, float b){return a-b;}
float diva(float a, float b){return a/b;}
float mult(float a,float b){return a*b;}

float answer(float a, float b, float (*func)(float,float)){
return func(a,b);
}

Call => answer(a, b, &add);

As you can see, only in see do we actually explicitly pass around the address of the function itself, which is why I like C so much, because simply by looking at the code, I know exactly what is happening.

Now looking at Cocoa, I can hardly see any major difference between that and C. Sure, you have a whole heap of square brackets strewn about and the letters “NS” pop up irritatingly everywhere but, it is still C, which makes it cool. Although, I still have to figure out why interactions between Obj-C code and Interface Builder seem to resemble static method calls.

Perl too fairly easily resembles C when it comes to passing around subroutine pointers.

Of course the grand daddy of all these is Lisp and Scheme and you can not do much in them unless you deal in functions. Other languages I want to mess about in with regards to function pointers is Scala and Dylan.

This was heaps of fun :D

As a software developer, we have to be both Michaelangelo and Sherlock Holmes every now and then. Michaelangelo in the sense that every now and then we get the opportunity to create something stunning, something beautiful virtually out of nothingness. Sherlock Holmes because more often than not, things go wrong and we have to go hunting for the clues that will lead us to the perpetrator. Guess which one we get to play more ?

So that raises the question that how can we make debugging easier for ourselves? Since we write the code that breaks down, surely there is a way to ensure that we get something in the log output every now and then to ensure things went smoothly, or otherwise. Hence we developers starting putting random statements into log outputs and helped ensure that system administrators who have to monitor this output day in and day out hate us with the passion of a supernova. Well done lads!!!

So here is my beef. Lets not put every thing in logs. As Holmes points out to Inspector Lestrade in the case of A Study in Scarlet, it would have been much better for the former if the latter had not muddied up the scene with too much superficial information. A case in point is the starting up log output of JBoss. It is horrendously loud, verbose and useless. Most of it is INFO and very little is needed to be debugged. It takes 53 seconds to start, yes 53 seconds and in that 53 seconds Apple’s native terminal might run out of buffer space. And if something goes wrong, then well best of luck with your scrolling abilities.

There is a reason why discretion is the better part of valour, and debugging. Log only that which is critical. Remember, you are not the only one who has to see these logs and perhaps sift through them. System administrators and QA also have to look and sift through them and it does no one good when it is full of rubbish. We do not need to log everything. If someone tells you to err on the side of caution, tell them to bugger off.

Remember, a log output is like the program trying to talk to you. The more appropriate its trumption, the easier it is to understand.

Over the past few years, my culinary tastes have swung from the food I have grown up with to the food I saw on television, to whatever I thought looked tasty. But as my tastes matured, I have realised what the phrase “Eyes bigger than one’s stomach” means.

Over the years, especially after I came to Melbourne, the joys of fast food (if you can call it food) hit me flush. Grab a burger whenever I wanted, doughnuts, coke night and day! That was what I lived on. The excuse that I gave myself was the one that propped up in head, thanks to the popular culture definitions about computer scientists. I thought coke was my caviar, doughnuts my amuse-bouche and burgers my main course all the four years of computer science. Thankfully now, I have come to realise that there is more to taste and good food than answering the question “Do you want fries with that?” with an affirmative.

Case in point, please observe my lunch from today

This is fish bought from Sunshine supermarket. Fried lightly in olive oil and tomatoes, onions and green chilli added for extra flavour.

Now if I was to ask a restaurant for a similar lunch, chances are it would be very overpriced and/or would be dripping with grease.

Here I have made a healthy meal, very nourishing and filling with less than a tablespoon full of oil and all it cost me was $15 AUD.

Next, I want to is lamb fillets. The local halal meat shop sells these gorgeous looking scotch fillets and once I figure out how to make them, thats what I am going to try next.

Au revoir  and Bon Apetit

I work in a young company. And by young, I mean the average age of my colleagues in Software Development is not more than 30 years. Before we went agile, our company had a policy of allowing people to work from home if needed. So all the young parents were greatly benefitted with this policy. The quality of work did not suffer and I think that was due to the fact that they were happier at home with young children and that was reflected in their work as well.

Then cometh the age of Agile!

We put proper emphasis on pairing (in my humble opinion, rightly so) and working from home from developers became harder and harder. QA had it a bit better because it was possible to do their work alone at times, but come time for estimation and writing features for a project, even they were not free. And while providing day care at workplace [ Day Care – An office affair and Babies at work ] is a possibility, it’s still a long way off.

So in the meantime, what do we do?

At our workplace, we have been provided with Macbook Pro’s for everyone. The default instant messaging client is called iChat, which comes with a provision to chat automagically on the local network, and ability to utilise the associated video camera. This I think, could be utilised to our advantage. Why does one need to be physically present while pairing? I don’t think you do. While the immediate presence of your colleague has the obvious advantages, the Agile advantages, I think, are more concerned with immediate feedback.

When you pair with someone, you want to ensure that both of you have some investment in the code being written: You can share the screen with iChat allowing both you (at work) and your pair (at home) to be able to play programming ping pong.

While pairing, you want immediate feedback if your pair has spotted a mistake in what you have done or that they don’t like what you have done:  iChat enables voice support in conjunction with video.

I am not saying that it will be perfect. No new way of dealing with shortcomings in an existent methodology is, but we have to try. As a company, you have to ask yourself; in what ways do I get the best out of my employees? Keeping young parents in your company happy by allowing them to be parents and Agile practitioners (in that order), is one very good way to do it. And yes I know, I have specifically quoted Apple products in my example; that is only because I have experience with them. For dedicated linux users, you have pidgin/gAIM/Kopete. For others you have Skype/MSN/GTalk. All this is workable. We just have to have the will.

In the morning, I had a very interesting discussion with a colleague of mine. He was writing a simple handler which passed an annotation to a calling class about which we knew nothing. All we knew that by passing the annotation, the class did stuff properly. For those fortunate enough to have dealt with objects in python and ruby, behold the Java annotation example:

@Test
public void testSomethingWorks() {
    assertTrue("Eve knows ", alice.secret(), bob.secret());
}

More can be found at Java 1.5 Annotations

The @Test is the annotation, telling the whatever is reading the code that what follows is a JUnit test. Similarly we had an annotation, above a class method and the discussion started. My friend’s argument was  something that only did one thing, and that thing was just an annotation passing to a black box, did not need a equally trivial unit test. Now this test is made harder by absence of any decent mocking frameworks. That is, we could have mocked out the external utility that was a black box and done a fast and simple JUnit test, but not to be.

I asked my friend if he cared when/if the code was changed. On being answered in the affirmative, I asked him whether in that situation, he would like to know by our build light breaking, or by one of our system administrators coming to us and informing us?

Thankfully, that seemed to convince him that a test, whether trivial or not, is needed to cover a piece of code which does something. Any thing. I say thankfully because I really did not have any more arguments up my sleeve, other than my sanctimonious anger :P

So today, I decided to update to Snow Leopard from Leopard. It took only 45 minutes using the real DVD. I am about to migrate from Microsoft Entourage to Apple Mail. All seems to be OK till I try to compile a LaTEX document.

What the !!!???!!!!

Where did my pdflatex binary go ?? I swear I had it!!! AARGHHHH . So I open a terminal and do

$sudo port install teTeX

but what the hell … now port is giving me errors as it cannot seem to compile some weird library thingy!!! I check my compiler by

$ which gcc

and I get nothing. Back to the DVD to re install XCode to get GCC. Now, I run a script which does database migrations for me to ensure I haven’t lost any data, and TA DA  … I cannot seem to connect to mysql. Almost knowing what I will get, I do the following :

$ which mysql

and once again I get nothing. So I ended up re-installing mysql, macports. But in the end when I tried to re-install LaTEX, I got this …


Error: You cannot install fontconfig for the architecture(s) x86_64 because
Error: its dependency expat only contains the architecture(s) i386.
Error:
Error: Did you upgrade to a new version of Mac OS X? If so, please see
Error:
Error: http://trac.macports.org/wiki/Migration
Error:
Error: Target org.macports.configure returned: incompatible architectures in dependencies
Error: Unable to upgrade port: 1
Error: Unable to execute port: upgrade Xft2 failed
Before reporting a bug, first run the command again with the -d flag to get complete output.

The annoying thing is, I am not on a 64 bit system. At All!

I am off to TextMate to find out if it has a LaTEX bundle somewhere. :(