Top 3 Software Development Mistakes You Should Avoid

Often software developers are involved in research and development where they get enough time to learn new technologies and align with the best practices and the standards defined in the official documentation.

On the other hand, most software developers are in a situation where the delivery of the code is more important than the quality of code. Yes, you heard this right. 

 

These are the situations when a software developer will make blunders either due to a lack of knowledge of the underlying code or the requirement. With my experience as a software engineer, I have made plenty of mistakes and have seen other developers making mistakes leading to a huge problem.

To make you realize how big of a problem a software bug can create, here is an incident that happened due to a software bug — Airbus issues software bug alert after a fatal plane crash, according to The Guardian report.

A CNN report of a software glitch on Boeing's 737 Max - A new software glitch was discovered on Boeing's 737 Max.

I have identified the top 3 mistakes that a software developer makes when writing a code — 

 

1. Stop Copying Code Blindly

Google helps us all in its own way. Software developers often come across issues in their code or look up solutions online from various sources like — StackOverflow, official documentation of library/package, npm docs, etc.

Sometimes even I realize it is better to take code already available and make it work. This is where a software developer tends to make a mistake. Here are few things that can happen if one is copying code directly — 

 

  1. Copied code requires all the necessary edits actually to make it work. I missed doing so; it can fail the process terribly when running the code.
  2. Many developers don’t even realize the risk of copyright. The code being copied might have copyrights, and the owners can easily claim royalty or even file a lawsuit.
  3. The last outcome is that copied code may work in one environment and fails in another. Since it is copied, it will become hard to find the right solution.

 

Here is something I suggest you follow when taking any piece of code from online sources — 

Always look for copyright/license text. There are types of licenses that will allow you to use the code but with some restrictions, hence act accordingly.

Make sure the source is legit. This means the source from which you are taking code might have taken from other sources and again can cause licensing troubles. Try to visit the official pages for most of your code references; that wait will be much safer.

 

2. Stop Using Exception Handling Everywhere

Most of the time, I see new developers using generic exceptions almost everywhere. This, again, is not required. Here is when you should use exceptions — 

  1. When a piece of code invokes an outside API call, Use a generic exception or the exception documented in the API docs.
  2. Use generic exception only when it can cause serious issues like terminating a script/process.
  3. Use exception handling when debugging your code. 

You can reduce the number of exception handling by doing one simple thing — Identifying permanent errors and fixing them in your codebase, hence not requiring to add any exception handling for that piece of code. You can find some good insights about exception handling in this great article on Medium - Exception Handling in Java.

 

3. Test Your Code In Multiple Stages

I have often seen a code break mainly because it was tested in one environment but not in the target environment. For example, a software developer writes code and tests in a development environment and not in Production/Non-Production environments.

Yes, this is a severe issue. How can a software developer for sure that the code works? The only way is to ensure this is to run it in the target environment and check if any discrepancies are observed.

 

An ideal way to ensure this is avoided is — Create multiple environments other than development environments. A separated group of members will test individual environments. For example, there can be a minimum of three environments to ensure the quality of code is good to run in the target environment-

  1. Development — Software developers, will code and unit test the software
  2. Non-Production/Test Environments — A team of testers will perform tests based on acceptance criteria defined by the actual users
  3. Production — A team from the User end will perform tests and provide feedback.

Once the code is tested in all these environments with flying colors, a software developer’s code is ensured as OK.

 

Conclusion

A code is only good to deploy once tested by a separate set of teams and reviewed internally. Software development is a long-running process, and bugs will be generated. But, it is up to us what level and severity of bugs are generated. 

Avoid these three mistakes, and I am sure you will be in a better position every time you run your code in the target environment.

 

More About The Author

I am a full-time software engineer with 4+ years of experience in Python, AWS, and many more technologies. I have started writing recently as it helps me to read more. I am looking forward to sharing technical knowledge and my life experiences with people out there.

Enjoyed this article? Stay informed by joining our newsletter!

Comments

You must be logged in to post a comment.

About Author

Data Analyst turned Software Developer and Blogger. Enjoys a hot cup of tea and nature’s spell. I write about Software Development and Programming, mostly about - Python, AWS, Serverless and Javascript.