Is that Lint in your pocket (or are you just pleased to see me)?

Eclipse crashed on me today whilst I was Linting (I guess that’s a word) my code. I didn’t lose any work since I had just saved all of my files, but when Eclipse went fut, it did so without releasing the lock on my workspace (meaning that any subsequent attempt to launch Eclipse failed). I wasn’t that bothered by this fact as this had happened to me on older versions of Eclipse, I just navigated to the .metadata directory in the top level of my workspace and looked for a lock file to delete. There wasn’t one. Cock. Now completely bemused by this conundrum I spent a good five minutes Googling for a solution, only to find that the more recent versions of Eclipse use operating system locks instead of lock files – nothing to delete, but a quick reboot forces “dead” locks to be released. Back to Linting – yay!

I actually quite enjoy Linting, even if it is quite laborious; done properly, i.e. taking time to understand each problem before correcting it, rather than doing whatever it takes to shut the blasted thing up , it is a great way to refresh your knowledge of good (and more importantly bad) coding techniques and helps to highlight problems in code design. I’m still a bit of a Lint noob, but I now understand that whenever Lint highlights a problem, it is always right, even if it takes me a while to catch up to what it’s complaining about!

2 thoughts on “Is that Lint in your pocket (or are you just pleased to see me)?

  1. An example would be a function call where I had mixed up the ordering of two parameters, one a boolean and one an unsigned 32-bit integer, the code compiled without warning but was flagged by Lint.

    The process of Linting seems to make me inflict my own code review upon myself that negates the blindness to problems that familiarity with the code brings. The code base in question has been left considerably better off from a design point of view and is now far easier to read, far easier to test/predict and therefore far easier to maintain. So like I said in the main post, a bit of a chore, but well worth doing!

Leave a Reply

Your email address will not be published. Required fields are marked *