A ‘Lazy’ programmer may be your best programmer


It is an accepted fact that software has changed the world and is a critical component in the ongoing digital revolution. It is interesting to note however that if time is discounted, there is no task that software can do but a human can’t. But by doing repetitive tasks more efficiently and quickly, software has brought tremendous efficiency and accuracy to almost all work we encounter in daily life. Since each task is executed in the same manner, if one instance of the gives correct results it is guaranteed that the software, if bug-free, will always behave the same and give same results. And now, backed by artificial intelligence algorithms software is able to do even non-repetitive tasks reasonably well.



There are a lot of monotonous tasks that professionals do in every industry. In manufacturing, exact steps have to be followed to make a specific model of a car, in retail same process is followed for storing items or at checkout, in the fast food industry similar food is cooked the same way, and while driving we follow the same pattern of braking when we see a red light. All these tasks can and will one day be done by machine that will be controlled by software.

Programmers who write software make their living by making systems and processes efficient and accurate. Software encodes the logic of a process and the programmer job is to implement that logic correctly. However, developing software also entails several repetitive tasks. These can include manually executing a file copy sequence to run some piece of code, or to manually execute a test case by clicking on several menus to get to the functionality just implemented. Repetitiveness spills over in the way code is written too like when code to implement a common function is not reused but instead rewritten multiple times any place it is needed.

Other professionals can’t do much about the repetitive tasks they encounter in their industry and have to keep doing them regardless how lazy or bored they feel. The power to automate or make their tasks simpler does not rest with individuals, and only an organization level change can make a difference. However, programmers have the ability (or power!) to automate a lot of their repetitive tasks. Several programmers just don’t get lazy enough to be affected by the mind numbing repetitiveness of some of their work, however some do and those are the people you want in your development team.

These programmers are just too lazy for repetitive manual work. If they write some code that can be tested by executing a mouse click deep in the user-interface they will write a small function to test that code directly. If they need to copy recently compiled Dynamic Link Libraries (DLLs) to a folder, they will write an automated script to do the copy. To test the output of closed function they do not depend on launching the user interface, manually entering a value and checking if the function is giving write input. They realize that these tests may have to be repeated multiple times, hence the ‘lazy’ programmers write several unit tests for a single function to test the entire range of inputs. Even better, they write their unit tests first before writing any code (called test driven development nowadays) so that testing can be done without any dependency on the user-interface.

The ‘laziness’ of programmers even shows in the code they write. ’Lazy’ programmer have a hatred, almost a pathological one, of duplicate code. For them repetition of any sequence of code, is a cardinal sin in software development. These programmers carefully architect their solution and think carefully of their design before writing a single line of code. They put a lot of through in how they function hierarchy is built and exploit object-oriented properties of Inheritance and Polymorphism to the maximum. They know that ‘the more you sweat in design, less you are harassed in maintenance’ (with apologies to General Patton).

‘Laziness’ has benefits in Quality Assurance (QA) too. While manually testing a new software features is useful, once the feature becomes integrated into the application there should be an automated test flow (using tools like Selenium or CodedUI) so that the feature can be tested anytime with press of a button. Apart from running much faster user interface based automated tests also test the feature in the same deterministic way every time they are run, removing the possibility of a defect being overlooked due to human QA error.

Software professionals also spend lot of their time in configuring their build systems, tweaking compiler options and writing installation scripts for deployment. Then there is the added complexity of revision control. While these can be done by hand ‘lazy’ programmers have gone ahead and built several automated systems (a large proportion of which are open source). Automation in this area has happened so much that a separate specialized field (DevOps) has evolved to maintain automated software dealing with change control and deployment.

Hence, when you are looking for the next rockstar to add to your team do find how ‘lazy’ they have been in their past work.

Love or hate this article ? Have other ideas ? Please leave a comment below !

Comments

Popular posts from this blog

Part III: Backpropagation mechanics for a Convolutional Neural Network

Introducing Convolution Neural Networks with a simple architecture

Deriving Pythagoras' theorem using Machine Learning