Talk the language of Business
I have taken part actively in the talent search programmes for my employer. On most CVs, the candidates write something along the lines of "..ability to blend the language of technology with that of business..". However, I have found that most of them are not adept at understanding very trivial requirements that are posed to them during the course of the interview.
In addition to that, I have also seen amongst my peers of simply learning new tools and technologies, without any attention whatsoever to how businesses function.
This is a very significant limitation in my humble opinion.
- It limits the developer's perspective to that of the developer alone. He/she ceases to think in terms of the end user and how they would be using the product
- Inability to completely understand the customer requirements and deliver just what he wants instead of multiple back and forths
- Expanding their own knowledge on how technology can be useful in multiple domains and view every domain with the eye of a developer on how the pieces of the puzzle are put into place
- Little knowledge of where and how to apply the technical knowhow acquired
From a developer's point of view, I think business is as important as code. Being educated about different business domains also lets the developer suggest improvements and loopholes which the customer may have missed or may not have thought of. This can only be a win-win situation in terms of quality.
The Importance of Reading Between the Lines
To improve myself as a developer, I decided to pick up Heads First Object Oriented Analysis and Design. One of the chapters in the book is titled analysis(doh!). It talks about penning down the requirements to have use cases and starting with the coding afterwards. This is to find the nouns, which become classes and verbs, which become methods. It made me think about the importance of language and reading the finer print.
Most of us simply read the user stories specified by the customer and go about writing, albeit with good intentions, some piece of code which may not be extendable. This is mainly because we miss the minor details in a step in a use-case. It could simply be an adjective or an adverb.
Having below par communication skills is also a reason for this, which I blame on the education system which doesn't give any importance to language as much as it does to the sciences.
I believe that improving communication skills is as important as improving on a technical level. One could be excellent at a wide array of languages and technologies, but if he/she cannot express his thoughts it's pointless.
Blogging, reading blogs, listening to podcasts, reading literature etc helps a lot in this aspect.
Kernel Gotcha!
The linux kernel got me into a corner again. The last time it happened, we had a production server downtime for a whole day because Tomcat decided that it was a good time to misbehave and not deploy the application properly. This time, it was less severe and affected only the wireless network on my machine.
But not before giving me a few headaches, delaying my supper etc. I had had no issues connecting to the network in the morning. What I had forgotten, however, was that a software update had happened and that the restart had actually happened only this evening. I tried restarting the wireless device using the switch on my laptop a few times to no avail.
Googling for "Device not Ready", threw up all kinds of crazy suggestions including upgrading the Ubuntu version to 10.10 or 11.04! For a small (Ok, not so minor) issue like this, it looked like too much effort.
/var/log/syslog had this to say though
iwlagn 0000:03:00.0: Driver unable to support your firmware API. Driver supports v5, firmware is v0.
Putting that as the search string took me to this bugzilla page. A 6 day old bug. The fix was right there. The steps given here saved.
What's weird is that running modprobe iwlagn bnep btusb rfcomm sco threw up some weird error. Somewhere in between the modprobe iwlagn and modprobe bnep, the wlan started working!
Hope this post saves a few people's pain.
HTTP to HTTPS Redirect Issue on jQuery Ajax
I was configuring our application to run on HTTPS mode the other day. The setup seemed smooth thanks to the wonderful resources available on the internet for the search string "setup https apache ubuntu". However, we were in for a surprise when we found out that a part of the page, which used to get updated with a jQuery based form submit stopped working. On investigation using Firebug, which is a wonderful firefox add-on that every web application developer should use, we found that the redirect issued from the action which was handling the form submit was setting the Location header in the response to use http as opposed to https.
Again, the wonderful world of interwebs came to the rescue(what shall we do without it?!) The trick lies in editing the Location header to use https instead of http.This is accomplished by enabling mod-headers on apache with a2enmod headers and then, adding a line Header edit Location ^http://(.*)$ https://$1 inside the <Location> tag in the Apache config file for the particular site. A small configuration, but an elegant way to get things working when it gets ugly.Is too much abstraction a good thing?
I have been working with Grails for more than 2 years now. The amount of detail it hides from the developer and thereby helping him focus on the business logic is tremendous. The only thing a developer needs to know is the syntax to write groovy code. A vanilla java application can be built and deployed in a matter of hours, if not days.
While going through the mailing lists, I often see references to what is possible with the framework giants upon which grails stands. This made me wonder whether it is indeed a good thing to jump straight into such a framework without knowing what lies underneath. Or at least, learn how to develop with such a framework and spend some time later on, learning how the underlying system looks like and how it is glued together. This I feel, will let the developer use the framework much better and appreciate its power features.
I also feel that this will help the developer understand the framework better and contribute towards enhancing features, which could overcome the pain areas faced while using another framework, in which developing a certain feature could be very time consuming.
What I want to ask is, Is too much abstraction a good thing? At least, the developer should realize that going a little bit into the internals can only help him in the longer run.
PS : I regret not paying attention to the algorithm/data structures lectures in university. Those could have helped me appreciate the collections framework better than what I can do now.
Amazon EBS Mounting : A Life Saver when HDD space runs out
We were having a crisis on our production server last night. It ran on a VPS and a hardware/software upgrade by the providers meant that the kernel got corrupted and we couldn't deploy a WAR file on Tomcat! We couldn't identify the issue at all and spend a whole day, albeit with downtime on a live website to figure out what was wrong.
We decided, after quite a bit of time, to move our infrastructure to Amazon EC2. We went ahead with copying our production setup to an EBS backed large instance. So far so good. We ran a few tests on the application and saw that the public facing side of the website was doing well. So far, so good. We decided to switch the DNS to point to this instance (Elastic IP, you beauty!). However, worse was in store. We noticed that image magick, which is used by our application through a Process wasn't working. We had to get this fixed in about 20 minutes because there were some physical documents to be generated and sent out, based on the input from image magick.
Attachable EBS volumes came to our rescue. Our application generates quite a lot of static documents, which we save on the file system. This could be moved elsewhere. We quickly setup a new volume, formatted it, mounted it and with a few linux commands like cp, mv, ln etc we were on our way. With zero downtime.
Did I mention that we got it done 5 minutes before the deadline? ;)
Hibernate Deadlock Due to Concurrent Access of Same Domain
In one of the projects, we were using the concept of Webflows and the framework was such that it created a hibernate session for each flow. We had a master copy of domain objects and some of them would be stored as a collection under the domain object being created by the flow. For this purpose, we had to bring the list of all available objects on to the flow using the standard hibernate list function.
However, we were in for a surprise when the application started hanging up after a while. This, in most cases when there were concurrent access of the domain class by multiple users using the same flow. Analyzing the thread dump showed that the application was going into wait state, while trying to access the DB connection resources.
We solved the issue by using hibernate's discard method to detach the list of domain objects from the session, once they had been read from the DB. This along with eager fetching of fields for associations in the domain class being fetched provided us with a complete and robust solution.
Ingraining the Habit of Good Naming Conventions
I have been heavily involved with the training of a group of "fresh out of college" folks at my work place. The responsibilities include scheduling, reviewing what they have done, getting feedback about the quality of each session etc.
One thing I noticed, which each one of them were lacking was the habit of naming variables, methods etc sensibly. Very often, I would come across names like abc, pqr, abbreviations of the class name etc (like loggedInUser becoming lgdusr). This made the code review, an exercise in futility.
Mark Needham has rightly observed about this in one of his posts which is aptly titled "University Coding". While studying at a university, the most programs one writes are algorithm based and doesn't involve more than 4-5 variables. However, in an industry where an application spans hundreds of classes, if not more, this kind of naming can only mean trouble. Comments do not help the cause at all. Like they say stating the intent in your code is the best documentation.

