Writing software is an art. Some poetic minds also say it’s like writing a symphony. No matter how you garnish it with fancy words, the fact remains that there are certain base things that a developer needs to write beautiful code.
From my personal experience, there are certain things a developer needs to concentrate and produce quality work. I will try to summarize some of them. By no means is this list meant to be all-inclusive or perfect, and I encourage debate about my choices. Nonetheless, I have found these things critical and when I’ve lacked a majority of things on this list, it has significantly affected my productivity.
- Distraction-free surroundings
Programming is all about logic, creativity, and thinking. Distraction is the enemy of structured thought. However, when you are at your workplace, many things can distract you. A sudden meeting, an urgent call on a critical app, jokes with your co-workers, or your neighbor playing music. This is part of team culture and can never be completely avoided, unless you are working from home.
When I look back at my performance and the period when I am most productive, it’s no wonder that most of my thinking and productive output occurs after 5 PM when there are few people around.
It is okay to get distracted at work. As long as you know the reason for distraction, you can always work things out. When being distracted, try to work on something which requires less mental burden and cognitive load. I am also a huge fan of white noise, which eliminates surrounding distraction and helps you concentrate.
2. Creative work
Every engineer dreams of shipping code that will make the world a better place. For example, we always strive to write code that will give users the best user experience. However, if you are entangled in repetitive and boring tasks, you will not be your happiest programmer self.
I‘m not saying that menial bugs and design fixes are unnecessary. I routinely work on these tasks, but they do go to the bottom of my list of work tasks that I find enjoyable. As the rule goes, there will always be more menial and uninteresting tasks compared to creative and challenging problems.
It also depends on your ability to handle the challenge. If you don’t like challenges and hate to think, you will always end up taking on tasks that are in your comfort zone. Staying in your comfort zone takes away all the fun of programming and the creativity for which you are born.
3. A fantastic team and great co-workers
I am fortunate so far to have worked with excellent teammates who were always willing to help. Three years ago, when I started my job in Columbus, iOS development was new to me, and everything I saw raised more questions than it answered. My mentor is a smart fellow, however, and would always come to my aid when I would raise questions.
One of the best parts of being on a team is to impart knowledge to team members. Instead of each team member learning everything alone, group knowledge saves a lot of time and acts as an excellent source for camaraderie among fellow developers. I can’t count how many friends I made by asking domain-specific questions when I started my current job.
Speaking of team members and co-workers, it is important to have a mentor — At least for few days — when you are getting started at a new job. Great mentors are helpful, approachable, a good teacher, and willing to help you grow in your new role.
If everything works out, some years down the line you could also be an awesome mentor for someone else. This tradition goes on!
4. Assume your work is mission-critical
What do you think when you write code? It just works? What if it doesn’t? Is it a big deal? For some people, it might be.
Always make the assumption that your code is going to get used in airplanes, a space station/shuttle, surgeries or any application where human lives are at stake. It may not actually be used in one of these scenarios, but the different perspective gives you a different angle to consider the quality of your code. You become more serious and concentrated. Your enthusiasm to make perfect code strengthens and adds to the quality and polish of the final product.
If you can convince yourself that sloppy work can kill someone, you get more serious about it. No one wants to be responsible (directly or indirectly, willingly or unwillingly) for a mistake that could prove fatal or unpleasant for other human beings.
For example, assume you write code that works once for every two tries. Now think about the same code being used in parachutes. If you knew that the parachute only has a 50% chance of opening, would you be willing to use that parachute? When you think this way, your whole perception changes.
Automation is an art and a creative way to save time and demonstrate the power of programming. Unfortunately, not all things can be automated. For example, we are not at the point yet where code can write itself, and bugs can not be automatically detected and fixed.
However, the good news here is that tasks that require less mental burden and are repetitive are great candidates for being automated. This includes but is not limited to creating a schema from JSON, search and replace with RegEx, and creating metrics to measure app performance.
A few months back I wrote a shell-script to automate the following tasks with a single bash script execution:
- Make a commit and push
- Create a build and distribute it to QA and Project Managers
- Create a summary of tasks accomplished in a single day and send an email to the Team Lead and the relevant Project Manager.
Before I wrote a script, all these tasks would take around 20 minutes of my daily time. The total time it took to write my script was 2 hours. After writing it, I can now automate and finish all these tasks just under 10 minutes without any further manual intervention.
We all need fuel to work, and not just physical fuel like food. I mean drive to dedicate energy toward the work at hand. You could assert that money is the major factor driving people to work, but money is just a base requirement. People will work for money, but they will fail to give consistently high performance and loyalty if motivational factors are missing.
This mental fuel can be simple appreciation from supervisors, a compliment that you are doing great work and that your results are making a positive impact on the company as whole. Some companies have recognition boards where a member of the team can recognize a colleague for their recent achievements. I personally like the open kudos from people saying I have done a great job.
Sometimes promotions, getting switched to better teams, and privilege to work on challenging projects are also great ways to show appreciation to employees.
These are my top picks that help me to do my job better and output efficient and productive results for the team. Did I miss anything? Are there any things that you do that allows you to write better code? Let us know in the comments below. We would love to hear your thoughts on it!