There are way too many bugs in software today. How many times have you seen the a screen of death? Do you like the phrase “PLEASE TELL MICROSOFT ABOUT THIS PROBLEM”? Did your Segway break your teeth? (Check out this video clip)
Software can kill you because too many of the people that build it don’t bother to build it right. Certain companies are notorious for pushing out software releases before it’s truly ready for customer use. The source code is riddled with bugs and inefficiencies that may never be corrected until they injure or kill someone. Inadequate use of software methodologies and shortcuts therein lead to annoying, expensive, and downright dangerous bugs. These are bugs that can be prevented with the proper care and feeding of source code.
Here are just a few things that help catch problems in software before it’s released. Perhaps you’ll use one to find a bug or two in your code before it goes out the door of your company. Maybe we can save some headaches, teeth, or a life.
Write code so others can read it.
This seems like common sense, but far too often source code is written in some very obscure ways. Variable, method, and class names are not descriptive. Indentation is all over the place. Not enough whitespace. The list goes on and on… Plain and simple: take care in writing your code to some agreed upon coding convention so some other sucker won’t make big mistakes.
Write and use automated tests.
Unit testing, White-Box, Clear-Box, Black-Box, X-Box (just kidding), etc. Find some you like and put them to use. The idea here is pretty simple. Write some code, submit it to source control and let some drone machine run tests on it. There are a bunch of ways to do this. My colleague Harold and I like running our tests with CruiseControl, but there are plenty to pick from.
Prevent bloat.
Don’t over-engineer your designs or your code. Solve the problem at hand in the most straight-forward and simple manner possible. Lots of code has bells and whistles that are never needed or used. Although these are creative, they can be a waste of time and introduce the possibility for more bugs. Software is an art-form and the impulse to go nuts is hard to contain at times. Control yourself (and keep an eye on others)! Write the ideas down for further discussion as they may very well be desired at some point. If not, you probably just saved lots of people lots of time.
Keep an eye towards the future.
There’s a fine balance between over-designed and extensible software. Learn to apply design patterns to keep your software limber and ready to change.
Reduce Redundancy.
In any project, the less code you have to manage, the better. Try to combine common code whenever you see it. If you find yourself making the same change in more than one place (copy/paste), you probably have a good candidate for code reduction. Some simple tips:
- Use common locations for constants, helper functions, etc. whenever possible.
- “Combine” class code by extending from classes that have similar functionality.
- See if code generation can help reduce repetitive coding tasks.
- Always take a step back to see if the problem you are trying to solve has been solved before. Leverage other people’s time in this situation by finding ways to use their solutions.
Take the medicine as per doctor prescribe you. online cialis india Quite a large number of online buy levitra pharmacies, over the past few years, emerged as great help for individuals tired of seeing sky high prices of the treatments that are not noticeably effective. Kesar levitra uk improves the blood flow, stamina and strength. Manufactured by Ajanta pharmaceuticals, Kamagra was introduced in tablet, jelly and soft tablet for in order to avoid buying from a fraudulent online pharmacy, you do not need of have a prescription and so you need not to be ashamed of while taking drug to improve your viagra ordination condition.
Know what’s going on around you.
Communicate with your fellow employees! Call, email, or simply talk to your colleagues about what you are working on. Ask as many questions as possible. You can prevent many mistakes you or others might make by bouncing ideas around and knowing what is going on around you.
Use source control.
Source control is useful not just for the obvious reason of keeping versions of code in a central location. It can also serve as a great communication tool. Monitor the code you care about however your source control software allows. Keeping tabs on what others are doing is not only a great way to learn, but also helps others follow some of these guidelines.
The more opportunity you create to catch mistakes that lead to bugs, the better. Software developers need to help each other create better software. Remember: Prevention is the best medicine.