10 bad coding practices that wreck software development projects

Avoiding these common coding practices will make your work easier -- and your software more secure and scalable to boot

The Pareto concept declares that 80 % of results can be linked to 20 % of the possible causes of a given occasion. Also known as the 80-20 concept, it's appropriate to almost every area of human attempt.

In the area of software growth, the key can be described by saying that most problems are due to some bad development methods. Remove them and your perform will be very much simpler and more effective.

[ Work wiser, not more complex -- obtain the Developers' Success Information from InfoWorld for all the tips and styles developers need to know. | Keep up with the newest designer information with InfoWorld's Developer World publication. ]

These 10 development methods are the most severe causes.

1. Typing errors in your code
These are amazingly common, and they are frustrating because they have nothing to do with your development expertise. Even so, a incorrectly spelled varying name or operate name can ruin your concept. What's more, they may not be simple to identify.

What's the solution? Working in a excellent incorporated growth atmosphere (IDE) or even a programmer-specific written text manager can decrease punctuation errors considerably. Another factor you can do: Purposely choose varying and operate titles that are super simple to cause and, therefore, simple to identify when they have been incorrectly spelled. Prevent terms such as get, which easily be incorrectly spelled get without being apparent.

2. Unable to indent or structure your code
Indenting and otherwise style your concept creates it much simpler to comprehend at a look and, therefore, identify errors. It also creates it far simpler for other people to sustain your concept, as it's provided in a regular fashion.

If you use an IDE that doesn't instantly structure your concept, consider operating it through a concept beautifier such as Uncrustify, which will structure it continually according to the guidelines you set up.

3. Unable to modularize your code
It's excellent development exercise to create features that do one factor and one factor only. That helps keep them short and, therefore, clear and understandable and sustain. Long features have many possible routes through them, creating them much more complex to analyze.

[ Analysis: How Code Market segments Can Cut Program Development Costs ]

A excellent concept of thumb: One operate should take up no more space than a single display. Another one: If it has 10 or more "if" claims or circles, then it's too complex and should be rewritten.

4. Allowing Your IDE Lull You Into a Incorrect Feeling of Security

IDEs and other resources that provide concept finalization are amazing for efficiency. They recommend factors and other things based on what is in opportunity, given what you have already entered. But there's a risk with this type of device - you can choose something because it looks like what you anticipate without taking the necessary attempt to make sure that it's exactly what you want. Basically, the device does the considering for you, when you in fact are accountable to make sure that the considering is right.