Be a Lazy Developer

Hasitha Gamage
Nov 8 · 6 min read

Introduction

This article will motivate you to be a lazy developer or engineer also explaining how, when and why we need to be lazy. Usually, the industry is looking for energetic personalities. Then why we need to be lazy man?

When need to be a lazy developer?

I believe we have to be lazy to do repetitive things or doing a thing which might be reparative. Here we are not saying about negative laziness. I standing for positive laziness. The whole idea is if we found some repetitive or potentially repetitive work, we should not do the work. We have to be lazy about it. We have to invest some time to automate it. In this case, most of the engineers are like to automate things as much as possible. But due to the timelines, most of them are not investing time and effort on automation. But I believe we have to be lazy about doing reparative things and due to that, we have to find a way to automate things as much as possible.

Why need to be a lazy developer?

The main reason is investing some time and effort to save more time and effort. We might need to spend more time and effort to do the thing the first time. But It’ll save more time later on.

Apart from that, we might get other additional benefits as well. As an example, When we are adding a new ESB server to the existing infrastructure, I wrote a script to check the connectivity. At this moment There was no reparative work since we need to do that verification only one time. But what I feel was It might be a reparative work when we add a new ESB node again. But at that time, we don’t have a vision about ESB scaling up furthermore. But I wrote that script due to two reasons. One was not to missed any verification and the second reason was at that time I feel that it might be reusable without any reason. After a few months, we had to change the infrastructure and get new servers for the ESB setup. At that time, we were able to save lots of time. This infrastructure was updated in a few phases due to the complexities. Hence that script was very useful.

More than that, due to some reason, one ESB server was getting restarted and It starts with the new IP address. At that time we had to make sure about the connectivity since those days we were using IP whitelisting for the old setups. That script helps to handle that kind of situation as well. Just imagine if we don’t have that kind of script in that situation, we need to find a set of components that ESB is accessing. Then we need to check the connectivity one by one. In the production scenarios, we have to do things fast and very accurately. If we are lazy to do manual things and if we are trying to automate things as much as possible, It might provide the ability to handling the hard times.

How to be a lazy developer?

In here I like to share a few of my experiences. It will privilege you to think about your day to day activities and helps to identify a way to automate those. Sometimes you might be faced with the same situations that I was faced with.

  1. Dev testing — Usually I’m working on API implementations. After doing some API implementations we are doing a dev testing for the main scenarios. In this case usually, I’m creating a postman suite for it. I used all variables as parameters including the server URL. It helps me lot to save more time and effort when we have to do a change on API as well as when we are moving environment to environment (Dev/Test/Staging/Production). Moving to a new environment is just a variable change and do not need to worry about the scenarios again and again.
  2. Implementations — In the implementations, if I feel we are implementing the same logic, again and again, I try to implement a generic method. I believe any engineer is doing this thing since it was a best practice.
  3. Unit test implementations — In this scenario, most of the engineers do not try to do it in a generic way or apply design patterns since most of the guys are thinking, it is not the implementation and it will not add any business value. It’s because of not realizing the importance of unit tests. But if we can implement some generic way to generate our request objects for different scenarios and generic methods tp asset the success and error responses, we can implement unit tests very easily. It will save a lot of time and effort.
  4. Clone git repositories — Once I had to format my laptop suddenly and I missed my git clones. Then I had to clone git repo one by one again. It was not an easy job since I had to clone around 100 repositories. Apart from doing it manually, I was implemented a script to clone repositories. After that, I had to format my laptop two times, in those situations, git repo cloning was one single line command execution. Also, that script was used by new joiners of our team.
  5. Fast-forwarding repositories — With the old repository management process, we have to fast-forward the master branch to the latest release branch. It was time-consuming one since we have to go each and every repo, get the pull, checkout to the correct branch and executing commands to fast-forward. I wrote a script to do this thing by reading an excel file. After that what we need to do is, we have to just update the excel file and execute my script. It saved lots of time.
  6. Managing utility project —Usually, I’m maintaining some utility project which includes file readers/writers, email senders, different types of database connectors, etc. If I need to write a script I need to just worry about the business logic. Most of the time I have the utility method that I need. If not first I adding that utility to my project and then I’m doing the implementation. Day by day my utility is becoming more richer.
    Some times we have to create and execute a set of queries which are in a similar manner. As an example, when we need to need to create a set of users with the set of permissions we need to execute several queries. To generate those sets of queries once I have implemented a script with modularizing the string manipulation part. That scripts and string manipulation component have been used more than a hundred times.
  7. Performance testing — While doing the performance testing we need to look into several stats periodically. To do that I wrote a few scripts. It’ helps us to get stats without manual intervention. Also, we had a script to getting and analyzing the JTL file due to its large size, when we are doing endurance testing. To handle that I wrote a very simple bash script to break JTL from time to time. This kind of scripts saves our time a lot.
  8. Using different tools — When we need to do some common things like data manipulations. There are tons of online/free tools that we can use, rather than doing the whatever job It’s easy to search for some tool, on the internet
  9. Application Deployment on the local machine— Some times we are executing the same set of commands to deploy our application on our laptop. As an example, if you need to deploy a java application on tomcat, you need to build it, stop the tomcat, remove the existing war file, copy new war file and start the tomcat server. Why we can’t write a small bash script to do this. It saves time more than we think.
  10. Utilize the IDE features — Also these days we have very powerful IDEs. Those are containing so many features and short cuts to make our work easy. We have to be aware of those and we can use those to leverage our implementation efficiency.
    A few years back we used multiple jobs to build a docker container and deploy it on some environment. On those days Jenkins has released the deployment pipeline feature. We had used it to handle the entire CI/CD flow. It saves a lot of time by using that feature.

Conclusion

I believe that it is very important to build a mindset that always tends to find automated solutions. If you try to be a lazy developer to doing reparative things and potentially reparative things, you might be a good time and effort saver.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade