Make sure there’s no dirty picture – Have a good big picture!

Few years back I had worked with a Japanese customer for a health care imaging project at their site. I was relatively new to the domain. Most of the development team was there in India.

We had some solid requirements and prototyping on some new features. I had demonstrated one of the prototypes integrated to the product which essentially play back the images aligned to the ECG cycle acquired from the cardiac patient. The feature helps the sonographer to export the data as AVI. I simply tested the feature and quickly setup the demo as we’ve already crossed the deadline. Things were working just fine. This I had already seen in the prototype earlier. Fine. I demonstrated the feature successfully and was happy about it. I requested him to to try the new feature to get more feedback from him. He happily took over the system.

He simply registered a patient, then acquired the images along with ECG. He went on reviewing the acquired images, then he exported the cycles as AVI to the patient. He quit the application and opened the patient browser if appears under the current patient. Yea it’s there. I dint feel anything bad when he registered one more patient and start the application again. (Application won’t quit, it will be residing in memory always. They simply hide the window and release the resources and keeps on waiting for commands from parent application). He did the very same procedure again. It was working I was happy again. The progress bar has been displayed again and finished the export. Then he took the patient browser once more. Surprisingly the data wasn’t there under the current patient.

As I knew the code base well, I figured out within seconds what made it to disappear the data. I told him “I’m sorry, the new patient event not handled well. The code isn’t resetting/replacing the patient ID with new one. I can fix this. It’s just one line modification” and I was about to go back to my desk to modify the source.

He stopped me and smiled and explained, “Sarath-san, are you realizing that this is a serious security issue?” I could not fully understand what he really meant with security issue.

I did not reply. He continued “For programmers, it’s a one line code modification which takes to fix this issue. But think from a customer perspective. If you went a hospital with some small chest pain and the next patient is coming with some serious cardiac problem and what if his data being exported to your ID, then the doctor gives you the wrong treatment?”

The example was perfect. I could not think of a major heart surgery because of a system/sonographer’s mistake. That was kind of eye opener. Even after all these years I still remember the story.

Most of the time, programmers are either instructed to do some part of the code without having understanding of the impact. To make and maintain better software, it is also important to understand what is the big picture. What is the real impact. Always remember the issues being found during the development time is easy to fix, once it’s delivered to the customer site, the cost will be N times more, depends on the number of customers we’ve and the cost of deploying the patches. It starts from requirement capturing to implementation. It’s responsibility of the person who captures the requirements to test/inform the major uses cases, aspect and impact of the features. On the other hand, when we’re implementing something, it’s solely our responsibility to properly understand the requirement, big picture of this requirements and the impact area. It’s equally important to do regression testing to make sure that the existing functionalities aren’t broken.

When less competent people leads these activity there’s a high chance to have the information in pockets and do not explain the requirements properly to make sure that they’ve better control over the project (trust me, there are people). But that is actually making the product and themselves worse. Also it’s developers responsibility to bug the people enough to get maximum information and clarify the requirements.

Embracing the cloud

I am a Software enthusiast. Not really sure when I have used the right word. But I always want to try to new Softwares and see how it works. But at least for last couple of years, the software landscape has changed and keep evolving like anything. Thanks for the browser wars to make the web better. 

Cloud is something which I am fascinated for long time. Even I feel a bit difficult to explain the real concept and infrastructure behind cloud, the mix of Software, Virtualization and hardware in a new paradigm entirely taken away the industry.

Most of the services we’re daily using here are already embraced cloud. When I started my career back  I started hearing new things like POP and Exchange for emails. It was hardly difficult to understand why really do we need  an exchange mail. I realized it later when I travelled abroad and started working from both home and office. I found exchange is really fast, useful when we’re mobile. It’s an old story but again there are several cloud services which I am really making out in daily life. I simply can’t live without them.

Gmail - The cloud based email and the best web based email I ever have seen. I never felt to install a client for Gmail as it rocks well in the web version. Instead of downloading message down the system we’re using, simply a data render happens when deal with GMail. None of the things are really stored our system. It works well across platforms including mobile, desktops and tablets.

DropBox - I am loving it. One of the best natively integrated file storage and handling services I have seen. There are many replicas and services came to online file storage but DropBox remained strong and still gaining more users. The service currently hosts more then 100 billion files. As per the survey, peopel are storing files more in dropbox than tweeting. The clients are available at all platforms like iPhone, iPad, Android, Desktop (Linux, Mac and Windows). I never will have to bother carrying the files around. Also the client allow you to partially sync with the required folders under DropBox.

Evernote – The best desktop application I have seen in my professional life. The notes taking application comes in all form. From Bookmarklet to brilliant desktop and mobile clients. The software is simply an art. The premium versions are even better than the free version. Even you can used your evernote storage stpace onlnie to save your documents. I am sure you will love it.

Google Docs - I am almost left the office suite in my personal computers. Most of the things I wanted from office suite is available for free at Google Docs. I have prepared several documents and drawings with it. It’s getting matured day by day. I am loving it.

Google Calendar - It tracks all my events and appointments without fail. Even I am using Google Calendar Sync to sync my exchange calendar information back to the Google Calendar. It works in mobile and dekstop platforms so well.
Remember The Milk - The best task organizing tool I ever have seen. It has got Gmail Plugins, Android and iPhone (Free but lot of limitations). But whatever we’re getting in the desktop is simply awesome. It supports the quick add of events like “Meeting my friend on Saturday 10.00 AM. This may simply create even called “meeting my friend” and the time and other information will be parsed from the input text given. Simply implemented similar to Google Calendar Quick Add Features.

Android - Some of the apps like Gmail and Google Maps are simply awesome in Android platform and most of the cloud based apps are available in this platform and keep evolving

What  I am missing. I need a perfect cloud based image editor similar to Photoshop. The concepts of Tablets and Chrome netbooks are exceptionally promoting cloud centric softwares. I hope we will be handsfree soon.

DRY – Don’t repeat yourself

DRY – Don’t repeat yourself.
DIE – Duplication is evil

The above principles are applied in Software engineering to reduce the complexity, increase the quality and maintainability of the software(or any work product comes under the system). This principle coined by Andy Hunt and Dave Thomas in their book called “The Pragmatic Programmer” which is one of my highly recommended book for every software developer.
Every piece of knowledge should have a single, unambiguous, authoritative representation within a system.
This is applicable in the entire life cycle of a product from the design, to documentation, coding to test cases. This approach makes the software (or work product) high in quality and lower the maintenance effort.
For example, in my programmers’ life I’ve reviewed several code where we can find the same code is repeated across multiple files, or even multiple functions in the same file. The problem is the logic may have bugs and later if this part want to be removed or modified, we’ve to take care all part of the system to ensure we’ve properly modified it and ensure nothing is broken. This is increasingly complex if the project is too large and several people working on it. But if we define it in a single meaningful way and make the entire system make use of this unique piece of source code, that’s the best way tot manage complexity and maintainability. The cost for fixing such issues are very high. The bugs are always cost effective during the development period. Once if it’s released to the market, the cost to deploy the updates are too high and risky.
Not only Duplication, mostly the developers leave orphan functions which may cause confusions. for e.g. ProcessPresetChange() and OnPresetChange(). (Take it, I’ve see such kind of code several times). These functions doing the same stuff. How does it created? First a  simple version of this function was implemented. Later due the poor quality of code, the new programmer has learned things himself and implemented another function which is invoked from a different user action. The previous function was written for test purpose. Anyway the problem solved temporally. Later, when another person wants to modify the same function, which one he will modify? The previous programmer left the orphan functions in the same source file. The new person has to find out where the functions are being called and replace it well. This is extremely costly and confusing.
The duplication can arise in several situations.
1. Developer is forced to duplicate the information as he has no other way.
2. Developer unknowigly duplicate the information without having proper understanding of what he do. The senior developers should orient the team members towards the data flow, architecture and the way to accomplish things before people start to work on the products.
class Line
{

int start, end, distance;

…..

};
The above class may find good enough to get things done. but what if it was written like this,
class Line
{

int start, end;

public:

GetLength(){ return end – start;}

};
3. Lazy programmers find duplication is the easiest way to get things. They’re the real evils.
4. When collaboratively working with large number of team, the duplication can be occurred from different resources. In this context the teams should share the design and other knowledge enough to work well each other. Reusable components are the solution to solve such kind of problems.
I’ve mainly talked in programmer’s point of view. This applicable everywhere like Database management, documentation etc.
On closing, Keep in mind “Don’t Repeat Yourself”