DON’T fix what isn’t broken

The biggest problem with some programmers is that they like to fix what isn’t broken. This starts out innocuously enough – a piece of code that works, but isn’t exactly an “ideal” piece of code. Then the programmer starts to fiddle with the code. This is all good and well, unless they take no precautions, i.e. they work on the original code and fail to make a copy of the code. What usually happens is they end up breaking the code. Then they can’t fix it.

I’ll say it again – make a COPY of the code.

If you do want to modify code that already works, consider the following:

  • Modify the code so that it has the same functionality, but is shorter or more efficient.
  • Modify the code so that it has the same functionality but replaces user-defined code with a built-in functionality.
  • Modify the code so that it has the same functionality, but is easier to read and understand.
  • Modify the code so that it has the same functionality, but orphaned code has been removed.

Note that modifying code can lead to errors being introduced into the code.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s