12 programming mistakes to avoid

The dirty dozen of application development pitfalls -- and how to avoid these all-too-common programming blunders

By Peter Wayner, InfoWorld |  Development, application deployment, IT management

A car magazine once declared that a car has "character" if it takes 15 minutes to explain its idiosyncrasies before it can be loaned to a friend. By that standard, every piece of software has character -- all too often, right of the box.

Most programming "peculiarities" are unique to a particular context, rendering them highly obscure. Websites that deliver XML data, for example, may not have been coded to tell the browser to expect XML data, causing all functions to fall apart until the correct value fills the field.

[ Also on InfoWorld: Find out which 7 programming languages are on the rise in today's enterprise. | Keep up on key application development insights with the Fatal Exception blog and Developer World newsletter. ]

But certain programming practices send the majority of developers reaching for their hair upon opening a file that has been exhibiting too much "character." Spend some time in a bar near any tech company, and you'll hear the howls: Why did the programmer use that antiquated structure? Where was the mechanism for defending against attacks from the Web? Wasn't any thought given to what a noob would do with the program?

Creatures of habit, we developers seem locked into certain failure modes that can't be avoided, such is the frequency with which we fall prey to a particular poor programming practice.

Below you will find the most common programming pitfalls, each of which is accompanied by its opposing pair, lending further proof that programming may in fact be transforming into an art -- one that requires a skilled hand and a creative mind to achieve a happy medium between problematic extremes.

Programming mistake No. 1: Playing it fast and looseFailing to shore up the basics is the easiest way to undercut your code. Often this means overlooking how arbitrary user behavior will affect your program. Will the input of a zero find its way into a division operation? Will submitted text be the right length? Have date formats been vetted? Is the username verified against the database? Mistakes in the smallest places cause software to fail.


Originally published on InfoWorld |  Click here to read the original story.
Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Spotlight on ...
Online Training

    Upgrade your skills and earn higher pay

    Readers to share their best tips for maximizing training dollars and getting the most out self-directed learning. Here’s what they said.

     

    Learn more

Answers - Powered by ITworld

ITworld Answers helps you solve problems and share expertise. Ask a question or take a crack at answering the new questions below.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Ask a Question