Popular Posts

Tuesday, March 8, 2011

Education is not sufficient

We tend to think that better education gets better jobs. While this may be true for comparing individuals, it turns out that better education does not mean a higher standard of living for the society as a whole, as far as the Western society is concerned. Everybody has heard of BPO (business process outsourcing). Only a few years back on my way from India did I hear of LPO (legal process outsourcing). Again because of similar accounting practices in India and Australia, many accounting tasks were outsourced to India. While all this is bodes well for India, the situation cannot continue indefinitely. Pretty soon professionals like lawyers, accountants, programmers and engineers will have to start collective bargaining. That is the conclusion I drew from Paul Krugman's article in the New York Times (March 3, 2011).
Outsourcing is just one side of the story. Computers at one time were thought to replace manual jobs. Now computers are becoming more sophisticated that many of the routine jobs that skilled people do can now be done by computers. An average manager spent more time looking for a document than actually reading it... until recently. With the smart document searching tools, that time searching is reduced. Managers become more productive and hence fewer managers are required. In my own work I spend less time thinking original ideas and more time looking evaluating existing solutions... not the case about ten years back and my productivity is much higher. This is partly because of the huge amount of information that people have put up for free. The solution for the individual is to be creative and to constantly work on improving his/her productivity.

The way I see it the rat race will become even cut throat. Gone are the days when you could do your job and you can skirt office politics. Now you'd have to be naive to think like that.




Saturday, March 5, 2011

Working in USA

I always thought America was the most rabid capitalistic country in the world. Barack Obama's “Audacity of Hope” reinforces that impression. What surprised me when I worked there was that it was far more egalitarian than Australia. Let me elaborate. In America when you join a company there is no such thing as probation period. You can be dismissed at any time without any prior notice. By the same token, you can leave the company at any time with little notice. In practice though an employee gives a notice before leaving and most companies when they retrench people for no fault of theirs, normally pay a salary of a month or two and continue with health care insurance for even longer, six months is not rare. But in Australia I was given a job offer which stated that the probation period was three months and during that period the employer can terminate me with two weeks notices but I had to give four weeks notice to quit. Hardly a worker's paradise...

It must be said that America being such a large country employers don't fire that easily... although I am told that in the Mid-West companies like Walmart are run like serfdoms. That is why Walmart's TV advertisement don't talk about price or product but portray happy satisfied Walmart associates, a euphemism for employees who are hired and fired depending on the mood of the manager. In general, if it is difficult to join a company it is less likely that you will be fired frivolously.

Nevertheless, the way people are usually treated in good American corporations is remarkable. It is as close to socialism as you can possibly get. “Hierarchy is a necessary evil” of business organization, as Mark Templeton the CEO of Citrix emphasizes repeatedly. Most employers treat their employees well, simply because the opportunities within the country are so huge that a good employee can find work elsewhere. Notice that while unemployment is close to 10% in the US, the unemployment rate for graduates is less than 5%.




Monday, February 28, 2011

Nokia is going the Volkswagen way

The recent Nokia-Microsoft deal does not bode well for customers. I have a Nokia that functions even after eight years. Meanwhile I got a South Korean model that I had to throw away after 26 months. The old Nokia is small, rigid, cheap and I would still be using it were it not for the fact that there is no CDMA, or at least Three (an Australian service provider) does not support it.

The new smart phones are good and I got myself another Nokia, a Nuron - I'll have you know. It costs $140 in Amazon with no contract, in other words, still very cheap. With the new Microsoft deal Nokia may be trying to cut R&D cost but it will be opening its lower end market for other players. Much like Volkswagen in trying to capture the upper end of the car market left itself be overtaken by Japanese car makers. Nokia phones are soon going to be a lot more expensive. It is sad that we will have to put up poorly made phones if we want something economical, under the guise of having better features.

The West cannot simply get over their fixation with USA. China and India are NOW the biggest markets for phones. Can you imagine the Indian Railways giving all their mobile workers an iPhone? Given the level of corruption in Indian Railways it may be possible. But no honest manager would recommend an iPhone over a Nokia that is about one fourth the cost.

The other philosophical issue I have is that people are not willing to accept death. Withdrawing the Symbian OS is like retrenching an employee because she/he is thinking of retiring in a year. Why doesn't the Symbian die a natural death if that is where it is headed? Why kill it prematurely?

True the Nokia does not have as many features. But do we really need all those features to work effectively? Besides, except for the multi-touch capability I can't find any significant difference between an iPhone and a Nokia smart phone. Of course all Apple products have a status symbol associated with them. That is a major plus point and Nokia can do nothing to change that unless a la Lexus they come up with a new brand name. Even so Nokia would be better off not to kill the goose that lays the golden eggs.





Wednesday, February 16, 2011

Book Review: Cracking the coding Interview

I got this book, Cracking the coding interview a few days back.

Today (Feb 17, 2011) I went for an interview and sure enough the main problem at the interview was listed in the book. I must confess I came up with a convoluted solution and after I saw the solution in the book, I realized yet again that coming up with a simple solution is act an of genius.

Saturday, August 30, 2008

Inputs are Contravariant....

This blog has been moved to

http://thesundayprogrammer.wordpress.com/

Monday, November 5, 2007

Migrating from Visual Basic

Classic Visual Basic 6(VB), as opposed to VB.NET, is a good language for developing small applications and modules. It is essentially a single threaded environment and building Graphical User Interfaces (GUI) is very easy. If you want to develop an application that dynamically displays realtime data such as stock prices, then use a Commercial Off-The-Shelf (COTS) graphing tool, and a proper data acquisition tool. Set a timer to poll the real time data and pass on the values to the graphing tool. It is mostly a case of drag and drop and very little manual coding is involved. Similarily developing a form to query and update databases directly or through a middle tier is fairly straightforward. This can be scaled to include a large number of forms in a single application including sophisticated forms like reports that include charts and pictures.

So far so good. Where it fails is that in protecting the developer from the intricacies of the message pump and multi-threading, Visual Basic denies the developer the opportunity to use those features effectively. There are work-arounds but these are tricks that bring Visual Basic into an environment that it is not suited for and requires far more knowledge about Windows OS than most VB programmers have or indeed most application developers have. In addition VB does not support object oriented programming (OOP) in a nice way. It supports interface inheritance but not implementation inheritance. VB programmers could argue that object delegation and interfaces substitute for implementation inheritance. Nevertheless very of few of the well-known design patterns can be implemented neatly.

But still, VB has been used to develop 100KLOC applications. In my last job I was involved with a single 73KLOC VB module. There were other modules written in VB and C++ that this main application made use of. No good software engineer would develop such a large VB application from scratch. In my case, the application began as a simple prototype and as time went on the application took a life of its own growing to such a huge size. In fairness to Microsoft, they realized early on that VB does not scale and, as C++ required more training, the demand for application programmers would fast outstrip supply if nothing was done. They researched some of the existing computer languages, Java especially, and came up with .NET. They have steadfastly refused to upgrade VB 6 and are forcing people to migrate to .NET.

Unfortunately the migration path from VB to VB.NET is not quite as easy as Microsoft would like us to believe. For small GUI applications less than say 10KLOC, using a code converter would be viable. For large applications this is not possible because it takes a long time to fix all the loose threads. Meanwhile the original application is continuing to grow. Obviously you cannot ask the world to stop until you complete the migration.

Another approach that Microsoft encourages is to use the inter-op FormToolKit. This tool kit can be used to develop forms and ActiveX controls that can be used in a VB application. In my experience this is a red herring. It does not reduce the amount of classic VB. It merely prolongs the life of a classic VB application a little longer.

It is better if the app were broken up into many small modules. Then the main GUI can be converted to .NET using the VB modules as ActiveX/COM objects. In other words keep refactoring until you have smaller modules. At that stage migrate module by module even as the application keeps growing. However in most cases it would be better to retire the old application and start afresh. Yet another alternative would be to consider moving to C++. Complex VB applications are complex because they tend to get closer to the underlying operating system. What better language to do so than C++?

Thursday, November 1, 2007

Why C++ is still my favourite language

With the advent of .NET the Microsoft camp is also moving away from C++ to a virtual machine driven architecture a la Java. When Java first came out the advantages were supposed to be memomory management and security. Garbage collection helped moved the mundane memory management responsibility away from the application developer to the virtual machine - or so the claim goes. Unfortunately people doing Java/.NET forgot to close files and database connections and had to go back to basics. .NET provided the 'using' feature that reintroduced deterministic destruction in a rather clumsy way. Besides the the try-finally syntax was supposed to take care of relinquishing resources (other than memory) that were not needed.


Remove Formatting from selection
In C++ we use RAII. If an object encapsulates an database connection class then a database connection is opened in the constructor and closed in the destructor. No messy try-finally clause. Any good C++ programmer knows to take care of memory allocation using RAII. So memory management is less of an issue these days. The second advantage of C++ is the template programming. Generic programming in .NET is a pale shadow of template programming in C++. Here is an example:



template

class TContainer

{

T myObj;

public:

TContainer(T const& obj): myObj(obj){}

~TContainer() { myObj.CloseHandle(); }

};



Notice the 'CloseHandle' call in the destructor. This template demands that the class that T is instantiated with implement 'CloseHandle'. In C# (and Java too I think) a workaround can be provided for this simple case by casting myObj to a particular interface and then using the interface. But that's a runtime feature, and does not scale.



The one advantage of C# is reflection. In C++ we could query the typeid but we cannot traverse the entire set of methods and interfaces an object provides. This feature is used heavily in a number of instances including data binding as used by a GUI programmer. I am not quite sure why C++ does not do it. Even the dependency injection pattern cannot be implemented in C++.



Nevertheless, if you are going to develop algorithms, realtime, or even multimedia C++ is the way to go.